Hello All,
I currently have a bunch of EAs that operate based on a range of trading strategies (i.e. breakouts, ranging, trend, counter-trend etc) with a range of currencies and I'm trying to work out a way to code a money management function to manage risk between all of these EAs. I'd like to work out an algorithm (I'm happy to code it and share it) for how best to manage risk in this scenario, and I'd like to call on the good people of forex factory to offer their suggestions as to the best way to do this. I know that someone smarter than I has done this before...
As an example, if I have 20% of my account at risk due to 10 breakout trades (different strategies and currencies with a 2% account balance risk on each trade) there may be a substantial risk if the market starts ranging. Hence, in this case I want to reduce the maximum risk exposure due to the breakout EAs (or preferably not get into this situation by using risk management to use smaller lot sizes).
However, if a counter trend EA wants to trade when I'm already heavily invested with breakout orders, I don't want to limit the counter trend EA's lot sizes.
I'd also like to consider spreading the risk across different currencies (i.e. do not have too many order lots on any one currency).
Additionally, it would be nice to make the system try to balance the "EA investment portfolio" to try to maintain a definable level of risk in the market during normal trading times. As an example, trying to maintain 20% of account equity invested during the trading week. This could be tricky as each EA has its own entry/exit criteria and trading frequency, but some kind of approximation method could work quite well.
When I'm finished on this project I'd like to have a library function that is called from any EA and that returns the trade lot size. This library function will store all the risk and money management criteria that will be applied to all EAs. I imagine that I may have to pass some info to this function, such as the type of EA strategy (trending, ranging etc) and the currency that is to be traded.
Has anyone attempted to write something like this before? If so, I'd very much appreciate your feedback and suggestions.
Thanks,
Michael
I currently have a bunch of EAs that operate based on a range of trading strategies (i.e. breakouts, ranging, trend, counter-trend etc) with a range of currencies and I'm trying to work out a way to code a money management function to manage risk between all of these EAs. I'd like to work out an algorithm (I'm happy to code it and share it) for how best to manage risk in this scenario, and I'd like to call on the good people of forex factory to offer their suggestions as to the best way to do this. I know that someone smarter than I has done this before...
As an example, if I have 20% of my account at risk due to 10 breakout trades (different strategies and currencies with a 2% account balance risk on each trade) there may be a substantial risk if the market starts ranging. Hence, in this case I want to reduce the maximum risk exposure due to the breakout EAs (or preferably not get into this situation by using risk management to use smaller lot sizes).
However, if a counter trend EA wants to trade when I'm already heavily invested with breakout orders, I don't want to limit the counter trend EA's lot sizes.
I'd also like to consider spreading the risk across different currencies (i.e. do not have too many order lots on any one currency).
Additionally, it would be nice to make the system try to balance the "EA investment portfolio" to try to maintain a definable level of risk in the market during normal trading times. As an example, trying to maintain 20% of account equity invested during the trading week. This could be tricky as each EA has its own entry/exit criteria and trading frequency, but some kind of approximation method could work quite well.
When I'm finished on this project I'd like to have a library function that is called from any EA and that returns the trade lot size. This library function will store all the risk and money management criteria that will be applied to all EAs. I imagine that I may have to pass some info to this function, such as the type of EA strategy (trending, ranging etc) and the currency that is to be traded.
Has anyone attempted to write something like this before? If so, I'd very much appreciate your feedback and suggestions.
Thanks,
Michael