EA not updating appropriately

 

Hi,

I encounter an issue with the EA attached: when first installed, it displays the correct value, and then after few bars, the value calculated diverges from what it should be. Changing the time frame and coming back to the same time frame again, the value is then correct again. Any idea what the issue could be?

Thanks for your help.

OF

 
OlivierF:

Hi,

I encounter an issue with the EA attached:

You have not attached anything

 
OlivierF:

Hi,

I encounter an issue with the EA attached: when first installed, it displays the correct value, and then after few bars, the value calculated diverges from what it should be. Changing the time frame and coming back to the same time frame again, the value is then correct again. Any idea what the issue could be?

Thanks for your help.

OF

it means it repaints. and probably not an EA but an indicator

 
Jean Francois Le Bas:

it means it repaints. and probably not an EA but an indicator

Correct, it's an indicator. My apologies.

I don't think it repaints: it's not that the previous figure changing.

The issue seems more to be how the market data / inputs are loaded while the indicator is active: at start it works, after a while the current output of the indicator is changed if if modify the time frame and come back or restart the MT4. i think these 2 processes reload the market data and inputs needed to calculate the indicator output.

 
Keith Watford:

You have not attached anything

Sorry, first time and struggled to find how to attach..
Files:
 
  1. CyclePeriod indicator - described by John F. Ehlers
  2. The entire indicator's code is inside a if(prev_calculated==0…. Therefor, it will only show the initial results. It's broken.
  3. It uses internal arrays, not buffers, so when bar count changes everything must be recalculated. Someone tried to convert MT4 to MT5 without understanding.
  4. If you change the return(rates_total); to return(0); maybe that version will work, at the cost of computing all bars each tick.
  5. Look for a fixed/correct version.
 
William Roeder:
  1. CyclePeriod indicator - described by John F. Ehlers
  2. The entire indicator's code is inside a if(prev_calculated==0…. Therefor, it will only show the initial results. It's broken.
  3. It uses internal arrays, not buffers, so when bar count changes everything must be recalculated. Someone tried to convert MT4 to MT5 without understanding.
  4. If you change the return(rates_total); to return(0); maybe that version will work, at the cost of computing all bars each tick.
  5. Look for a fixed/correct version.

Understood, will look for it.

Thank you William.

Reason: