Storing price levels on multi-currency system
-
So I'm building a multi-currency grid-system on mt5. Once I add to volume on existing trade, I want the ea to remember the current price so I can restrict the ea from opening new trades too close to previous opening price.
Pips away from open price -block wont work, because mt5 ignores the LAST position increment and instead uses the average open price.
Storing current candle price at the time of opening to a variable also won't work, because that can't be used on multicurrency - I want to optimize this on many currencies at once.
This COULD be done simply with the "buy pending orders in grid" block, but I don't want to use that because it has certain limitations.
I've been trying to draw a horizontal line at the time of incrementing the position so the ea could check that line individually on every chart - but I can't get it to work.
Any other solutions to this?
-
Well, the storing values to object -approach worked after all

Edit: No it didn't

For each object -block still needs the chart id to check from.. What does the id actually mean? Is there a way to set it to work just on the "current" chart?Edit2: Worked around my problem by placing one new pending order every time theres a position running but no orders.. I'm almost happy with this,
-
"No trade nearby" block? Well, "No position nearby" for MT5