fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    MT5 project - Execution price of last trade, in a position with multiple entry levels

    Questions & Answers
    1
    1
    577
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      moreirajbn last edited by moreirajbn

      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.

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post

      Online Users

      A
      N
      F
      Z
      H

      20
      Online

      146.8k
      Users

      22.4k
      Topics

      122.6k
      Posts

      Powered by NodeBB Forums | Contributors