Forums › ProRealTime English forum › ProScreener support › MACD Stochastic code › Reply To: MACD Stochastic code
07/17/2018 at 9:44 AM
#76115
There you go, it will return either 1 for LONG signals or 2 for SHORT signals (not tested, though):
Stochastic CROSSOVER + Macd
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
StocK = Stochastic[14,3](close) StocD = Average[5](StocK) MacdVal = Macd[12,26,9](close) Up = StocK CROSSES OVER StocD Up = Up AND MacdVal > 0 Dn = StocK CROSSES UNDER StocD Dn = Dn AND MacdVal < 0 Result = 0 IF Up THEN Result = 1 ELSIF Dn THEN Result = 2 ENDIF SCREENER[Result] (Result AS "Stoch CO") |