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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    63 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    88 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    47 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    105 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    63 views
    0 likes
    Last Post PaulMohn  
    Working...
    X