fxDreema

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

    How to make "Set Current Markets" block not run on every symbol on the same tick? [MT5]

    Questions & Answers
    2
    2
    22
    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.
    • G
      gaberen last edited by

      How do I make the "Set Current Markets" block not run on every symbol on the same tick? AKA, how can I prevent new trades from being placed on two correlated symbols when getting a signal on both of them?

      I'm currently making a multi-symbol fx backtester EA that checks for the risk of each currency that's currently being traded. Sometimes I'll get a signal on two correlated symbols at the same time, and when that happens I only want it to run on one of them.

      For example: The EA gets two signals to go short on both GBPSGD and GBPCAD at the same time. I've already made it so the EA stores that GBP has a trade open now and should ignore any other GBP trades in the future, but since the signal happened at the exact same time, they both think they're the first one to run and both GBPSGD and GBPCAD get executed.

      Is there a way to make it so each symbol is only executed one after the other instead of all of them at once?

      I hope this makes sense

      1 Reply Last reply Reply Quote 0
      • L
        Lacone last edited by

        Hello,
        You can use the "No position" block to exclude all pairs after, for example, GBPUSD has been executed. This also works with multiple signals within the same tick cycle.

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

        Online Users

        R
        G
        H

        16
        Online

        147.3k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors