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 cmoran13, Yesterday, 01:02 PM
    0 responses
    25 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    17 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    160 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    94 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    147 views
    2 likes
    Last Post CaptainJack  
    Working...
    X