fxDreema

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

    Selective multi currency EA

    Questions & Answers
    3
    4
    701
    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.
    • C
      christarola last edited by

      Hello,
      What i try to do is to trade on multiple currencies but only when there are no trades in similar pair.
      For example if a trade occurs in EURUSD i will only make it if there are no other open trades on pairs that include the EUR or the USD like EURGBP or USDJPY.
      Thank you

      K 1 Reply Last reply Reply Quote 0
      • K
        kop @christarola last edited by

        @christarola this should work ,will only open one of the listed pairs 0_1580714756152_voorbeeld.mq4 the

        T 1 Reply Last reply Reply Quote 0
        • T
          trader.philipps @kop last edited by

          @kop That would mean that you trade all the stated pairs within the EA. For simple strategy that might work well, but with more complex ones probably one have to be very certain what EA will do when.

          @christarola The alternative would be, that if one prefers 1 EA instance per chart, to update global variables on each transaction such as trade open and trade close (pending orders would special to take into consideration). Assuming you create a global variable called EUR and one USD. In case of a EURUSD trade, you would set both variables to 1. If that trade is closed you would set it to 0.
          Berfore opening a EUR or USD related trade you might check before opening if the global variable is < 1.
          There are some pitfalls regarding trading actions such as close trade when EA casely or or not is not active.

          An easy way to extract the currencies involved is using the marketinfo data like this ...

          0_1580725457912_f5d5321c-b70f-4f13-bc3e-ed458b1a1814-image.png

          I like to share my knowledge, but expect the others to contribute as well.

          C 1 Reply Last reply Reply Quote 0
          • C
            christarola @trader.philipps last edited by

            @trader-philipps Thats a nice solution but im missing some parts of it.So lets say i create a global variable for every currency (EUR,USD,JPY,GBP,.....,) then how do i make the condition on open and close trade to check if the base or quote currency i want to trade equals to a variable in order to change its value to 0 or 1. Could you give me an example because im still a newbie.

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

            Online Users

            A
            E
            K
            J
            J
            G

            16
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors