Ma not respected
-
I have tried some simple programs with indicators and I seem to get it right. But this one confuses me. When started it takes trades regardless of which side of the MA the price is. What am I missing?

-
share the project. but it should not open trades below the ma
-
@jannemar Youngtreptrader is right. Could you please share the link to your project?
-
-
@jannemar The problem is with blocks 19 and 23 you are requiring that same condition to be false initially and then true. You need to fix that part. Additionally, block 26 should be split into two, one for buys only and another one for sells only.
-
Thank you.
But my real problem is 20 + 13. That buys are placed regardless of 20 being true or false. -
@jannemar But you cannot require the same condition to be true AND false at the same time. That will never work.
-
I understand that. That was a misstake when deliting parts of the blocks. But that should not affect the blocks in the buy path, should it? And as buys are placed that branch do run.
-
@jannemar I'm afraid I'm a bit lost now. If the true/false condition is removed, what is the problem now exactly?
-
The only thing I have now is a condition to take buy trades when previous candle closed above the MA. But from what I can see it takes trades below the MA.
I have coded the same contidion by myself in an EA and it seems to work correctly. -
@jannemar Congrats!