Basic Condition will not always work (candles and MA's)
-
Hi there!
This is only 1 part of a larger EA. But I cannot get this 1 thing to work perfectly.
The logic is:IF: (Candle(1) Close > 20 Simple MA)
AND: (Candle(1) Low < 20 Simple MA) OR (Candle(1) OPEN < Simple MA)
AND: (IF: BID Price x> Candle(1) High)
THEN: OPEN TRADE (Market Order)So this works most of the time. Which is great.
But in other very obvious cases, where the candle conditions are clearly met (perfectly), trades are not opened. I have ran this multiple times on backtests in MT5.
I have also gone back to these failed instances in the backtest and I checked the values or everything at that exact point. And it should have worked, but it doesnt.Any opinions on why?
Here is the link:
https://fxdreema.com/shared/ROwKbKBMd
regards
Julian -
@julianrbach Two suggestions:
-
Are you reaklly planning to manage manually opened trades? If not, modify the 'All(automated...' option to the strandar 'Group' option.
-
Yot are comparing candle ID 1 close price with MA candle's 0 value. Are you sure that is what you want? I suggest to modify all candle ID of all condition operands to candle Id 1.
-
-
Hi, Ok I fixed the NoTrade blocks to the standard.
But, I have looked at all the other settings, and double checked them now. But Im still getting missed entries. This is only a small part of a larger EA, but I cant get this small thing to work everytime.
This is what the logic looks like now:
https://fxdreema.com/shared/Wbeyv2awb

I have attached a image of a little test. You can see 2 positions successfully open and close. And I marked those ones with a red arrow and blue correct mark.
But then there are 2 other places where trades should have opened. All the conditions were met, exactly the same. But it did not open. I mark those with a red cross. (I also checked the values of those candles at the failed entry points and compared it to the SMA at that time. Looks fine, and yes, it should stlll have opened.regards
Julian -
@julianrbach I don't see which block of your project is comparing the value of close candles to those blue spots. Where do they come from?