[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ELA Question on Trailing Stops



PureBytes Links

Trading Reference Links

Hi,
 
I'm wondering if someone could give me some suggestions here.  I'm
trying to work out how to program a particular type of trailing stop.
Typically many use the Donchian X day trailing stop.  I am trying a
variation. I have attached a graph showing what I am trying to achieve.
 
Basically I want to find the current price extreme, say a high, then
trail a stop below that high X bars back from the low of the high bar,
calculated via the low I.e. I move back from the low of the high bar
until I hit X new price lows and that becomes the stop point.  This may
involve going back many bars before being able to find those X news
lows, or highs in the case of a low pivot. The example shown works on
X=2.  What this will means is that when a small choppy consolidation
forms it wont necessarily stop you out as would a Donchian stop. 
 
I know I probably need to use the SwingHigh/Swinglow functions, but
because of the complexity of not knowing how many bars may be involved
it gets complicated.  I was hoping someone here could provide some
suggestions on how to tackle this.  It would much appreciated.
 
Thanks,
Adrian Pitt

Attachment: Description: "Junk1.gif"