Its mostly a theoretical question (but example code is always welcome).
The real question is: how to correctly code the 'frame' of an EA that tests multiple scenarios from multiple custom indicators?
The way I'm (busy) building an EA, is not very much focused on 1 strategy, but is gonna try to 'test' multiple strategies and 'picks' the most appropriate one.
So I have created a few custom indicators, that are all returning an array of 'status data'..
For example I have the following indicators:
I could write one HUGE scenario, but I think it can be done much better..Because if lets say, all timeframes are going down (down trend) You could have a special scenario to handle lots of down movement.. But if there is no current trend, a different scenario would fit best.
So I feel like its best to make multiple scenarios(still in 1 EA).. First all custom indicator data is collected and then each scenario uses that data to calculate can then returns a 'score' and the best one is picked.
But how can I layout the code in the best 'overview' way?
Should I create a Class for each scenario and give them a manual 'tick' with data? And just split them into multiple files and #include them?
And what about event-driven development? Created classes that listen to certain indicator events and go there own way (that would be awesome)
Any thoughts are much welcome!
I think have what you are looking for. This "host" supports
- multiple strategies parallel, same account, same symbol without influencing eachother
- multiple pools of orders that do not affect eachother
- it provides a "slot-stack" where different indicators can be loaded and traded parallel ... without influencing eachother
What it does not at the moment, is weighting signals. But everything is possible in the end. To code an indicator for this host, you need the include its API. In fact, you need to add 5 lines of code to turn such an indicator into a signal provider for the host.
If you are interested, drop me a PN. This product is gonna be released in 2016 and is live since 2 months on >10 accounts.