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

MarketDepthEventArgs - Clarification needed

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

    #16
    Originally posted by NinjaTrader_Dierk View Post
    OnMarketData() will NOT be called before Initialize().
    Dierk

    Can I suggest that you create a custom indicator using the attached code and then run it against any instrument.

    I have also attached the log that it generates when connected to my ZenFire feed for the 6E futures contract.

    You will see that the order of events firing is:

    Initialize()
    Time : 16:05:19
    This event is fired when the Indicators dialog box opened

    Initialize()
    Time : 16:05:25
    This event is fired when the DumpEventSequence indicator is selected within the Indicators dialog box

    OnMarketDepth()
    Time : 16:05:28
    MarketDataType : Ask
    Operation : Insert
    Position : 0
    Price : 919.5
    Volume : 668
    This event is fired 10 times to insert the 10 rows of the order book

    Initialize()
    Time : 16:05:28
    This event is fired when the DumpEventSequence indicator is added to the chart

    OnBarUpdate()
    Time : 16:05:28
    This event is fired numerous times as the DumpEventSequence indicator processes the historical bars

    As you can see, the OnMarketData() method is called to build the initial order book before the Initialize() method is called in response to the indicator being added to the chart.

    Please can you verify this.

    I am running NT v6.5.1000.10.
    Attached Files

    Comment


      #17
      My apologies. Your findings are accurate. This is a bug which will be fixed with NT7: OnMarketData/Depth then only will be called AFTER Initialize() (like any other NS method).

      Thanks for reporting that one.

      Comment


        #18
        Originally posted by NinjaTrader_Dierk View Post
        My apologies. Your findings are accurate. This is a bug which will be fixed with NT7: OnMarketData/Depth then only will be called AFTER Initialize() (like any other NS method).

        Thanks for reporting that one.
        OK, thanks.

        Could I also suggest for NT7 that the Initialize() method is only called when an indicator is actually added to a chart and starts to process data.

        Comment


          #19
          Thanks for your suggestion. We'll add it to the list of future considerations.

          Comment


            #20
            Originally posted by ScoobyStoo View Post
            ...Could I also suggest for NT7 that the Initialize() method is only called when an indicator is actually added to a chart and starts to process data.
            If it turns out to be impossible because of compatibility issues, then please add at least an additional method which is doing exactly this.

            Regards
            Ralph

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by llanqui, Yesterday, 03:51 PM
            6 responses
            26 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by tradingnasdaqprueba, Today, 03:42 AM
            8 responses
            33 views
            0 likes
            Last Post tradingnasdaqprueba  
            Started by manueldecastro, Today, 01:16 PM
            0 responses
            5 views
            0 likes
            Last Post manueldecastro  
            Started by AlgoDreamer, Today, 12:39 PM
            2 responses
            8 views
            0 likes
            Last Post AlgoDreamer  
            Started by ninza33, Today, 12:31 PM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Working...
            X