Then again it might not be, I can't make it work however.
Would anyone know how to code a stochastic custom indicator to give a signal only when it is passing through 0 or cross above/below a certain value? (i.e. 80/20)
The above/below isn't too difficult I know but apparently I can't get it right.
The passing through 0 though (i.e. if it is above 0 and passing through) may require a bit more thought though.
I'd think that would work but it ignores the <20 and paints random marks on my chart. Ignores crosses too
Fairly sure with the passing through 0 though it would require referring to a previous bar but does one assign a range or static value? I'd have to tweak it of course but if anyone could quickly show me i'd appreciate it
Would anyone know how to code a stochastic custom indicator to give a signal only when it is passing through 0 or cross above/below a certain value? (i.e. 80/20)
The above/below isn't too difficult I know but apparently I can't get it right.
The passing through 0 though (i.e. if it is above 0 and passing through) may require a bit more thought though.
Inserted Code
sm1=iStochastic(NULL,0,StochK,StochD,StochSlowing,StochMethod,StochPrice,MODE_MAIN,i); sm2=iStochastic(NULL,0,StochK,StochD,StochSlowing,StochMethod,StochPrice,MODE_MAIN,i+1); ss1=iStochastic(NULL,0,StochK,StochD,StochSlowing,StochMethod,StochPrice,MODE_SIGNAL,i); ss2=iStochastic(NULL,0,StochK,StochD,StochSlowing,StochMethod,StochPrice,MODE_SIGNAL,i+1); if((sm1>ss1&&sm2<ss2)<20)
I'd think that would work but it ignores the <20 and paints random marks on my chart. Ignores crosses too
Fairly sure with the passing through 0 though it would require referring to a previous bar but does one assign a range or static value? I'd have to tweak it of course but if anyone could quickly show me i'd appreciate it