I'm not a programmer therefore I was stucked in develop a new indicator
I would like to develop the indicator with accumulate the value if some criteria is fullfiled:
Example:
// condition 1
if (SMA(Close, fastMA)[0] > SMA(Close, slowMA)[0]
{Ratio.Set(macs + 1);};
// condition 2
if (SMA(Close, fastMA*2)[0] > SMA(Close, slowMA*2)[0])
{Ratio.Set(macs + 1);};
In the above condition 1 & 2, my ideal result of "macs" should be "2" if condition 1 & 2 fulfilled at the same period. However, the result was "1".
I understood I was missing some code in order to accumulate the value of "macs". Can anyone help? Thanks a lot!
Comment