fxDreema

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

    Bucket - Problem

    Questions & Answers
    2
    2
    594
    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
      martin 1 last edited by

      Hello Coders,
      I have a problem with the bucket block. I am working with MT5 hedged mode.

      I am using it to find the average opening price of the opened positions. It works fine if I use the same lot size for all positions.

      For example:

      0.1 lot buy - 1.1200
      0.1 lot buy - 1.1300
      0.1 lot buy - 1.1400

      Average price = 1.1300

      If I use differend lot sizes it calculates only the average price of the opening prices but not weighted.

      0.1 lot buy - 1.1200
      0.2 lot buy - 1.1300
      0.3 lot buy - 1.1400

      Average result = 1.1300 but it should be 1.13333333

      It there a solution for get a weighted average opening price?

      Best regards,
      Martin

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        Yes, it's Average, not Weighted. I don't know, I never added such thing in any block. Maybe with a custom code. To be honest, I don't really know what is weighted average 🙂

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

        Online Users

        F
        M
        A
        L
        O
        S
        E
        J
        D
        M
        X
        K
        E

        23
        Online

        146.6k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors