Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Mixing 450 and 900 Tick Charts In Same Strategy

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

    Mixing 450 and 900 Tick Charts In Same Strategy

    I am trying to create a strategy that runs off of a 450 tick chart and a 900 tick chart.

    The default period and type is 450 tick. I use Add to add the 900 tick chart.

    The code compiles fine.

    However, when I go to live test it, the code won't enable when I check the enable box in the strategy tab.

    The code runs fine if I don't include the Add and I remove any reference to the 900 tick chart....I.e, I remove any BarsArray[1] references.

    Anyone have any thoughts?

    Jeff

    #2
    Hello,

    Thank you for the question.

    This could be caused if you are not checking if there is enough data loaded before trying the secondary requests.

    If you run the script that currently has a problem with the output window open it should provide better information on what is happening. You can open it by going to Tools -> Output window.
    Next run the NinjaScript item and an error should show up in the output window related to a index error most likely.

    What happens in most cases is that on bar 0 if BarsArray[1] is checked it may not yet exist, you can prevent this by adding a statement like the following to the top of OnBarUpdate:

    if(CurrentBars[0] < 1 || CurrentBars[1] < 1) return;

    Please try this and also the output window and let me know if this is not the problem.

    I look forward to being of further assistance.

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello,

      Thank you for the question.

      This could be caused if you are not checking if there is enough data loaded before trying the secondary requests.

      If you run the script that currently has a problem with the output window open it should provide better information on what is happening. You can open it by going to Tools -> Output window.
      Next run the NinjaScript item and an error should show up in the output window related to a index error most likely.

      What happens in most cases is that on bar 0 if BarsArray[1] is checked it may not yet exist, you can prevent this by adding a statement like the following to the top of OnBarUpdate:

      if(CurrentBars[0] < 1 || CurrentBars[1] < 1) return;

      Please try this and also the output window and let me know if this is not the problem.

      I look forward to being of further assistance.
      Hi. This didn't work. However, I notice that NT says that still have an active order when I try to disconnect Kinetick. But, I don't see anywhere in NT where I have an active order.

      Could this be the reason why I can't enable the strategy?

      Also, how do I get rid of the "active order"? (It's a sim order - not a live order).

      Jeff

      Comment


        #4
        Took care of stuck order, but I still can't get the strategy to enable.

        Comment


          #5
          Here's the error message from the Output Window:

          Error on calling 'OnBarUpdate' method for strategy 'ESDayTrading2/93da8bd69a1149dd9112635ad5881ff2': You must use the overload that has a 'BarsInProgress' parameter when calling the BarsSinceEntry() method in the context of a multi-time frame and instrument strategy.

          Comment


            #6
            Figured it out. Need to coordinate/check BarsInProgress with the call to BarsSinceEntry.

            Thanks!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            640 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            366 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            107 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            569 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            572 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X