Hi.
Im programming a simple indicator using stochastic level cross for learning purpose.
so the first argument is:
then i want to wait to paint the signal until the high closes below MA, without stochastic having to reach OB again, what stroke my mind was using loops like this:
So the loop would run until the second condition is false, this caused mt to crash.
Schematic it looks like this
Im programming a simple indicator using stochastic level cross for learning purpose.
so the first argument is:
Inserted Code
if(iStochastic(NULL, PERIOD_CURRENT, _K_period, _D_period, Slowing, MODE_SMA, 0, MODE_MAIN, i) > 80 && iStochastic(NULL, PERIOD_CURRENT, _K_period, _D_period, Slowing, MODE_SMA, 0, MODE_MAIN, i+1) < 80 //Stochastic Oscillator crosses above fixed value
then i want to wait to paint the signal until the high closes below MA, without stochastic having to reach OB again, what stroke my mind was using loops like this:
Inserted Code
while High[i] > iMA(NULL, PERIOD_CURRENT, MAfilter, 0, MODE_EMA, PRICE_CLOSE, i+1) //Candlestick High < Moving Average ( 1+1 )
So the loop would run until the second condition is false, this caused mt to crash.
Schematic it looks like this