I'm writing an EA that's based on several indicators, now am I best writing it like this
if(IndicatorA>=x && indicatorB=y && indicatorC<=z)
Or the other way I though was
Obviously having different combinations of indicators and settings for buy, sell and close/modify orders. I've got a working version based on the first idea, which either trades far too often or not at all, but I'm thinking the second idea would allow me more control over when I trade and with what Lot size to choose. Has anyone designed a working EA that uses multiple indicators and if so what way is best? Or are there more efficient methods?
Evaluate subsequent indicators only if the one before is satisfied. That way you avoid unnecessary computations and EAs that gobbles CPU.
Use functions which only get evaluated if they get to that point, rather than variables which are precomputed whether they are required or not.
For the buy signals, try something like this the following. Use parameters which you can vary during testing to find the optimum. You may find that some indicators carry more weight. And depending on what the total weighting is, you may want to vary the lots. Again the thresholds are parameters you can test to find the optimum.
If(BuySignal>ThresholdBig) ... // buy big lots
else If(BuySignal>ThresholdMedium) ...//buy medium lots
else If(BuySignal>ThresholdSmall) ...//buy small lots