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

Asked by Radhesh Joshi · SOLVED
1 reply 552 views Jump to solution Reply
Radhesh Joshi Original Post
Strategy Builder

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.

Posted Jun 16
Reply

    1 Reply

    Tech Support AlgoDelta
    Tech Support AlgoDelta Automation Expert ·

    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.

    Verified Solution
    • 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. – Radhesh Joshi Jul 3
    Markdown supported · ```json for code blocks · paste or drop screenshots

    Be specific and kind. Never share API keys, passwords or personal account details.

    Welcome to the community

    Log in or create your account in under a minute.

    1. 1Mobile
    2. 2E-mail
    3. 3Password
    +91

    Have a password?

    By continuing you agree to the community guidelines. We’ll send a one-time code by SMS.