PROTECTED SOURCE SCRIPT

APIBridge Buy/Sell Straddle

868
It is recommended to use this strategy for options


About Straddle

Straddle is method of buying or selling options with same strike price and expiry but in opposite direction ie while buying options you buy a call and a put with same strike price and expiry and while selling options you sell one call and one put with same strike price. It is needed to specify stoploss and target for both the legs so that when the market moves either way , one of them hits the stoploss while the other one stays open.This reduces the risk and increases the chances of profit


About the Strategy

Using this strategy you can buy straddle ,sell straddle or do both simultaneously . The user is needed to specify the trigger price and when the candle crosses the trigger price it will trigger the orders of call and put according to the inputs you have choosen. The user is also needed to specify the stoploss and target for both the legs seperately .

It is recommended to keep the stoploss for call to be higher then target for put and stoploss for put to be lower then target for call in case of buying the straddle and keep stoploss for put is higher then target for call and stoploss for call is lower than target for put.



Strategy parameters on tradingview

==========Backtesting==========

1. Check box : Tick the checkbox to activate the backtesting parameters

2. Backtesting starting : Specify the starting date and time , the strategy will only show results of trades which were placed after this date and time

3. Backtesting Ending : Specify the ending date and time , the strategy will only show results of the trades which were placed after this date and time


==========Options Settings==========
1. Instrument Type :
Choose whether you want to trade in OPTIDX(Option Index) or OPTSTK(Option Stock)

2. Expiry Date : Select the Expiry Day

3. Expiry Month : Select the Expiry Month

4. Year : Select the Expiry Year

5. Symbol : Input the symbol if you want to trade in a symbol other than the current chart symbol or leave it blank o use the current chart symbol

6. Number of lots : Choose the number of lots you want to trade


==========BUY==========

1. Buy : Check this box to buy straddle with your settings , by default it' kept false to prevent misfire of the trades

2. Trigger Price : Specify the trigger price , the strategy will place order once the candle closes after crossing it , by default it's 0

3. Crossing Type : Specify the crossing type , ie you want to take trades after crossing up , crossing down or just crossing ,by default it's crossover ie buy when candle closes above this price from below

4. Strike Difference between two consecutive strikes : Input the difference between two consecutive strikes of the security you have choosen from option chain , ex For NIFTY INDEX its 50 . By default it's 0

5. Difference of the desired strike from the ATM : Input the strike you want to in terms of difference from the ATM , example NIFTY 50 current ATM is 18500 and you want to buy OTM of 18600 then input 100 in this field . By default it's 0

6. Stoploss and target type : Enter the stoploss and traget type from the list . By default it's in percentage

7. Call BuyStoploss : Enter the stoploss for call Buy, by default it's 1%

8. Put BuyStoploss : Enter the stoploss for put Buy, by default it's 1%

9. Call Buytarget : Enter the target for Call Buy, by deafult it's 3%

10. Put Buytarget : Enter the target for put Buytarget , by default it's 3%


==========SELL==========

1. Sell: Check this box to buy straddle with your settings , by default it' kept false to prevent misfire of the trades

2. Trigger Price : Specify the trigger price , the strategy will place order once the candle closes after crossing it , by default it's 0

3. Crossing Type : Specify the crossing type , ie you want to take trades after crossing up , crossing down or just crossing ,by default it's crossover ie sell when candle closes above this price from below

4. Strike Difference between two consecutive strikes : Input the difference between two consecutive strikes of the security you have choosen from option chain , ex For NIFTY INDEX its 50 . By default it's 0

5. Difference of the desired strike from the ATM : Input the strike you want to in terms of difference from the ATM , example NIFTY 50 current ATM is 18500 and you want to sell strike of 18300 then input -300 in this field . By default it's 0

6. Stoploss and target type : Enter the stoploss and traget type from the list . By default it's in percentage

7. Call Sell Stoploss : Enter the stoploss for call Sell , by default it's 1%

8. Put Sell Stoploss : Enter the stoploss for put sell , by default it's 1%

9. Call sell target : Enter the target for Call sell , by deafult it's 3%

10. Put sell target : Enter the target for put sell target , by default it's 3%

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.