Donchian band with ATR stop
Author: Dramsey7
Creation Date: 9/12/2012 3:55 AM
profile picture

Dramsey7

#1
I have one last favour to ask pls Eugene. I want to test a variation where I use a 3 times ATR initial stop and 2% capital. I take breakouts of the 20 day donchian but only if the 70 day simple moving average is rising or falling at the same time. The stop is the initial stop or the lower/upper donchian. I'm sorry to ask again but this one seems harder to me and I have literally no idea where to start!

Thanks again
profile picture

Eugene

#2
No duplicate topics please! Keep the forums clean. Find the original conversation using Search, and ask there. tia.
profile picture

Eugene

#3
Dramsey7 wrote:
QUOTE:
OK,i appreciate your help.it seems i wasnt very clear so i´ll start again. first of all i meant new strategy rather that a variation of the Dual donchian bands.

Buy signal: break of 20 day high donchian whilst 70 day SMA is rising.
initial stop loss: entry price - 3* ATR. Once the trade is in profit the lower 20 day donchian band is the stop.

Sell signal is the reverse of the above.

position size : a % of initial equity (2% is an example)

i would like to be able to optimise the strategy as well to see if other donchian bands and MA lengths work better

i apologise for my lack of clarity in the earlier post.

best regards
profile picture

Eugene

#4
QUOTE:
Once the trade is in profit the lower 20 day donchian band is the stop.

And once the trade is in loss again, temporarily? Leave the new stop in position, or switch back? That's up to you to decide.
QUOTE:
i would like to be able to optimise the strategy as well to see if other donchian bands and MA lengths work better

I will deliberately skip this, allowing you to learn that by doing. Start right here: WealthScript Programming Guide > Programming Trading Strategies > Strategy Parameters. Quick example: previous Donchian strategy contained Strategy Parameters.

Here goes:
CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).