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

Strategy Analyzer - Not running?

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

    Strategy Analyzer - Not running?

    When I loaded my instrument/strategy and time frame etc...and click on the run button in strategy analyzer nothing happens. How can i and to see trace of what's happening?

    #2
    Hello priceisking,
    Thanks for your post.

    So I may be of better assistance, can you please tell me the following?
    • Do you see results when running the same test on the SampleMaCrossOver strategy in NinjaTrader with the same settings as your strategy?
    • Who are you connected to? This is displayed in green on lower left corner of the Control Center window.
    • Are you connected to your data feed provider when running this test?
    • What instrument(s) (and expiry if applicable) have you selected?
    • What Data Series Type have you selected? Example: Tick, Minute, Day
    • What From and To date is selected?
    • Is your strategy a multi instrument or multi time frame strategy?
    • Do you receive an error on screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh,

      Yes. I do see test results when running SampleMaCrossOver strategy with the same settings.
      Connected to Interactive Brokers. It shows green an another strategy is currently running in sim101 .
      I'm not connected to any other feed provider. Doing this test on ES 12-18 . This is run on on tick and 5 minute chart. I've tried putting in 09/01 to 09/18 .. i've changed it to 01/01/18 to 09/19/2018 and still no difference. Single instrument only on single time frame. No errors in the log in control center and no errors on screen.

      Let me know if this helps.

      Comment


        #4
        Sounds like your strategies logic is not processing the way you expect it to. You will need to do some debugging to find out why that is happening. Please see the following link for more information.



        Let me know if you have any questions
        Josh G.NinjaTrader Customer Service

        Comment


          #5
          Thanks. Will try debugging it and see what is happening.

          Comment


            #6
            Looks like an issue with my code indeed. I see this in the log now:

            Error on calling onbarupdate method on bar 1 - index was outside the bounds of the array.

            This is how it starts:

            protected override void OnBarUpdate()
            {
            Print("Entered OnBarUpdate: " + Close[0] + " Open: " + Open[0] );


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

            Print("CurrentBars:" + CurrentBars[0] + "BarsRequiredToTrade " + BarsRequiredToTrade + " CurrentBars: " + CurrentBars[1]);



            if (BarsInProgress == 0)
            {

            if (CurrentBar == 0 || Bars.IsFirstBarOfSession)
            sessionIterator.GetNextSession(Time[0], true);


            // if after the exit on close time, prevent new orders until the new session
            if (Times[1][0] >= sessionIterator.ActualSessionEnd.AddSeconds(-ExitOnSessionCloseSeconds) && Times[1][0] <= sessionIterator.ActualSessionEnd)
            exitOnCloseWait = true;

            // reset for a new entry on the first bar of a new session
            else if (exitOnCloseWait && Bars.IsFirstBarOfSession)
            exitOnCloseWait = false;

            Comment


              #7
              I cannot tell where the error is coming from with this snippet. It looks like you are trying to access an index that doesn't exist yet. You noted previously that you were working with a single time frame and instrument but you are trying to access multiple time frames in your snippet. Is that your intent?

              Help Guide - CurrentBars

              Have you added a data series so that you can check CurrentBars[1] ?
              Josh G.NinjaTrader Customer Service

              Comment


                #8
                that was it.. .i fixed the multiple timeframe issue and that resolved it. thank you so much.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by RookieTrader, Today, 09:37 AM
                3 responses
                15 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by kulwinder73, Today, 10:31 AM
                0 responses
                5 views
                0 likes
                Last Post kulwinder73  
                Started by terofs, Yesterday, 04:18 PM
                1 response
                23 views
                0 likes
                Last Post terofs
                by terofs
                 
                Started by CommonWhale, Today, 09:55 AM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_Erick  
                Started by Gerik, Today, 09:40 AM
                2 responses
                7 views
                0 likes
                Last Post Gerik
                by Gerik
                 
                Working...
                X