Once per bar MT5
-
Hey guys, @fxDreema
switched from Mt4 to Mt5.
Before never had the issue that both buy and sell were opened even when there is once per bar block.Tried both with 1 block for once per bar and for each buy and sell row both doesnt seem to help.
any ideas, tips?
Thx
https://fxdreema.com/shared/R3yv26bdd

-
Although indicator conditions are opposite, you are using opposite logic, so both are activated at the same time, also once per bar in this situation needs to go under your condition, so it checks you're condition, before it activates once per bar.

-
Hi, thank you. so i would make it Check for no position-> Condition-> Once per bar for both sides each, or can i use 1 block for once per bar below conditions for both?
Is this problem only for ADX indicator?
When using Heiken Ashi for instance it didnt appear as well for both at same time.
Just asking.https://fxdreema.com/shared/oOQQUhu4
Just checked with the new adjustments, but problem still remains same

-
Rather than adding other blocks, change what you have and see what happens.
-
How do you mean? So as you have explained i added once per bar below the last condition block, right?
The other condition is for ADX for Trend strengh additonally to ADX Di+ and Di-.
Tested it with and without this condition, buy and sell are still opened like before.
Testing different approaches currently for ADX. -
Yes but as I said your two logics in the condition block are interfering with each other
-
Ok, but how can i prevent this?
I thought therefore there are a block for Buy and a block for Sell conditions, because the Crossover for DI+ to -DI is the opposite right?For Buy Di+ should cross -DI from below
and for Sell -Di should cross +Di from below.
You know, cause ADX is non directional.When testing conditions blocks for Heiken Ashi i havent had this before as well.
https://fxdreema.com/shared/KhDjgTe1e
Here's an example project in MT4.
As someone suggested MT4 isnt that different than MT5 in FX dreema.
-
Did a quick test only with <> for ADX DI conditions now the EA places only 1 position per bar.
Did you mean that that <x , >x caused the missleading output?

-
Change the logic, so both blocks use the same, then use the opposite X> or X<.
-
Ok, with logic you mean the input inself like Di mode +Di -Di?
Yes, but isnt it like that?
You know, cause it needs to be that +Di crosses for buy and -Di crosses for short.
As i got it this ADX is non directional therefore for both it should be Di > than other Di. Or X> if crosses then works.
Otherwise i'm not sure how you mean this.


-
All I can say is test with all options, see what happens, then report back here.
-
Yes, like mentioned tested it today afternoon.
When switching the x> to just > in the Di conditions block it opens 1 trade like desired.
Was it this what you meant by change the logic?
As i was told, for ADX indicator it should be "crosses" for the +Di and -Di not only above but oddly then there is the double trade placed with x>.
This was the test when it opned only 1 position with the is > function.
https://fxdreema.com/forum/assets/uploads/files/1695909508743-mt5-testing.png
-
No mate, left operand +Di X> -Di in other condition block +Di X< -Di