Confirm divergence on two timeframes before placing a trade
-
Hi guys, I'm creating a multi-strategy EA which is divergence and also a combination of some moving averages. And this is how I want it to be:
For buy trades:- If there is a bullish divergence on the 30m and 15m timeframe. if not, check if the 50SMA is below the candles. If yes, the 9SMA should cross above the 18SMA.
So for buy trades, one of these conditions(or) strategies should be executed. and vice versa for sell trades.
I want you guys to take a look at the project if I'm on the right path or there's something I need to change, because the check position count is not working. Trades are placed just once.
-
@ralph1 You are on the right track, not sure what these con dition blocks are doing

I use these as in constant/variable I have a bool then I don't use Istype. I use it as if (already in block) variable/constant, then whether true/false the correct dot is activated.
-
The ltype and sltype variables are enumerations that let the user choose from the lot type i.e fixed lot and auto lot same for the sltype.