Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with strategy wizard

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

    Problem with strategy wizard

    Hello,

    why this simply strategy doesn't work?

    if (Close[0] > Close[20]
    && Close[0] > Close[60])
    {
    DrawDot("My dot" + CurrentBar, false, 0, High[0] + 15 * TickSize, Color.Green);
    }

    But if I change the parameters it works perfectly.

    if (Close[0] > Close[5]
    && Close[0] > Close[10])
    {
    DrawDot("My dot" + CurrentBar, false, 0, High[0] + 15 * TickSize, Color.Green);
    }

    I can't fins the logical reason why it is so. I am 100% sure that there are bars which have this conditions and dot shuld be draw.

    #2
    Hello,

    Thanks for your forum post.

    More then likely you do not have enough bars back in the chart to make the condition run. Please check the log tab in the control center when you run this strategy or indicator. Do you see a log error?

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      I am backtesting on daily data. I have uploaded data since 2000 1 st january, so for it must be something different.

      Where I can se a log error in control center?

      Daniel

      Comment


        #4
        Hello,

        Please check in the control center->log tab. Do you see any errors listed here?
        BrettNinjaTrader Product Management

        Comment


          #5
          Hello,

          I checked. There is error but unfortunetly in Polisch language. I will try to translate:

          "Error on calling 'OnBardUpdate' method for strategy 'WyznaczanieTrendu': Index is outside the range. It must be not minus and lower than size of collection.

          Name of parameter:Index"

          I hope you understand my translation.

          Daniel

          Comment


            #6
            Hello,

            Yea this corresponds with what I think is occuring.

            Since your sample size is so large you will need to add a custom check for this by opening the code and unlocking the code in the strategy wizard and adding the following code:



            you will need to check to make sure you have 60 or more bars in the chart before you start calculating the indicator value.



            I look forward to assisting you further.
            BrettNinjaTrader Product Management

            Comment


              #7
              Thanks, it helps.

              Daniel

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              88 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              48 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              31 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              34 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              69 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X