Limit number of BuyOrders through Counter Routine
-
I want to know if the following setup would give the following result
What I want to achieve:
Each Time A certain trading condition is true the EA should buy once per bar. However the number of times the Buy should get executed is limited to 4
So in other words the routine only adds maximum of 4 trades when the buy conditions are true, even if the condition stays true for many more bars
When the market reverses it then resets the counter for the opposite trades, so when buy condition is true it reset the sellcounterWould this look like this in fxdreema magic?

......
counterbuy.png -
It doesn't look correct to me. You have this reset even before the counter. But what "market revrses" mean? And what should happen then with those Buy trades? Ok, it "resets for the opposite trades", but I don't see "Sell now" here or the opposite condition. But I don't think that counters are needed, they are very rarely needed.
-
Of course there is a similar routine on the sell side
The counterreste is to reste the counter on the sellsideAnyway Counter could be used (abused) like that, no?
-
The idea of those counters is to count how many times the block runs. Optionally any counter can be reset, but the block to reset is normally located somewhere else, under another condition. You have the reset at the same place where the counter is, so the counter counts nothing.
But I will suggest to not use counters, because their memory is temporary. It's much better if you use only conditions who check things about the trades - their type, count, profit or something like this.