NexusFi: Find Your Edge


Home Menu

 





Establish sessions from the code


Discussion in TradeStation

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




 
Search this Thread
  #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?
Strike Pause Holds, Oil Erases Monday Spike -- May CPI W …
Traders Hideout
Election Sunday Resolves: Peru Heads to Runoff at 42pct, …
Prediction Markets & Event Contracts
CME Cuts Precious Metals Margins Up to 21% Starting Toda …
Commodities
Post-Summit Market Verdict: ES -1%, NQ -1.5%, 10-Year Yi …
Traders Hideout
Rubios Good News Within Hours and the 30-Day Math: Why H …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
205 thanks
Sober Journey With S&P
21 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
Thanks Mike. Godspeed.
7 thanks
  #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


© 2026 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 - Downloads - Top
no new posts