NexusFi: Find Your Edge


Home Menu

 





Establish sessions from the code


Discussion in TradeStation

Updated
    1. trending_up 1,491 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Establish sessions from the code

  #1 (permalink)
jdtrujillo1015
Medellin Colombia
 
Posts: 7 since Jul 2012
Thanks Given: 0
Thanks Received: 0

Hello,

As you know, you can choose the sessions on TS (pre-market, post-market, 24h, regular sesions, etc). And when you do that it shows you only the bars of that sesion and all the indicators or strategies use those bars. Well, what i want is to do that from the code, right now i have an strategy that works in a session from 2 to 14(it only consider those bars), i would like to modify the code in order to obtain the exact same results but working with sessions of 24 hours (in which only it will consider the bars from 2 to 14).

I hope its clear what i like to accomplish and thanks for your answers.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
What broker to use for trading palladium futures
Commodities
REcommedations for programming help
Sierra Chart
About a successful futures trader who didn´t know anyth …
Psychology and Money Management
ZombieSqueeze
Platforms and Indicators
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #2 (permalink)
 
treydog999's Avatar
 treydog999 
seoul, Korea
 
Experience: Intermediate
Platform: Multicharts
Broker: CQG, DTN IQfeed
Trading: YM 6E
Posts: 897 since Jul 2012
Thanks Given: 291
Thanks Received: 1,039


jdtrujillo1015 View Post
Hello,

As you know, you can choose the sessions on TS (pre-market, post-market, 24h, regular sesions, etc). And when you do that it shows you only the bars of that sesion and all the indicators or strategies use those bars. Well, what i want is to do that from the code, right now i have an strategy that works in a session from 2 to 14(it only consider those bars), i would like to modify the code in order to obtain the exact same results but working with sessions of 24 hours (in which only it will consider the bars from 2 to 14).

I hope its clear what i like to accomplish and thanks for your answers.


set your chart timeframe to 24 then set your code to run IF time > 0200 and time <= 1400 then begin
.....

Reply With Quote
  #3 (permalink)
jdtrujillo1015
Medellin Colombia
 
Posts: 7 since Jul 2012
Thanks Given: 0
Thanks Received: 0


I already try that and didn't work. From 14 to 2am the variables take the same result and then when i use an average or something like that the result is different.

Reply With Quote
  #4 (permalink)
 
treydog999's Avatar
 treydog999 
seoul, Korea
 
Experience: Intermediate
Platform: Multicharts
Broker: CQG, DTN IQfeed
Trading: YM 6E
Posts: 897 since Jul 2012
Thanks Given: 291
Thanks Received: 1,039

are you doing 0200 to 1400 or 1400 to 0200 and crossing midnight?

Reply With Quote
  #5 (permalink)
jdtrujillo1015
Medellin Colombia
 
Posts: 7 since Jul 2012
Thanks Given: 0
Thanks Received: 0

I need that the strategy only considers the bars from 2am to 2pm, the problem is that from 2pm to 2am the variables take the same value so when i use a moving average the result is different.

Reply With Quote




Last Updated on December 5, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts