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 argusthome, 03-08-2026, 10:06 AM
      0 responses
      80 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      46 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      29 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      32 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      66 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X