Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on calling 'OnBarUpdate' method

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

    Error on calling 'OnBarUpdate' method

    I have developed an indicator that uses the following statement

    if( (MAX(High, 65)[0] - MIN(Low, 65)[0]) > 10)
    {
    WRFv =
    1;
    }
    else
    {
    WRFv =
    0;
    }

    WRF.Set(WRFv);

    It basically plots a 1 if the stock has moved in a range of 10 within the last 65 days or a 0 if false.

    I see this working correctly when I add the indicator on the chart. However I was getting some error messages about the OnBarUpdate so I added the following code at the beginning

    if (CurrentBar < 65)
    {
    return;
    }

    However whit this change the indicator does not work in the market analyzer. Instead of the 0/1 values I get the Close price in my indicator colum and the log shows the following error: Error on calling 'OnBarUpdate' method

    If I take the if (CurrentBar < 65) statement away I can see the correct values in the Market Analyzer but the indicator does not plot in the chart

    What am I doing wrong?

    Thanks

    #2
    Hello agosinv,

    Thank you for your post.

    Please right click in your Market Analyzer > select Properties > change the '# of bars to look back' to a larger value than 65 > OK.

    Please let me know if this resolves the matter.

    Comment


      #3
      YES. This is interesting. I had 65 and it did not work. Then I changed it to 100 and it worked.

      I was going to try with 66 just for curiosity but analyzer is still going through all SP500 stocks and it will take a while

      Thanks

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Max238, Today, 01:28 AM
      1 response
      22 views
      0 likes
      Last Post CactusMan  
      Started by giulyko00, Yesterday, 12:03 PM
      2 responses
      10 views
      0 likes
      Last Post giulyko00  
      Started by r68cervera, Today, 05:29 AM
      0 responses
      4 views
      0 likes
      Last Post r68cervera  
      Started by geddyisodin, Today, 05:20 AM
      0 responses
      6 views
      0 likes
      Last Post geddyisodin  
      Started by JonesJoker, 04-22-2024, 12:23 PM
      6 responses
      38 views
      0 likes
      Last Post JonesJoker  
      Working...
      X