Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

During TickReplay check if data being processed belongs to lastest available session

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    During TickReplay check if data being processed belongs to lastest available session

    Hi, while developing one indicator I stambled upon an issue which I wanted to ask you: let's suppose I have 2 sessions per trading day on which I would like to see the price chart and the indicator, say the sessions are classic ETH and RTH.

    First, when creating the chart I set the instrument, then I set the Data Series to load 4 days prior to today. For instance, today is October 19th and currently is 6:35 AM in my timezone: so I am asking to load the data for 18, 17, 16 and 15. I also activate the Tick Replay as I need the history of all the ticks for my indicator. Afterwards I put my indicator on the chart.

    What I would like to do - in the code of the indicator - is to implement some logic which within the OnMarketData allows me to check whether the data being processed in the Tick Replay phase belongs to the current session (e.g., ETH of October 19th) or if it belongs to past sessions. Please consider that such implementation need also to work in Playback mode (for this reason I can't use the DateTime.Now to detect somehow the current date time).

    Thank you in advance!
    Cheers







    #2
    Hello VF126,

    Thanks for your post.

    You may consider using a SessionIterator in your script to get data about trading hours.

    Note from the SessionIterator help guide: "Should you wish to obtain trading hours information for historical bar values, you need to construct and store your own session iterator object based of the desired bars series array."

    See this help guide page for more information: https://ninjatrader.com/support/help...oniterator.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    597 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    343 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    556 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    555 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X