Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Initializing a Counter when using OnMarketData method

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

    Initializing a Counter when using OnMarketData method

    I am creating a simple counter to sum up the number of trades using the OnMarketData method---I need to initialize the summation variable on the first trade of the session---is there a value for the first trade similar to the FirstBar or FirstTick ?

    I notice a MarketDataType.Opening--but found nothing in the documentation on it-can you explain it?

    Thanks.
    Jim-Boulder
    NinjaTrader Ecosystem Vendor - Elephant Tracks

    #2
    Jim-Boulder,

    There is no "FirstBar or FirstTick" in OnMarketData. The .Opening you saw would have to be provided by the data provider. Some will provide that information and some will not. Your best bet is to check time of timestamps versus your desired session begin time and the moment there is a tick >= that timestamp, start counting.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    579 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X