[Code] (Moving) Range Pivot Stop

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
geektrader
Posts: 100
Joined: 17 Jul 2009
Location: Germany

[Code] (Moving) Range Pivot Stop

Postby geektrader » 05 Feb 2010

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;
Last edited by geektrader on 05 Mar 2010, edited 1 time in total.

geektrader
Posts: 100
Joined: 17 Jul 2009
Location: Germany

Postby geektrader » 04 Mar 2010

Did anyone find it useful yet?

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 05 Mar 2010

Thanks Geek !
I'm going to try it over the weekend.


Return to “User Contributed Studies and Indicator Library”