Page 1 of 1

[Code] (Moving) Range Pivot Stop

Posted: 05 Feb 2010
by geektrader
I´ve just coded a Range Pivot Stop (http://ripetrade.blogspot.com/2008/10/p ... -sell.html) as an exit strategy to an existing trading system.

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);

var: PivotRange(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;
end;

if marketposition=-1 then begin
if Close < EntryPrice - PivotRange then buy to cover("Pivot Stop SX") next bar at market;
end;

end;

Posted: 04 Mar 2010
by geektrader
Did anyone find it useful yet?

Posted: 05 Mar 2010
by brodnicki steven
Thanks Geek !
I'm going to try it over the weekend.