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

anomalous behavior of the strategy according to the market.

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

    anomalous behavior of the strategy according to the market.

    I have built a strategy that uses the prices of the level 2.
    Strategy works very well if applied FESX to the futures 06-10, while applying her/it to the futures FDAX 06-10 is not activated and the writing appears:
    "
    **NT** Enabling NinjaScript strategy 'BrunoBooks021/f60b7789c4fb48ee86e474edcff4bdb5' : On starting a real-time strategy - StrategySync=WaitUntilFlat SyncAccountPosition=False EntryHandling=UniqueEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=True/ triggering 30 before close Set order quantity by=Strategy ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=10 CancelEntryOrdersOnDisable=True CancelExitOrdersOnDisable=True MaxRestarts=4 in 5 minutes
    **NT** Error on calling 'OnMarketDepth' method for strategy 'BrunoBooks021/f60b7789c4fb48ee86e474edcff4bdb5': You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart."

    For which motive it happens this? Thanks.

    #2
    Hi onurbbruno,

    There have been some changes to how OnMarketDepth() is used in NinjaTrader 7, please review the following - http://www.ninjatrader.com/support/f...ead.php?t=3478

    And please provide the code snippet of how OnMarketDepth() is being used.
    TimNinjaTrader Customer Service

    Comment


      #3
      I have tried the code SampleMarketDepth. But it doesn't work. What I don't understand is how come the same strategy with the method OnMarketDepth works with a market (FESX) and not with the FDAX.

      Comment


        #4
        Hi onurbbruno,

        Try running the NT7 version of the sample mentioned earlier. For this test, ensure you don't have a SuperDOM running while you do this.

        As for your error...
        Please provide the code snippet of how OnMarketDepth() is being used.
        TimNinjaTrader Customer Service

        Comment


          #5
          Hi
          I send my strategy that up to yesterday it worked on FDAX and FESX and it works only today on FESX. Try her and it eventually sends suggestions.
          Attached Files

          Comment


            #6
            onurbbruno,

            I suggest bracketing all of the various segments of your OnMarketDepth() with try-catch blocks to see where it runs into the error. Then you will be able to decipher what is happening from there.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by GussJ, 03-04-2020, 03:11 PM
            11 responses
            3,227 views
            0 likes
            Last Post xiinteractive  
            Started by andrewtrades, Today, 04:57 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            7 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            440 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            11 views
            0 likes
            Last Post FAQtrader  
            Working...
            X