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 ETFVoyageur, Today, 07:05 PM
              0 responses
              4 views
              0 likes
              Last Post ETFVoyageur  
              Started by Orion815, 05-02-2024, 08:39 AM
              2 responses
              15 views
              0 likes
              Last Post Orion815  
              Started by suroot, 02-25-2017, 04:43 AM
              11 responses
              2,549 views
              0 likes
              Last Post Zilvercat  
              Started by Rogers101, 05-05-2024, 11:30 AM
              16 responses
              50 views
              0 likes
              Last Post Rogers101  
              Started by ninza33, Today, 12:31 PM
              2 responses
              11 views
              0 likes
              Last Post ninza33
              by ninza33
               
              Working...
              X