Forums ProRealTime English forum ProOrder support Optimization moving average crossing strategy Reply To: Optimization moving average crossing strategy

#122778
Jan

To avoid comparing the same MA (assuming the periods remain fixed), which is then meaningless, the very simple code is:

//Before all average definitions:

if MAType <> MATypeV2 then

//after all average definitions

Endif

 

Wrong code mentioned before, too complex:

If i = j and i <> 69 then     // increase  first MA when the second is the same as the first

i = i + 1

endif

i =  MA

j = MAv2