hi guys, im completely new to wealth lab and would like some help creating a simple strategy. i would like to create a dual donchian band strategy where the longer band is used only for trend direction and the shorter one is used to trade. For example, wait for the market to break the 120 day high i.e trend turns up, and thereafter only take buys when the market breaks the 20 day high. The stop would be the 20 day low and for shorts the rules would be reversed. Obviously i´d also like to be able to try and optimise it. Can anyone help?
thanks in advance
David
Size:
Color:
Welcome to the forums David.
Your strategy has been uploaded. Check this out:
Dual Donchian BandsI recommend downloading it
directly using the convenient
"Strategy Download" feature (found in Wealth-Lab's
"Open Strategy" dialog).
Size:
Color:
thanks so much Eugene. thats exactly what i was looking for. just one thing though. i was trying to look at the strategy using a 2% stop of total equity and i get an error saying "strategy code must set risk stop level in order to use market risk position size." is it possible that the initial trade size is related to where the shorter donchian band is at the time? Sorry to be a pest...
best regards
David
Size:
Color:
No David, it's a different thing. You didn't specify this condition, and it requires extra code. Look up
RiskStopLevel in the QuickRef and also check out the User Guide on position sizing.
CODE:
Please log in to see this code.
I've uploaded a revised version of the Strategy that includes this tweak. Just repeat the known steps to get the updated Strategy.
Size:
Color:
Understood. Thanks so much for your help
Size:
Color:
eugene, can i ask one more favour please. i want to look at a variation of the other strategy where i buy on a break of the 20 day donchian but only if the 70 day SMA is rising at the same time. The stop is an initial stop of 3 times the ATR using 2% of the available capital and then the opposite 20 day donchian band. This one seems complex to me and i have no idea where to start. can you help?
thank you
Size:
Color:
Define the SMA:
CODE:
Please log in to see this code.
Then add a condition like this on top of the BuyAtStop (reverse for ShortAtStop). This is just for example, since you haven't specified what a rising SMA is:
CODE:
Please log in to see this code.
QUOTE:
The stop is an initial stop of 3 times the ATR using 2% of the available capital
Again, it's not clear what the ATR initial stop is:
1. a volatility money management, and therefore you can follow this FAQ:
How do I implement volatility position sizing?,
2. or is the last close price minus 3 ATRs? In this case, just modify the RiskStopLevel as shown below:
CODE:
Please log in to see this code.
Reverse for shorts.
Size:
Color:
QUOTE:
and then the opposite 20 day donchian band.
When exactly "then"? Next time please be precise when describing your rules.
Switching from the initial ATR-based stop to the channel stop may be tricky for you. So here's the complete Strategy code, as I understood it:
CODE:
Please log in to see this code.
Here, when the bar's low exceeds the entry price (vice versa for shorts) the Strategy switches from the initial stop to the channel-based. I commented out the channels so you could notice the transition easily.
Size:
Color:
thank you
Size:
Color:
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
Size:
Color:
QUOTE:
first of all i meant new strategy rather that a variation of the Dual donchian bands.
Oh man. On 9/12/2012 3:55 AM, didn't you ask for
a variation, in the topic named
Donchian? Nevermind, I replied there with new Strategy code.
Size:
Color: