AbzParticipant
Veteran
Hello ,
trying to identify when ADX and SAR is switched to bull og bear at the same time see attached screen. Anyone have an idea
myPRCAdaptiveATRADXTrendV2 = CALL "PRC_Adaptive-ATR-ADX-Trend-V2"[21, 3.5, 1.75, 14, 30, 0, 1](close)
p=SAR[0.02,0.02,0.2]
IF not onmarket and myPRCAdaptiveATRADXTrendV2 > close and myPRCAdaptiveATRADXTrendV2[1] < close[1] and P > close and p[1] < close[1] THEN
buy 10 contract AT MARKET
ENDIF
IF not onmarket and myPRCAdaptiveATRADXTrendV2 < close and myPRCAdaptiveATRADXTrendV2[1] > close[1] and p < close and p[1] > close[1] THEN
sellshort 10 contract AT MARKET
ENDIF
Your code seems OK (although I have not tested it) except for the fact that the IF NOT ONMARKET will mean that a reverse signal will not close a trade and open one in the opposite direction. Perhaps this is what you want and there is some more code that you have not shared with us?
Also how often does close cross over the two indicators at exactly the same bar?
You should try using GRAPH to check the values of the two indicators compared to close