I'm wondering and trying to code a strategy that uses the ParabolicSAR as a stop loss signal. I am having a difficult time in the strategy builder to capture the price value of the first bar in the ParabolicSAR indicator, and using it as my stop loss.
Take the case that I am shorting a security that is under the bearish ParabolicSAR indicator, and I want to set a 1:1 risk for stop loss / profit target.
I am trying to capture the price level of the first bar of the ParabolicSAR that came directly before my entry. If the close of the current bar ever passes that price, it closes the position, else it closes the position at the profit target of 1:1 from that stop loss level and entry level.
Currently when backtesting, I am only able to get one level for that price, and it is the last instance of the ParabolicSAR on the chart (EOD).
See attached screenshot.
CASE 1: reaches the stop loss level and closes the position.
CASE 2: reaches the 1:1 risk level from stop level and closes the position for a profit.
Any help would be much appreciated.
Comment