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.

    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?

        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.

            Comment


              #7
              Thanks, it helps.

              Daniel

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by bmarovets, Today, 06:33 PM
              0 responses
              6 views
              0 likes
              Last Post bmarovets  
              Started by ETFVoyageur, Yesterday, 07:05 PM
              4 responses
              34 views
              0 likes
              Last Post ETFVoyageur  
              Started by JGriff5646, Yesterday, 10:02 PM
              2 responses
              22 views
              0 likes
              Last Post JGriff5646  
              Started by DawnTreader, Today, 05:58 PM
              0 responses
              5 views
              0 likes
              Last Post DawnTreader  
              Started by ntram, Today, 05:39 PM
              0 responses
              5 views
              0 likes
              Last Post ntram
              by ntram
               
              Working...
              X