MT5 project - Execution price of last trade, in a position with multiple entry levels
-
Hi @fxDreema
I'm having trouble getting the price for the last executed "trade", when a position with multiple entries is open. Block "For each position" returns only the entire position's price.
Example of what I need:
- EA opens a BUY position in EURUSD at 1.23000 , volume = 0.1 lot (trade 1)
- EA adds (buy again) 0.1 lot to this position at 1.22500 (trade 2)
- A SELL LIMIT order of 0.1 lot is executed at 1.22700 (trade 3), leaving only 0.1 lot open in the buy position
What I want the EA to find are the price and volume of trade 3 (sell 0.1 lot at 1.22700), can you help me with that?
I have tried combinations of blocks both "on Tick" (from "Bucket of positions") and "onTrade" ("Position decremented"), but none worked.
Thanks a lot.