Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

OnMarketData

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

    OnMarketData

    Hello,

    I always receive twice MarketDataType == Last event.

    protected override void OnMarketData(MarketDataEventArgs e)
    {
    if (e.MarketDataType != MarketDataType.Last) return;


    Print("MarketDataType = " + e.MarketDataType + " price: " + e.Price + " vol " + e.Volume);

    }

    Output Windows:

    MarketDataType = Last price: 190.19 vol 100
    MarketDataType = Last price: 190.19 vol 100
    MarketDataType = Last price: 190.18 vol 100
    MarketDataType = Last price: 190.18 vol 100
    MarketDataType = Last price: 190.17 vol 100
    MarketDataType = Last price: 190.17 vol 100
    MarketDataType = Last price: 190.18 vol 100
    MarketDataType = Last price: 190.18 vol 100
    MarketDataType = Last price: 190.18 vol 200
    MarketDataType = Last price: 190.18 vol 200
    MarketDataType = Last price: 190.18 vol 121400
    MarketDataType = Last price: 190.18 vol 121400

    sincerely,Kobi

    #2
    Hello,

    Thank you for the question.

    Based on the output, it would appear you are using two series is this correct? If so this would be expected, there is an example that shows how to determine which is being called here: http://ninjatrader.com/support/forum...d.php?p=423923

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by dward123, 01-02-2024, 09:59 PM
    4 responses
    174 views
    0 likes
    Last Post Lancer
    by Lancer
     
    Started by ETFVoyageur, Today, 04:00 PM
    2 responses
    19 views
    0 likes
    Last Post ETFVoyageur  
    Started by AaronKTradingForum, Today, 03:44 PM
    1 response
    8 views
    0 likes
    Last Post AaronKTradingForum  
    Started by Felix Reichert, 04-26-2024, 02:12 PM
    11 responses
    80 views
    0 likes
    Last Post Felix Reichert  
    Started by junkone, 04-28-2024, 02:19 PM
    7 responses
    83 views
    1 like
    Last Post junkone
    by junkone
     
    Working...
    X