A simple time based study - EasyLanguage Programming | futures io social day trading
futures io futures trading


A simple time based study
Updated: Views / Replies:1,062 / 4
Created: by robz75 Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

A simple time based study

  #1 (permalink)
Elite Member
baltimore md/usa
 
Futures Experience: Beginner
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 16 since Jul 2014
Thanks: 0 given, 0 received

A simple time based study

Does anyone have some simple code for this idea?


Looking to run a study on @es that looks to test a buy and sell signal based on time of day. So it would say after x time of day buy and then at x time of day sell.

Example would be at 0945 buy this bar close and at 1600 sell. Looking to test all times to buy up until 1600 so both the time to buy and then time to sell need to be optimizable.

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary


robz75,

do you have some code written yourself already?
With time based inputs optimization can be more "problematic" as when you try to optimize from 930 to 1030 in steps of one, the optimizer would also test 961, 962 etc.. One way around that is to use minutes since midnight as an input for example. This might take some time to getting used to it, but it will avoid the issue with non-existing times.
This should get you started:
 
Code
Inputs:
StartTimeInMinutes(570),
EndTimeInMinutes(960);

Variables:
StartTime(0),
EndTime(0);

//convert minutes to time
once 
begin
StartTime = MinutesToTime( StartTimeInMinutes ) ;
EndTime = MinutesToTime( EndTimeInMinutes ) ;
end ;

if Time = StartTime and MarketPosition = 0 then 
//put your entry order here

if Time = EndTime and MarketPosition <> 0 then
//put your exit order here
Regards,
ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #4 (permalink)
Elite Member
baltimore md/usa
 
Futures Experience: Beginner
Platform: TradeStation
Favorite Futures: Futures
 
Posts: 16 since Jul 2014
Thanks: 0 given, 0 received

Thank you sir, yes I just finished it up and that was exactly the problem I was running into. Not sure how good the code is either. Was talking to some folks and they provided some code to use the computer time but it sill shows times like 960 990 etc when running the optimization. My code is below but let me give yours a shot. I like the idea of minutes much better! I put a trend filter on this one when I was testing. Only buy when price is above moving average.


Inputs:
THE_OPEN (0930),
THE_CLOSE (1600),
Price( Close),
RegimeLookback (50) ;

// define ALL your variables for storage.
Var: Min(0),TheOpen_Min(0), MA200 ( 0 );

Min = timetominutes(time);
TheOpen_Min = timetominutes(The_Open);
MA200 = Average(Close, RegimeLookback);


// The_Open to The_Close - 1 barinterval to allow a close before the market close's.
If min >= TheOpen_Min and Min <= timetominutes(calctime(THE_CLOSE,-barInterval)) and ( Close > MA200 ) Then
Buy next bar market;

Reply With Quote
 
  #5 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

robz75,

you are welcome. My code is just something I put together here in the thread. One issue that could occur is that there is no bar with the time you are currently testing. That would obviously much more dangerous for the exit than for an entry. So it might make sense expand the code with two flags a bit to allow for those situations.

 
Code
Inputs:
StartTimeInMinutes(570),
EndTimeInMinutes(960);

Variables:
EntryAllowed(true),
ExitAllowed(true),
StartTime(0),
EndTime(0);

//convert minutes to time
once 
begin
StartTime = MinutesToTime( StartTimeInMinutes ) ;
EndTime = MinutesToTime( EndTimeInMinutes ) ;
end ;

//new day, reset flags
if Date <> Date[1] then
begin
EntryAllowed = true;
ExitAllowed = true;
end;

if Time >= StartTime and MarketPosition = 0 and EntryAllowed then 
begin
//put your entry order here
EntryAllowed = false;
end ;
if Time >= EndTime and MarketPosition <> 0 and ExitAllowed then
begin
//put your exit order here
ExitAllowed = false;
end;

Reply With Quote
The following 2 users say Thank You to ABCTG for this post:

Reply



futures io > > > > > A simple time based study

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
time based easylanguage kraniv EasyLanguage Programming 3 March 12th, 2015 04:18 PM
Color a Bar BAsed on an ALert Condition on a Study Traderwolf Sierra Chart 1 November 26th, 2014 09:08 PM
Converting time based charts to volume and tick based charts SeanKozak Commodities Futures Trading 1 April 1st, 2014 10:05 PM
Linda Raschke webminar - time of day study ptcm The Elite Circle 6 July 14th, 2013 03:52 AM
How to color the CD study based on a MA in Sierra Charts Big Mike Sierra Chart 10 October 13th, 2011 04:04 AM


All times are GMT -4. The time now is 03:48 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-17 in 0.09 seconds with 19 queries on phoenix via your IP 107.20.115.174