Currently the signal is calculated multiple times.
For a simple two lines cross this is simply checking if the lines crossed.
This happens multiple times.
before the state machine is processed Update() is already called on all of the indicators.
For further checking within the state machine it could simply read an already cached value
m_signal_direction
m_signal_side
m_exit_direction
It might be enough to change the methods on AggSignal where the indicator states are read.
The following could read a cached value insead of calling for examle m_confirm.LongSignal() again.
Currently the signal is calculated multiple times. For a simple two lines cross this is simply checking if the lines crossed. This happens multiple times.
before the state machine is processed Update() is already called on all of the indicators. For further checking within the state machine it could simply read an already cached value
It might be enough to change the methods on AggSignal where the indicator states are read. The following could read a cached value insead of calling for examle m_confirm.LongSignal() again.
https://github.com/stfl/backtestd-expert/blob/ab0f635f16a0cbd602cbf59372795614d76389ed/Include/backtestd/SignalClass/AggSignal.mqh#L105-L125