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

Level 2 question

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

    #16
    Yes, now it a solution. Thanks a lot

    Comment


      #17
      Second question: when I use OnMarketData and try test my code with Playback Connection - time will change on Max speed very slow? How can I fix it?
      Thanks a lot!

      Comment


        #18
        Hello sergey_z,

        Thanks for your question.

        When I test a dummy indicator on the Playback Connection that adds OnMarketData and prints MarketDataEvents.Time, Time updates in sync with the Playback Connection even when at Max Playback.

        Do you mean that there is some code within OnMarketData that is slowing down the Playback Connection? I may then recommend reducing the number of operations done in OnMarketData as it will be called very frequently, especially at increased Playback speeds.

        If this does not resolve your inquiry, could you further elaborate on how time is changing slowly and if performing less operations in OnMarketData effects the playback speed?

        I look forward to being of any further assistance.
        JimNinjaTrader Customer Service

        Comment


          #19
          OnMarketData my code is:

          if ( marketDataUpdate.MarketDataType == MarketDataType.LastClose )
          {
          Price_LastBarofSession = marketDataUpdate.Price;
          Print("Price_LastBarofSession = " + Price_LastBarofSession);
          }

          On MAX speed every real second I can simulate only +-5minutes. So time change very slow. Without this block - fast like it have to be.

          Comment


            #20
            Hello sergey_z,

            When I test without the block of code (dummy indicator) I can move through a day of Market Replay Data (ES 12-18) in approximately 20 seconds. When I test with the block of code, I do not see a noticeable difference in performance. Are you certain that this block is impacting your performance? If so, could you provide test scripts that we could test on our end to observe?

            OnMarketData will be called from an Instrument thread and the performance would be capped to what one core can handle. You may be hitting a bottleneck for how much you can push through the Playback Connection.

            My recommendation would be to test certain parts of your code disabled/enabled in an effort to see:

            1) What the best case performance would be for a dummy indicator
            2) Which sections of your strategy are impacting performance if you can achieve better performance with 1)

            If there is anything else I can do to help, please let me know.
            JimNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Stanfillirenfro, Yesterday, 09:19 AM
            7 responses
            51 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by TraderCro, 04-12-2024, 11:36 AM
            4 responses
            69 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Mindset, Yesterday, 02:04 AM
            1 response
            15 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by agclub, 04-21-2024, 08:57 PM
            4 responses
            18 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by Irukandji, Today, 04:58 AM
            0 responses
            6 views
            0 likes
            Last Post Irukandji  
            Working...
            X