Home Forums MT4/MT5 Connection How can I use Exit on Opposite with the JSON Bridge while trading Options?

How can I use Exit on Opposite with the JSON Bridge while trading Options?

  • Author
    Posts
    • I have a strategy running in an MT5 EA.

      What I want is:

      -When a Buy signal comes, buy a Call Option.

      -If any Put Option position is already open, it should be squared off first.

      -When a Sell signal comes, buy a Put Option.

      -If any Call Option position is already open, it should be squared off first.

      I know this can be done easily in Futures and Stocks using Exit on Opposite, but I am confused about how to achieve the same thing while trading Options through the JSON Bridge.

    • Yes sir, that’s a very valid question.

      The tricky part is that Options trading works a little differently compared to Futures and Stocks when using the JSON Bridge.

      Because Call and Put options are different instruments, we cannot always achieve this behavior by simply enabling a standard “Exit on Opposite” setting like we do in Futures.

      To implement this properly, a custom JSON syntax is usually required.

      That syntax needs to handle:

      -Squaring off the existing option position first

      -Identifying the correct opposite-side option contract

      -Executing the new order after the existing position is closed

      Because of this additional logic, the syntax generally needs to be configured manually based on your exact requirement.

      So if you want a setup like:

      -Buy Signal → Exit existing Put → Buy Call

      -Sell Signal → Exit existing Call → Buy Put

      then we recommend contacting the support team.

      They can guide you with the correct syntax configuration and, if required, forward the requirement to the technical team for assistance.

      Since the implementation depends on your trading setup and option selection logic, the support team will be able to provide the most accurate solution for your specific use case.

      • Author↳ Replying to @Algodelta Support

        Thanks for your guidance, the technical and support team is very supportive by their guidance I can be able to achieve the condition that I want in MT5.

Viewing 1 reply thread
×

Start a Discussion

Get help from the AlgoDelta community.

×

Welcome Back!

Enter your email to sign in or create an account. No passwords needed.

Pending Approval

⚠️

Delete This?

Are you sure you want to delete this? This action is permanent and cannot be undone.

Scroll to Top