Finish 3 classes (AC, AD & ADX) with its parent Strategy class.
The goal is to have 2 methods per each strategy:
Update method
It refreshes given indicator data and stores the values into per instance array (for current, previous and one before previous bar). When timeframe is not specified, load the value from the instance, which was given for class constructor.
Same indicators may accept 3 dimensional array, so we potentially want to resize the array in the constructor.
For given operation type (buy/sell), it returns True when trade condition meets criteria (it's on buy or sell). Follow the comments for guidance on conditions.
By default open_method is 0, so only base condition is checked. Otherwise additional bitwise conditions are checked (using AND operation). Add more conditions when needed.
By default timeframe is loaded from class instance, unless specified.
Each bitwise condition should be single, so if the comment have multiple &&/||, separate into different logical bits (this doesn't apply to initial bool result assignment).
Note: The current code is just prototype to give some guidance, as I haven't tried to compile it, so it may have some syntax errors to fix.
Check MQL4, MQL5 and OOP docs for further details. The code should compile and work under both versions. For version compatibility, you may use external classes (probably won't be necessary).
You can test code by implementing void OnTick() on every tick whether the conditions are working. You can consider running visual backtest with some tick data. This may just work briefly.
Finish 3 classes (AC, AD & ADX) with its parent Strategy class.
The goal is to have 2 methods per each strategy:
Update
methodIt refreshes given indicator data and stores the values into per instance array (for current, previous and one before previous bar). When timeframe is not specified, load the value from the instance, which was given for class constructor. Same indicators may accept 3 dimensional array, so we potentially want to resize the array in the constructor.
Trade
method (for given operation type - cmd)For given operation type (buy/sell), it returns True when trade condition meets criteria (it's on buy or sell). Follow the comments for guidance on conditions. By default open_method is 0, so only base condition is checked. Otherwise additional bitwise conditions are checked (using AND operation). Add more conditions when needed. By default timeframe is loaded from class instance, unless specified. Each bitwise condition should be single, so if the comment have multiple
&&
/||
, separate into different logical bits (this doesn't apply to initial bool result assignment).Note: The current code is just prototype to give some guidance, as I haven't tried to compile it, so it may have some syntax errors to fix.
Check MQL4, MQL5 and OOP docs for further details. The code should compile and work under both versions. For version compatibility, you may use external classes (probably won't be necessary).
You can test code by implementing
void OnTick()
on every tick whether the conditions are working. You can consider running visual backtest with some tick data. This may just work briefly.