Hello!
How do I define the code to enter a trade when Parabolic SAR goes from green–>red and red–>green ?
Thanks in advance
What trigger the trend change (from green to red and vice-versa) of a Parabolic SAR is the Close breaks out its price level (the green or red dots). So to trigger an action (buy or sellshort contracts), a simple test of a cross over or cross under of the Close is sufficient.
defparam cumulateorders=false
mysar = SAR[0.02,0.02,0.2]
if close crosses over mysar then
buy at market
endif
if close crosses under mysar then
sellshort at market
endif