fxDreema

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

    Close on reverse

    Questions & Answers
    2
    2
    740
    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.
    • P
      PEDRORLANDO last edited by

      Hi

      I want my EA to close the position on reverse condition, and open a a new inverse position at the same time i.e if it's long, close buy and at the same time, sell.

      Anyone can help me?

      Thanks

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

        The idea is to have 2 block chains under "on Tick" like this:

        No buys => Check condition to open new Buy => Close all trades (or only sells, but there are no buys anyway) => Create new Buy
        No sells => Check condition to open new Sell => Close all trades (or only buys, but there are no sells anyway) => Create new Sell

        Depending on the condition "Once per bar" can be used somewhere to speed up the backtesting (actually not checking conditions when there is no need to) or to limit the number of trades in one bar in case you got both conditions within a very short period of time.

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

        Online Users

        K
        B
        T

        7
        Online

        146.8k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors