Please take note that the traditional Range Pivot Stop uses yesterdays High / Low to calculate the range. But since I trade intraday, I´ve found it best to use a "moving range" to calculate the current pivot range. And this also yields the best results for me.
Add it to your strategy and optimize the 2 variables. Lookback = Bars back to calculate the Pivot Range. PivotMulti=Percentage (e.g. 1=100%) of PivotRange for the exits (optimize between 0.05 to usually 2 with 0.05 steps).
Improved Net Profit for almost all of my strategies.
Code: Select all
input: LookBack(200), PivotMulti(1.0);
if marketposition<>0 then begin
PivotRange=(Highest(High, LookBack) - Lowest(Low, LookBack)) * PivotMulti;
if marketposition=1 then begin
if Close > EntryPrice + PivotRange then sell("Pivot Stop LX") next bar at market;
if marketposition=-1 then begin
if Close < EntryPrice - PivotRange then buy to cover("Pivot Stop SX") next bar at market;