Your code | bool StochBuy = StochMain[CheckCandle] > StochSignal[CheckCandle] && StochMain[CheckCandle] <= 19 ? true : false; bool StochSell = StochSignal[CheckCandle] > StochMain[CheckCandle] && StochSignal[CheckCandle] >= 81 ? true : false; |
Simplified. | bool StochBuy = StochMain[CheckCandle] > StochSignal[CheckCandle] && StochMain[CheckCandle] <= 19; bool StochSell = StochSignal[CheckCandle] > StochMain[CheckCandle] && StochSignal[CheckCandle] >= 81; |
Yeah, please my major concern is the SlopeStoch variable. is not giving me the right result @William Roeder
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Trying to calculate slope for stochastic, dont know what is is wrong. Getting a wrong value. Please what is wrong with the SlopeStoch variable ? Note , SlopePeriod = 1
SlopePeriod = 1
if SlopeStoch = (StochMain[0] - StochMain[SlopePeriod]) / SlopePeriod
and lets say count = 20
for ( x=0;x<count;count++){
OriginSlope = (StochMain[0] - StochMain[count]) / count
//for a bullish orign Slope
if (OriginSlope < 0){
return StochMain[count]
}
else if (OriginSlope > 0){
return StochMain[count] }
}
And please i know this is not elegant enough, but what could be wrong with the idea here, trying to get the origin point of a slope in a stochastic oscillator. With the origin point of a slope i can be able to tell if a stochastic crossing is originating from overbought/oversold extreme