Very Simple Question. Or Metatrader BUG. Some with little knowledge here please!.

 

WindowsPriceMax(), is not updated with the correct information provided when the user click's the M1,M5,M15,30 or any Period Toolbox button.

to get the correct information is need to wait until next tick.

but, all other data like Period(), returns correct.

This is MetaTraderBug?

i have writen an exaple showing this behavior here,

'WindowsPriceMax problem'

Thanks for ur help.

Arturo.

 

"to get the correct information is need to wait until next tick"

you observe correctly - next data tick kicks code into action.

example:

I have indicator which draws horizontal lines using objects. Part of the 'pre-drawing loop' setup has:

dYmax = NormalizeDouble(WindowPriceMax(),Digits);
dYmin = NormalizeDouble(WindowPriceMin(),Digits);

until next incoming data tick the lines/objects remain

ie, the code does not run to remove old period's lines/objects and recalculate for the new periodocity.

Above is what I observe in my chart if change periods.

hth

 
fbj wrote >>

"to get the correct information is need to wait until next tick"

you observe correctly - next data tick kicks code into action.

example:

I have indicator which draws horizontal lines using objects. Part of the 'pre-drawing loop' setup has:

dYmax = NormalizeDouble(WindowPriceMax(),Digits);
dYmin = NormalizeDouble(WindowPriceMin(),Digits);

until next incoming data tick the lines/objects remain

ie, the code does not run to remove old period's lines/objects and recalculate for the new periodocity.

Above is what I observe in my chart if change periods.

hth

thanks for your answer, but i need to clarify this.....

the script start() RUN'S just after you press the M1 toolbox button or any other.

see the example here and the explanation "WindowsPriceMax Problem"

you see the same objects in the same position becouse the scrip() gets the wrong WindowsPriceMax value.
you can prove that. seein the expert deinitialization and initializacion of the indicator.
AND MORE BIG PROOF "ALL INDICATORS MAKES THE COMPLETE REFRESH ONCE YOU PRESS M1,M5,M15.. OR SO BUTTONS."
this clearly shows that each INDICATOR run's once the button pressed.
all indicators no need to wait until next tick to refresh.
BUT, the WindowsPriceMax needs to do that. "" this is a bug of metatrader?" the behavior is not desiderable.
Thanks again fbj