Howdy, i'm trying to get my indicator to operate based on a different stochastic timeframe rather than 0 but it never seems to return the value I require at the time which is annoying.
It will return a 0 timeframe stochastic value correctly but anytime I try to say "Check if M30 is doing this" it never matches up with the actual value when I double check it by switching to the 30 at the same time frame.
Tried numerical and expression values for the timeframe but it NEVER gives me the right thing. Anyone know why?
simplified
i'm on a 15m time frame, want to get results for a stochastic on my chart timeframe of 15m and for the 30m as well. Can't get the stochastic to return the right value for 30m. Am I misinterpreting something? For reference sake the code compiles and returns correct values for the 0 timeframe. It's just when I require the current timeframe and a higher one it does not give the correct value. Even if I just tell the indicator to paint an arrow ONLY when the m30 stochastic is heading down it gives me really random readings. I use an MTF stochastic indicator to give me a visual aid without having to switch to a diff timeframe but I check my indicator manually.
It will return a 0 timeframe stochastic value correctly but anytime I try to say "Check if M30 is doing this" it never matches up with the actual value when I double check it by switching to the 30 at the same time frame.
Tried numerical and expression values for the timeframe but it NEVER gives me the right thing. Anyone know why?
simplified
i'm on a 15m time frame, want to get results for a stochastic on my chart timeframe of 15m and for the 30m as well. Can't get the stochastic to return the right value for 30m. Am I misinterpreting something? For reference sake the code compiles and returns correct values for the 0 timeframe. It's just when I require the current timeframe and a higher one it does not give the correct value. Even if I just tell the indicator to paint an arrow ONLY when the m30 stochastic is heading down it gives me really random readings. I use an MTF stochastic indicator to give me a visual aid without having to switch to a diff timeframe but I check my indicator manually.
Inserted Code
sm1c=iStochastic(NULL,30,5,3,3,StochMethod,StochPrice,MODE_MAIN,i); sm2c=iStochastic(NULL,30,5,3,3,StochMethod,StochPrice,MODE_MAIN,i+1); ss1c=iStochastic(NULL,30,5,3,3,StochMethod,StochPrice,MODE_SIGNAL,i); ss2c=iStochastic(NULL,30,5,3,3,StochMethod,StochPrice,MODE_SIGNAL,i+1);