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
Can someone code a trailing stop indicator in the style of the parabolic SAR.
Modifying the existing code of the parabolic may be a shortcut to getting the idea working.
So, if the condition is "long", then we want the stop moved to the midpoint of the lows of the two previous bars.
the psuedo code::: val = (low(-1) - low(-2))/2 + low(-2);
and if, the condition is "short", then we want the stop moved to the midpoint of the highs of the two previous bars.
the psuedo code::: val = (high(-2) - high(-1))/2 + high(-1);
It should act like the current parabolic where the long/short dots are drawn as the stop is hit. SAR.
Happy coding