DislikedThat is brilliant. As I so often say, coding is a doddle but program design can be a nightmare. Once I have a specification, I can do the coding easily. Your idea sounds like fun.
Hi Steve and all,
This is way cool. I would love to learn some EA coding but I simply don't have the time or headspace to take it on for now... I'm quite blown away that people are keen to code my specs.
So here is how I propose handling the 'perfect storm', and why building a system around potential losses is maybe a better approach than focusing on potential gains.
Looking at the trade candles, ie. the one directly following the signal candle, I notice that most have relatively short wicks, so we may be able to employ stops to good effect. If we could also set a maximum number of trades in any one candle we would be able to quantify our largest possible one candle loss, thus allowing very aggressive lot sizing.
I feel so confident that the 'perfect storm' is a once in a blue moon event that I decide I could cheerfully manage a 20% hit to my account. I set max trades to 5 and stoploss to 40 - enough to accommodate most normal trades, so my worst case one candle loss is 200 pips. On a $100 account a 20% loss would be 2000 penny pips, so in this example I would be trading 10c pips. On a $100 account. That is my idea of 'very aggressive' lot sizing.
I've written this in terms that are logical to me as an EA user - these are the input options that I would see. I hope this makes sense to you as a coder. I've included everything I've thought of but not every option is required, I'll expand below.
enter at end of signal candle or enter at signal
enter on classical divergence = true/false
enter on reverse divergence = true/false
Max Trades =
Stop Loss =
Hidden Stop = true/false
Take Profit =
Lot Size as % of account size =
Lot adjustment factor =
An initial EA for testing purposes would require basic functionality options only, Trigger on any divergence at end of candle, Max Trades and Stop Loss. This would fit what I'm looking at on visual backtests.
Optional improvements include:-
It might be interesting to test the trigger inputs I've offered, how would entry at first signal compare to entry at end of candle? At a glance classical divergence looks to do a bit better than reverse divergence, but the key thing is looking for losses...
Max Trade and Stop Loss are essential. Do we need to hide the stoploss? - might be nice to have the option. Take profit - I can't actually see any use for this, end of trade candle looks pretty good. However, I think it would be fairly simple to throw in there and if people start to use this EA then who knows what someone might come up with. Initially the key thing is to have no take profit.
OK this is largely unnecessary at the testing phase of this project. If the EA has legs and can be unleashed into the wild as a set and forget auto-trader then automated lot sizing would be really usefull. Lot Size as % of account size = is fairly self explanatory I think. As for Lot adjustment factor = , I would use this only to keep pip value consistent accross differenet pairs, although others might use it to overweight or underweight particular pairs.
As an ending note, it would be really usefull if Max Trades could output to a log so that we could get a feel for how many trades were triggered per candle. Oh, we probably need to allow for ECN brokers also.
Alright over to you Steve. You post that you are busy right now so no pressure, if you don't get back within a week or two I'll chase you up.