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 CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      36 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      130 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      185 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      95 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      139 views
      0 likes
      Last Post cmoran13  
      Working...
      X