Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnMarketData

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

    OnMarketData

    Hello,

    I have a question referring OnMarketData please and I couldn´t find a reply in the forum. When should one put conditions

    protectedoverridevoid OnMarketData(MarketDataEventArgs e)
    {
    if (BarsInProgress>0)
    return;
    here conditons???

    and when

    if (e.MarketDataType!=MarketDataType.Last)
    return;

    here conditons???


    Thank you
    Tony
    Last edited by tonynt; 12-18-2017, 10:00 AM. Reason: translation error, clearifying

    #2
    Hello,
    Thanks for your note.

    You are correct. You may put additional conditions in both of those locations.
    Here is a collection of forum posts with NinjaScript reference samples. These will give you an idea of how to structure your code.
    Reference Samples
    https://ninjatrader.com/support/foru...ead.php?t=3220

    Please let me know if you have any further questions.
    Josh G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    133 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    75 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    117 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    113 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    90 views
    0 likes
    Last Post CarlTrading  
    Working...
    X