{"id":506,"date":"2023-01-27T03:21:34","date_gmt":"2023-01-27T03:21:34","guid":{"rendered":"https:\/\/algomojo.com\/blog\/?p=506"},"modified":"2023-09-13T05:43:53","modified_gmt":"2023-09-13T05:43:53","slug":"sending-futures-spot-signals-to-two-legged-options-execution-module-tradingview-pinescript-module","status":"publish","type":"post","link":"https:\/\/algomojo.com\/blog\/sending-futures-spot-signals-to-two-legged-options-execution-module-tradingview-pinescript-module\/","title":{"rendered":"Sending Futures\/Spot \u2013 Signals to Two-Legged Options Execution Module \u2013 Tradingview Pinescript Module"},"content":{"rendered":"\n<p>Thought of making an open-source Tradingview Pinescript code demanded by most of the option traders to control the cost, control the risk, and configure the two-legged option trading strategy of their choice with slicing larger orders feature. So here is a two-legged options execution Tradingview module for the Algomojo trading platform where users can configure modules on top of their own trading logic to convert any spot\/futures signals into 9 types of two-legged options execution modules.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/algomojo.com\/blog\/wp-content\/uploads\/2023\/01\/image-4.png\"><img loading=\"lazy\" width=\"1764\" height=\"970\" src=\"https:\/\/algomojo.com\/blog\/wp-content\/uploads\/2023\/01\/image-4.png\" alt=\"\" class=\"wp-image-507\"\/><\/a><\/figure>\n\n\n\n<p><strong>Tradingview Pinescript Module Explained<\/strong><\/p>\n\n\n\n<p><strong>Block 1 :<\/strong>&nbsp;API Controls + Algomojo Input Controls and Option Strike Calculation<\/p>\n\n\n\n<p><strong>Block 2 :<\/strong>&nbsp;Backtesting Controls &amp; Target and Stoploss Controls<\/p>\n\n\n\n<p><strong>Block 3 :<\/strong>&nbsp;Trading Strategy and Controls (write your trading strategy in the block<\/p>\n\n\n\n<p><strong>Block 4 :<\/strong>&nbsp;Buy and Sell Signal Mapping (Buy,Sell, Short,Cover Signal Mapping is required)<\/p>\n\n\n\n<p><strong>Block 5 :<\/strong>&nbsp;Framing Option Symbols and Multi Order API Messaging Structure<\/p>\n\n\n\n<p><strong>Block 6 :<\/strong>&nbsp;Trade Execution Controls<\/p>\n\n\n\n<p><strong>Block 7 :<\/strong>&nbsp;Plotting Trading Dashboard<\/p>\n\n\n\n<p><strong>What is a Two-Legged Options Strategy<\/strong>?<\/p>\n\n\n\n<p>A two-legged options trading strategy involves buying or selling two options at the same time, typically with different strike prices or expiration dates. The strategy is designed to take advantage of the price difference between the two options and can be used for a variety of purposes, such as hedging, speculation, or income generation.<\/p>\n\n\n\n<p><strong>Features of the Two-Legged Options Execution Module<\/strong><\/p>\n\n\n\n<p>1)Configure various styles of two-legged options execution strategies. Supports 9 types of two-legged options trading strategies.<br>2)Configure separate options trading strategies for long-entry and short-entry signals in spot\/futures charts<br>3)Place Larger Option Orders by Splitting Larger Orders into multiple small orders.<br>4)Option Strike calculation at Tradingview end (Trades can configure the Underlying symbol as Spot.\/Futures) based on their trading requirement) accordingly, options strikes will be calculated.<br>5)Easy to configure the module by configuring&nbsp;<strong>block 3&nbsp;<\/strong>and mapping the signals to&nbsp;<strong>block 4&nbsp;<\/strong>in the below-mentioned code<\/p>\n\n\n\n<p><strong>Here are the Supported two-legged options trading strategies:<\/strong><\/p>\n\n\n\n<p><strong>Credit Spread:<\/strong>&nbsp;Selling an option at one strike price and buying an option at a lower strike price.<\/p>\n\n\n\n<p><strong>Debit Spread:<\/strong>&nbsp;Buying an option at one strike price and selling an option at a higher strike price.<\/p>\n\n\n\n<p><strong>Straddle:<\/strong>&nbsp;buying a call and a put option with the same strike price and expiration date.<\/p>\n\n\n\n<p><strong>Strangle:<\/strong>&nbsp;buying a call option with a higher strike price and a put option with a lower strike price<\/p>\n\n\n\n<p><strong>Synthetic Futures:&nbsp;<\/strong>Buying\/Selling a call option and selling\/Buying a put option of the same strike price and expiration date<\/p>\n\n\n\n<p><strong>Diagonal Spread:<\/strong>&nbsp;Buying a call or put option with a longer expiration date and selling a call or put option with a shorter expiration date and a different strike price.<\/p>\n\n\n\n<p><strong>Calendar Spread:&nbsp;<\/strong>Buying a call or put option with a longer expiration date and selling a call or put option with a shorter expiration date.<\/p>\n\n\n\n<p><strong>Ratio Spread:<\/strong>&nbsp;Buying a call or put option at one strike price and selling multiple options at a different strike price<\/p>\n\n\n\n<p><strong>Ratio Back Spread:<\/strong>&nbsp;Buying multiple options at one strike price and selling an option at a different strike price<\/p>\n\n\n\n<p><strong>Webhook URL for Trade Automation<\/strong><\/p>\n\n\n\n<p>This code uses Algomojo Consolidated API and uses placemultiorder API functionality and sends two leg orders in options. Here is the webhook URL that needs to be used for all the supported Algomojo brokers,<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-json\">https:\/\/amapi.algomojo.com\/v1\/PlaceMultiOrder<\/code><\/pre>\n\n\n\n<p><strong>Pinescript Trading Strategy Module<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-clike\">\n\/*\nAlgomojo - Smart Spot\/Futures to Two Leg Options Trading Module with Split Order Controls\n\nSupported Two Leg Strategies\nStrategies that be built using this module\n1)Credit Spread\n2)Debit Spread\n3)Straddle\n4)Strangle\n5)Synthetic Futures\n6)Diagonal spread\n7)Calendar Spread\n8)Ratio Spread\n9)Ratio Back Spread\n\n\nCreated By : Algomojo\nCreated on : 7 Mar 2023.\nWebsite : www.algomojo.com\n*\/\n\n\n_SECTION_BEGIN(&quot;Algomojo - Broker Controls&quot;);\n\n\n\/\/ Send orders even if Amibroker is minimized or Chart is not active\nRequestTimedRefresh(1, False); \n\n\/\/Creating Input Controls for Setting Order Related Information\n\nbroker =Paramlist(&quot;Broker&quot;,&quot;an|ab|fs|fy|gc|pt|sm|tc|up|zb|ze&quot;,0);\nver = ParamStr(&quot;API Version &quot;,&quot;v1&quot;);\napikey = ParamStr(&quot;apikey&quot;,&quot;xxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;); \/\/Enter your API key here\napisecret = ParamStr(&quot;secretkey&quot;,&quot;xxxxxxxxxxxxxxxxxxxxxxxxxxxx&quot;); \/\/Enter your API secret key here\n\n_SECTION_END();\n\n\n_SECTION_BEGIN(&quot;Algomojo - Order Controls&quot;);\n\nstrategy = ParamStr(&quot;Strategy Name&quot;, &quot;Test Strategy&quot;);\n\nspot = Paramlist(&quot;Spot Symbol&quot;,&quot;NIFTY|BANKNIFTY&quot;);\nexpiry_leg1 = ParamStr(&quot;Expiry Date1&quot;,&quot;25JAN23&quot;);\nexpiry_leg2 = ParamStr(&quot;Expiry Date2&quot;,&quot;25JAN23&quot;);\n\nexchange = ParamList(&quot;Exchange&quot;,&quot;NFO|MCX&quot;,0); \nSymbol = ParamStr(&quot;Underlying Symbol&quot;,&quot;NIFTY-I.NFO&quot;);\niInterval= Param(&quot;Strike Interval&quot;,50,1,10000,1);\nStrikeCalculation = Paramlist(&quot;Strike Calculation&quot;,&quot;PREVOPEN|PREVCLOSE|TODAYSOPEN&quot;,0);\nLotSize = Param(&quot;Lot Size&quot;,50,1,10000,1);\n\nquantity_leg1 = Param(&quot;quanity1(Lot Size)&quot;,1,0,10000)*LotSize;\nquantity_leg2 = Param(&quot;quanity2(Lot Size)&quot;,1,0,10000)*LotSize;\n\nopttype_buyleg1 = ParamList(&quot;Option Type1(Buy)&quot;,&quot;CE|PE&quot;,0);\nopttype_buyleg2 = ParamList(&quot;Option Type2(Buy)&quot;,&quot;CE|PE&quot;,0);\n\ntradetype_buyleg1 = ParamList(&quot;Option Trade Type1(Buy)&quot;,&quot;BUY|SELL&quot;,0);\ntradetype_buyleg2 = ParamList(&quot;Option Trade Type2(Buy)&quot;,&quot;BUY|SELL&quot;,0);\n\n\noffset_buyleg1 = Param(&quot;Offset1(Buy)&quot;,0,-40,40,1);\noffset_buyleg2 = Param(&quot;Offset2(Buy)&quot;,0,-40,40,1);\n\nopttype_shortleg1 = ParamList(&quot;Option Type1(Short)&quot;,&quot;CE|PE&quot;,0);\nopttype_shortleg2 = ParamList(&quot;Option Type2(Short)&quot;,&quot;CE|PE&quot;,0);\n\n\n\ntradetype_shortleg1 = ParamList(&quot;Option Trade Type1(Short)&quot;,&quot;BUY|SELL&quot;,0);\ntradetype_shortleg2 = ParamList(&quot;Option Trade Type2(Short)&quot;,&quot;BUY|SELL&quot;,0);\n\n\noffset_shortleg1 = Param(&quot;Offset1(Short)&quot;,0,-40,40,1);\noffset_shortleg2 = Param(&quot;Offset2(Short)&quot;,0,-40,40,1);\n\npricetype = ParamList(&quot;Order Type&quot;,&quot;MARKET&quot;,0);\nproduct = ParamList(&quot;Product&quot;,&quot;MIS|NRML&quot;,1);\n\n\n\nprice = 0; \ndisclosed_quantity = 0;\ntrigger_price = 0;\namo = &quot;NO&quot;;\nsplitorder = ParamList(&quot;To Split Orders&quot;,&quot;NO|YES&quot;,0);\nsplit_quantity = Param(&quot;Split Quantity&quot;,500,1,100000,1);\n\nVoiceAlert = ParamList(&quot;Voice Alert&quot;,&quot;Disable|Enable&quot;,1);\n\nEntrydelay = Param(&quot;Entry Delay&quot;,0,0,1,1);\nExitdelay = Param(&quot;Exit Delay&quot;,0,0,1,1);\nEnableAlgo = ParamList(&quot;AlgoStatus&quot;,&quot;Disable|Enable|LongOnly|ShortOnly&quot;,0);\nresp = &quot;&quot;;\n\n\n\/\/Static Variables for Order protection\n\nstatic_name_ = Name()+GetChartID()+interval(2)+strategy;\nstatic_name_algo = Name()+GetChartID()+interval(2)+strategy+&quot;algostatus&quot;;\n\n\nAlgoBuy = lastvalue(Ref(Buy,-Entrydelay));\nAlgoSell = lastvalue(Ref(Sell,-Exitdelay));\nAlgoShort = lastvalue(Ref(Short,-Entrydelay));\nAlgoCover = lastvalue(Ref(Cover,-Exitdelay));\n\n\n\nGfxSelectFont( &quot;BOOK ANTIQUA&quot;, 14, 100 );\nGfxSetBkMode( 1 );\nif(EnableAlgo == &quot;Enable&quot;)\n{\nAlgoStatus = &quot;Algo Enabled&quot;;\nGfxSetTextColor( colorGreen ); \nGfxTextOut( &quot;Algostatus : &quot;+AlgoStatus , 20, 40); \nif(Nz(StaticVarGet(static_name_algo),0)!=1)\n{\n_TRACE(&quot;Algo Status : Enabled&quot;);\nStaticVarSet(static_name_algo, 1);\n}\n}\nif(EnableAlgo == &quot;Disable&quot;)\n{\nAlgoStatus = &quot;Algo Disabled&quot;;\nGfxSetTextColor( colorRed ); \nGfxTextOut( &quot;Algostatus : &quot;+AlgoStatus , 20, 40); \nif(Nz(StaticVarGet(static_name_algo),0)!=0)\n{\n_TRACE(&quot;Algo Status : Disabled&quot;);\nStaticVarSet(static_name_algo, 0);\n}\n}\nif(EnableAlgo == &quot;LongOnly&quot;)\n{\nAlgoStatus = &quot;Long Only&quot;;\nGfxSetTextColor( colorYellow ); \nGfxTextOut( &quot;Algostatus : &quot;+AlgoStatus , 20, 40); \nif(Nz(StaticVarGet(static_name_algo),0)!=2)\n{\n_TRACE(&quot;Algo Status : Long Only&quot;);\nStaticVarSet(static_name_algo, 2);\n}\n}\nif(EnableAlgo == &quot;ShortOnly&quot;)\n{\nAlgoStatus = &quot;Short Only&quot;;\nGfxSetTextColor( colorYellow ); \nGfxTextOut( &quot;Algostatus : &quot;+AlgoStatus , 20, 40); \nif(Nz(StaticVarGet(static_name_algo),0)!=3)\n{\n_TRACE(&quot;Algo Status : Short Only&quot;);\nStaticVarSet(static_name_algo, 3);\n}\n}\n\n\nEnableTextOutput(False);\n\n\n\n\/\/optionCEtype = WriteIf(offsetCE == 0, &quot;ATM CE&quot;, WriteIf(offsetCE&lt;0,&quot;ITM&quot;+abs(offsetCE)+&quot; CE&quot;,&quot;OTM&quot;+abs(offsetCE)+&quot; CE&quot;));\n\/\/optionPEtype = WriteIf(offsetPE == 0, &quot;ATM PE&quot;, WriteIf(offsetPE&lt;0,&quot;ITM&quot;+abs(offsetPE)+&quot; PE&quot;,&quot;OTM&quot;+abs(offsetPE)+&quot; PE&quot;));\n\n\nif(StrikeCalculation==&quot;PREVOPEN&quot;)\n{\nSetForeign(Symbol);\nspotC = Ref(OPEN,-1);\nRestorePriceArrays();\n}\n\nif(StrikeCalculation==&quot;PREVCLOSE&quot;)\n{\nSetForeign(Symbol);\nspotC = Ref(Close,-1);\nRestorePriceArrays();\n}\n\nif(StrikeCalculation==&quot;TODAYSOPEN&quot;)\n{\nSetForeign(Symbol);\nspotC = TimeFrameGetPrice(&quot;O&quot;,inDaily);\nRestorePriceArrays();\n}\n\/\/Maintain Array to Store ATM Strikes for each and every bar\nstrike = IIf(spotC % iInterval &gt; iInterval\/2, spotC - (spotC%iInterval) + iInterval,\n\t\t\tspotC - (spotC%iInterval));\n\t\t\t\n\/\/Buy Signal Entry Strikes\t\n\nif(opttype_buyleg1==&quot;CE&quot;)\n{\t\nstrike_buyleg1 = strike + (offset_buyleg1 * iInterval);\n}\nif(opttype_buyleg1==&quot;PE&quot;)\n{\t\nstrike_buyleg1 = strike - (offset_buyleg1 * iInterval);\n}\nif(opttype_buyleg2==&quot;CE&quot;)\n{\t\nstrike_buyleg2 = strike + (offset_buyleg2 * iInterval);\n}\nif(opttype_buyleg2==&quot;PE&quot;)\n{\t\nstrike_buyleg2 = strike - (offset_buyleg2 * iInterval);\n}\n\n\/\/Short Signal Entry Strikes\t\n\nif(opttype_shortleg1==&quot;CE&quot;)\n{\t\nstrike_shortleg1 = strike + (offset_shortleg1 * iInterval);\n}\nif(opttype_shortleg1==&quot;PE&quot;)\n{\t\nstrike_shortleg1 = strike - (offset_shortleg1 * iInterval);\n}\nif(opttype_shortleg2==&quot;CE&quot;)\n{\t\nstrike_shortleg2 = strike + (offset_shortleg2 * iInterval);\n}\nif(opttype_shortleg2==&quot;PE&quot;)\n{\t\nstrike_shortleg2 = strike - (offset_shortleg2 * iInterval);\n}\n\n\nbuycontinue = Flip(Buy,Sell);\nshortcontinue  = Flip(Short,Cover);\n\nexitsymbol_buyleg1 = &quot;&quot;;\nexitsymbol_buyleg2 = &quot;&quot;;\nexitsymbol_shortleg1 = &quot;&quot;;\nexitsymbol_shortleg2 = &quot;&quot;;\n\nExitStrike_buyleg1 = ValueWhen(Ref(Buy,-Entrydelay),strike_buyleg1);\nExitStrike_buyleg2 = ValueWhen(Ref(Buy,-Entrydelay),strike_buyleg2);\n\nExitStrike_shortleg1 = ValueWhen(Ref(Short,-Entrydelay),strike_shortleg1);\nExitStrike_shortleg2 = ValueWhen(Ref(Short,-Entrydelay),strike_shortleg2);\n\nif(broker==&quot;tc&quot; OR broker==&quot;fs&quot;)\n{\n\nif(opttype_buyleg1==&quot;CE&quot;) opttype_buy_leg1 = &quot;C&quot;;\nif(opttype_buyleg1==&quot;PE&quot;) opttype_buy_leg1 = &quot;P&quot;;\n\nif(opttype_buyleg2==&quot;CE&quot;) opttype_buy_leg2 = &quot;C&quot;;\nif(opttype_buyleg2==&quot;PE&quot;) opttype_buy_leg2 = &quot;P&quot;;\n\nif(opttype_shortleg1==&quot;CE&quot;) opttype_short_leg1 = &quot;C&quot;;\nif(opttype_shortleg1==&quot;PE&quot;) opttype_short_leg1 = &quot;P&quot;;\n\nif(opttype_shortleg2==&quot;CE&quot;) opttype_short_leg2 = &quot;C&quot;;\nif(opttype_shortleg2==&quot;PE&quot;) opttype_short_leg2 = &quot;P&quot;;\n\n\nexitsymbol_buyleg1 = WriteIf(buycontinue OR sell,spot+expiry_leg1+opttype_buy_leg1+ExitStrike_buyleg1,&quot;&quot;);\nexitsymbol_buyleg2 = WriteIf(buycontinue OR sell,spot+expiry_leg2+opttype_buy_leg2+ExitStrike_buyleg2,&quot;&quot;);\nexitsymbol_shortleg1 = WriteIf(shortcontinue OR cover,spot+expiry_leg1+opttype_short_leg1+ExitStrike_shortleg1,&quot;&quot;);\nexitsymbol_shortleg2 = WriteIf(shortcontinue OR cover,spot+expiry_leg2+opttype_short_leg2+ExitStrike_shortleg2,&quot;&quot;);\n\n}\n\nelse\n{\nexitsymbol_buyleg1 = WriteIf(buycontinue OR sell,spot+expiry_leg1+ExitStrike_buyleg1+opttype_buyleg1,&quot;&quot;);\nexitsymbol_buyleg2 = WriteIf(buycontinue OR sell,spot+expiry_leg2+ExitStrike_buyleg2+opttype_buyleg2,&quot;&quot;);\nexitsymbol_shortleg1 = WriteIf(shortcontinue OR cover,spot+expiry_leg1+ExitStrike_shortleg1+opttype_shortleg1,&quot;&quot;);\nexitsymbol_shortleg2 = WriteIf(shortcontinue OR cover,spot+expiry_leg2+ExitStrike_shortleg2+opttype_shortleg2,&quot;&quot;);\n}\n\n\n\n\n\nprintf(&quot;\\n\\n\\nLeg1 Symbol(Buy) : &quot;+exitsymbol_buyleg1);\nprintf(&quot;\\nLeg2 Symbol(Buy) : &quot;+exitsymbol_buyleg2);\n\nprintf(&quot;\\n\\n\\nLeg1 Symbol(Short) : &quot;+exitsymbol_shortleg1);\nprintf(&quot;\\nLeg2 Symbol(Short) : &quot;+exitsymbol_shortleg2);\n\n\n\n_SECTION_END();\n\n\n\n\n\/\/Buy and Sell Order Functions\n\/\/signaltype = &quot;buy&quot; OR &quot;short\n\/\/leg = &quot;leg1&quot;,&quot;leg2&quot;\nfunction Placeorder(action,OptionType,orderqty,expiry,signaltype,leg)\n{\n\/\/strike_buyleg1\t\n    algomojo=CreateObject(&quot;AMAMIBRIDGE.Main&quot;);\n    \n    if(broker==&quot;tc&quot; OR broker==&quot;fs&quot; )\n\t{\n\t\tif(OptionType==&quot;CE&quot;) OptType = &quot;C&quot;;\n\t\tif(OptionType==&quot;PE&quot;) OptType = &quot;P&quot;;\n\t\ttradingsymbol = spot+expiry+OptType+VarGetText(&quot;strike_&quot;+signaltype+leg);\n    }\n    else\n\t{\n\t\ttradingsymbol = spot+expiry+VarGetText(&quot;strike_&quot;+signaltype+leg)+OptionType;\n    }\n    api_data = &quot;{ \\&quot;broker\\&quot;: \\&quot;&quot;+broker+&quot;\\&quot;,\n            \\&quot;strategy\\&quot;:\\&quot;&quot;+strategy+&quot;\\&quot;,\n            \\&quot;exchange\\&quot;:\\&quot;&quot;+exchange+&quot;\\&quot;,\n            \\&quot;symbol\\&quot;:\\&quot;&quot;+tradingsymbol+&quot;\\&quot;,\n            \\&quot;action\\&quot;:\\&quot;&quot;+action+&quot;\\&quot;,\n            \\&quot;product\\&quot;:\\&quot;&quot;+product+&quot;\\&quot;,\n            \\&quot;pricetype\\&quot;:\\&quot;&quot;+pricetype+&quot;\\&quot;,\n            \\&quot;quantity\\&quot;:\\&quot;&quot;+orderqty+&quot;\\&quot;,\n            \\&quot;price\\&quot;:\\&quot;&quot;+price+&quot;\\&quot;,      \n            \\&quot;disclosed_quantity\\&quot;:\\&quot;&quot;+disclosed_quantity+&quot;\\&quot;,\n            \\&quot;trigger_price\\&quot;:\\&quot;&quot;+trigger_price+&quot;\\&quot;,\n            \\&quot;amo\\&quot;:\\&quot;&quot;+amo+&quot;\\&quot;,\n            \\&quot;splitorder\\&quot;:\\&quot;&quot;+splitorder+&quot;\\&quot;,\n            \\&quot;split_quantity\\&quot;:\\&quot;&quot;+split_quantity+&quot;\\&quot;\n          \n        }&quot;; \n    _TRACE(&quot;Signal Type&quot;+signaltype+&quot; Option Leg : &quot;+leg);\n    _TRACE(&quot;API Request&quot;+api_data);\n    resp=algomojo.AMDispatcher(apikey, apisecret,&quot;PlaceOrder&quot;,api_data,&quot;am&quot;,ver);\n    _TRACE(&quot;API Response : &quot;+resp);\n    \n    if(VoiceAlert == &quot;Enable&quot;)\n\tSay( &quot;Order Placed&quot; ); \n}\n\n\/\/Squareoff Function to Exit Open Positions\n\n\/\/signaltype = &quot;buy&quot; OR &quot;short\n\/\/leg = &quot;leg1&quot;,&quot;leg2&quot;\n\nfunction ExitOrder(action,OptionType,expiry,signaltype,leg)\n{\n\n\n algomojo=CreateObject(&quot;AMAMIBRIDGE.Main&quot;);\n\/\/exitsymbol_buyleg1\nif(broker==&quot;tc&quot; or broker==&quot;fs&quot;)\n{\n\tif(OptionType==&quot;CE&quot;) OptType = &quot;C&quot;;\n\tif(OptionType==&quot;PE&quot;) OptType = &quot;P&quot;;\n\t\t\t\t\t\/\/spot+expiry+OptType+VarGetText(&quot;strike_&quot;+signaltype+leg);\n\ttradingsymbol = VarGetText(&quot;exitsymbol_&quot;+signaltype+leg);\n}\n\nelse\n{\n\ttradingsymbol = VarGetText(&quot;exitsymbol_&quot;+signaltype+leg);\n}\n\napi_data = &quot;{ \\&quot;broker\\&quot;: \\&quot;&quot;+broker+&quot;\\&quot;,\n            \\&quot;strategy\\&quot;:\\&quot;&quot;+strategy+&quot;\\&quot;,\n            \\&quot;exchange\\&quot;:\\&quot;&quot;+exchange+&quot;\\&quot;,\n            \\&quot;symbol\\&quot;:\\&quot;&quot;+tradingsymbol+&quot;\\&quot;,\n            \\&quot;action\\&quot;:\\&quot;&quot;+action+&quot;\\&quot;,\n            \\&quot;product\\&quot;:\\&quot;&quot;+product+&quot;\\&quot;,\n            \\&quot;pricetype\\&quot;:\\&quot;&quot;+pricetype+&quot;\\&quot;,\n            \\&quot;quantity\\&quot;:\\&quot;&quot;+&quot;0&quot;+&quot;\\&quot;,\n            \\&quot;price\\&quot;:\\&quot;&quot;+price+&quot;\\&quot;,\n            \\&quot;position_size\\&quot;:\\&quot;&quot;+&quot;0&quot;+&quot;\\&quot;,            \n            \\&quot;disclosed_quantity\\&quot;:\\&quot;&quot;+disclosed_quantity+&quot;\\&quot;,\n            \\&quot;trigger_price\\&quot;:\\&quot;&quot;+trigger_price+&quot;\\&quot;,\n            \\&quot;amo\\&quot;:\\&quot;&quot;+amo+&quot;\\&quot;,\n            \\&quot;splitorder\\&quot;:\\&quot;&quot;+splitorder+&quot;\\&quot;,\n            \\&quot;split_quantity\\&quot;:\\&quot;&quot;+split_quantity+&quot;\\&quot;\n          \n        }&quot;; \n\n_TRACE(&quot;Signal Type&quot;+signaltype+&quot; Option Leg : &quot;+leg);\n_TRACE(&quot;Broker API Request&quot;+api_data);\nresp=algomojo.AMDispatcher(apikey, apisecret,&quot;PlaceSmartOrder&quot;,api_data,&quot;am&quot;,ver);\n\n_TRACE(&quot;API Response : &quot;+resp);\n\nif(VoiceAlert == &quot;Enable&quot;)\n\tSay( &quot;Order Placed&quot; );\n\nreturn resp;\n\n}\n\n\n\nif(EnableAlgo != &quot;Disable&quot;)\n    {\n        lasttime = StrFormat(&quot;%0.f&quot;,LastValue(BarIndex()));\n        \n        SetChartBkColor(colorDarkGrey);\n        if(EnableAlgo == &quot;Enable&quot;)\n        {   \n            if (AlgoBuy==True AND AlgoCover == True AND StaticVarGet(static_name_+&quot;buyCoverAlgo&quot;)==0 AND StaticVarGetText(static_name_+&quot;buyCoverAlgo_barvalue&quot;) != lasttime )\n            {\n            \n\t\/\/ExitOrder(action,OptionType,orderqty,position_size,expiry,signaltype,leg)\n\t\/\/leg = &quot;leg1&quot;,&quot;leg2&quot;\n\t\t\t\t\n\t\t\t\t\/\/Cover Signal\n\t\t\t\tif(tradetype_shortleg1==&quot;SELL&quot;)\n\t\t\t\t{\n\t\t\t\tExitOrder(tradetype_shortleg1,opttype_shortleg1,expiry_leg1,&quot;short&quot;,&quot;leg1&quot;); \n\t\t\t\tExitOrder(tradetype_shortleg2,opttype_shortleg2,expiry_leg2,&quot;short&quot;,&quot;leg2&quot;); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tExitOrder(tradetype_shortleg2,opttype_shortleg2,expiry_leg2,&quot;short&quot;,&quot;leg2&quot;);\n\t\t\t\tExitOrder(tradetype_shortleg1,opttype_shortleg1,expiry_leg1,&quot;short&quot;,&quot;leg1&quot;);  \n\t\t\t\t}\n\t\t\t\t\/\/Buy Signal\n\t\t\t\tif(tradetype_buyleg1==&quot;BUY&quot;)\n\t\t\t\t{\n\t\t\t\tPlaceOrder(tradetype_buyleg1,opttype_buyleg1,quantity_leg1,expiry_leg1,&quot;buy&quot;,&quot;leg1&quot;);\n\t\t\t\tPlaceOrder(tradetype_buyleg2,opttype_buyleg2,quantity_leg2,expiry_leg2,&quot;buy&quot;,&quot;leg2&quot;);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tPlaceOrder(tradetype_buyleg2,opttype_buyleg2,quantity_leg2,expiry_leg2,&quot;buy&quot;,&quot;leg2&quot;);\n\t\t\t\tPlaceOrder(tradetype_buyleg1,opttype_buyleg1,quantity_leg1,expiry_leg1,&quot;buy&quot;,&quot;leg1&quot;);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n                StaticVarSetText(static_name_+&quot;buyCoverAlgo_barvalue&quot;,lasttime);  \n                StaticVarSet(static_name_+&quot;buyCoverAlgo&quot;,1); \/\/Algo Order was triggered, no more order on this bar\n                \n        \n            }\n            else if ((AlgoBuy != True OR AlgoCover != True))\n            {   \n                StaticVarSet(static_name_+&quot;buyCoverAlgo&quot;,0);\n                StaticVarSetText(static_name_+&quot;buyCoverAlgo_barvalue&quot;,&quot;&quot;);\n            }\n            \n            if (AlgoBuy==True AND AlgoCover != True AND StaticVarGet(static_name_+&quot;buyAlgo&quot;)==0 AND StaticVarGetText(static_name_+&quot;buyAlgo_barvalue&quot;) != lasttime)\n            {\n\t\t\t\t\n\t\t\t\t\/\/Buy Signal\n\t\t\t\tif(tradetype_buyleg1==&quot;BUY&quot;)\n\t\t\t\t{\n\t\t\t\tPlaceOrder(tradetype_buyleg1,opttype_buyleg1,quantity_leg1,expiry_leg1,&quot;buy&quot;,&quot;leg1&quot;);\n\t\t\t\tPlaceOrder(tradetype_buyleg2,opttype_buyleg2,quantity_leg2,expiry_leg2,&quot;buy&quot;,&quot;leg2&quot;);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tPlaceOrder(tradetype_buyleg2,opttype_buyleg2,quantity_leg2,expiry_leg2,&quot;buy&quot;,&quot;leg2&quot;);\n\t\t\t\tPlaceOrder(tradetype_buyleg1,opttype_buyleg1,quantity_leg1,expiry_leg1,&quot;buy&quot;,&quot;leg1&quot;);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n                StaticVarSetText(static_name_+&quot;buyAlgo_barvalue&quot;,lasttime); \n                StaticVarSet(static_name_+&quot;buyAlgo&quot;,1); \/\/Algo Order was triggered, no more order on this bar\n                \n            }\n            else if (AlgoBuy != True)\n            {   \n                StaticVarSet(static_name_+&quot;buyAlgo&quot;,0);\n                StaticVarSetText(static_name_+&quot;buyAlgo_barvalue&quot;,&quot;&quot;);\n                \n            }\n            if (AlgoSell==true AND AlgoShort != True AND StaticVarGet(static_name_+&quot;sellAlgo&quot;)==0 AND StaticVarGetText(static_name_+&quot;sellAlgo_barvalue&quot;) != lasttime)\n            {     \n\t\t\t\t\/\/Sell Signal\n\t\t\t\tif(tradetype_buyleg1==&quot;SELL&quot;)\n\t\t\t\t{\n\t\t\t\tExitOrder(tradetype_buyleg1,opttype_buyleg1,expiry_leg1,&quot;buy&quot;,&quot;leg1&quot;); \n\t\t\t\tExitOrder(tradetype_buyleg2,opttype_buyleg2,expiry_leg2,&quot;buy&quot;,&quot;leg2&quot;); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tExitOrder(tradetype_buyleg2,opttype_buyleg2,expiry_leg2,&quot;buy&quot;,&quot;leg2&quot;);\n\t\t\t\tExitOrder(tradetype_buyleg1,opttype_buyleg1,expiry_leg1,&quot;buy&quot;,&quot;leg1&quot;);  \n\t\t\t\t}\n                \n                StaticVarSetText(static_name_+&quot;sellAlgo_barvalue&quot;,lasttime);\n                StaticVarSet(static_name_+&quot;sellAlgo&quot;,1); \/\/Algo Order was triggered, no more order on this bar\n                \n            }\n            else if (AlgoSell != True )\n            {   \n                StaticVarSet(static_name_+&quot;sellAlgo&quot;,0);\n                StaticVarSetText(static_name_+&quot;sellAlgo_barvalue&quot;,&quot;&quot;);\n            }\n            if (AlgoShort==True AND AlgoSell==True AND  StaticVarGet(static_name_+&quot;ShortSellAlgo&quot;)==0 AND StaticVarGetText(static_name_+&quot;ShortSellAlgo_barvalue&quot;) != lasttime)\n            {\n\t\t\t\t\/\/Sell Signal\n\t\t\t\tif(tradetype_buyleg1==&quot;SELL&quot;)\n\t\t\t\t{\n\t\t\t\tExitOrder(tradetype_buyleg1,opttype_buyleg1,expiry_leg1,&quot;buy&quot;,&quot;leg1&quot;); \n\t\t\t\tExitOrder(tradetype_buyleg2,opttype_buyleg2,expiry_leg2,&quot;buy&quot;,&quot;leg2&quot;); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tExitOrder(tradetype_buyleg2,opttype_buyleg2,expiry_leg2,&quot;buy&quot;,&quot;leg2&quot;);\n\t\t\t\tExitOrder(tradetype_buyleg1,opttype_buyleg1,expiry_leg1,&quot;buy&quot;,&quot;leg1&quot;);  \n\t\t\t\t}\n\t\t\t\t\/\/Short\n\t\t\t\tif(tradetype_shortleg1==&quot;BUY&quot;)\n\t\t\t\t{\n\t\t\t\tPlaceOrder(tradetype_shortleg1,opttype_shortleg1,quantity_leg1,expiry_leg1,&quot;short&quot;,&quot;leg1&quot;);\n\t\t\t\tPlaceOrder(tradetype_shortleg2,opttype_shortleg2,quantity_leg2,expiry_leg2,&quot;short&quot;,&quot;leg2&quot;);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tPlaceOrder(tradetype_shortleg2,opttype_shortleg2,quantity_leg2,expiry_leg2,&quot;short&quot;,&quot;leg2&quot;);\n\t\t\t\tPlaceOrder(tradetype_shortleg1,opttype_shortleg1,quantity_leg1,expiry_leg1,&quot;short&quot;,&quot;leg1&quot;);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n                StaticVarSetText(static_name_+&quot;ShortsellAlgo_barvalue&quot;,lasttime);\n                StaticVarSet(static_name_+&quot;ShortSellAlgo&quot;,1); \/\/Algo Order was triggered, no more order on this bar\n                \n            }\n            else if ((AlgoShort != True OR AlgoSell != True))\n            {   \n                StaticVarSet(static_name_+&quot;ShortSellAlgo&quot;,0);\n                StaticVarSetText(static_name_+&quot;ShortsellAlgo_barvalue&quot;,&quot;&quot;);\n            }\n                \n            if (AlgoShort==True  AND  AlgoSell != True AND StaticVarGet(static_name_+&quot;ShortAlgo&quot;)==0 AND  StaticVarGetText(static_name_+&quot;ShortAlgo_barvalue&quot;) != lasttime)\n            {\n\t\t\t\t\/\/Short\n\t\t\t\tif(tradetype_shortleg1==&quot;BUY&quot;)\n\t\t\t\t{\n\t\t\t\tPlaceOrder(tradetype_shortleg1,opttype_shortleg1,quantity_leg1,expiry_leg1,&quot;short&quot;,&quot;leg1&quot;);\n\t\t\t\tPlaceOrder(tradetype_shortleg2,opttype_shortleg2,quantity_leg2,expiry_leg2,&quot;short&quot;,&quot;leg2&quot;);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tPlaceOrder(tradetype_shortleg2,opttype_shortleg2,quantity_leg2,expiry_leg2,&quot;short&quot;,&quot;leg2&quot;);\n\t\t\t\tPlaceOrder(tradetype_shortleg1,opttype_shortleg1,quantity_leg1,expiry_leg1,&quot;short&quot;,&quot;leg1&quot;);\n\t\t\t\t}\n\t\t\t\t\n                StaticVarSetText(static_name_+&quot;ShortAlgo_barvalue&quot;,lasttime); \n                StaticVarSet(static_name_+&quot;ShortAlgo&quot;,1); \/\/Algo Order was triggered, no more order on this bar\n                \n            }\n            else if (AlgoShort != True )\n            {   \n                StaticVarSet(static_name_+&quot;ShortAlgo&quot;,0);\n                StaticVarSetText(static_name_+&quot;ShortAlgo_barvalue&quot;,&quot;&quot;);\n            }\n            if (AlgoCover==true AND AlgoBuy != True AND StaticVarGet(static_name_+&quot;CoverAlgo&quot;)==0 AND StaticVarGetText(static_name_+&quot;CoverAlgo_barvalue&quot;) != lasttime)\n            {\n\t\t\t\t\n\t\t\t\t\/\/Cover Signal\n\t\t\t\tif(tradetype_shortleg1==&quot;SELL&quot;)\n\t\t\t\t{\n\t\t\t\tExitOrder(tradetype_shortleg1,opttype_shortleg1,expiry_leg1,&quot;short&quot;,&quot;leg1&quot;); \n\t\t\t\tExitOrder(tradetype_shortleg2,opttype_shortleg2,expiry_leg2,&quot;short&quot;,&quot;leg2&quot;); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tExitOrder(tradetype_shortleg2,opttype_shortleg2,expiry_leg2,&quot;short&quot;,&quot;leg2&quot;);\n\t\t\t\tExitOrder(tradetype_shortleg1,opttype_shortleg1,expiry_leg1,&quot;short&quot;,&quot;leg1&quot;);  \n\t\t\t\t}\n               \n                StaticVarSetText(static_name_+&quot;CoverAlgo_barvalue&quot;,lasttime); \n                StaticVarSet(static_name_+&quot;CoverAlgo&quot;,1); \/\/Algo Order was triggered, no more order on this bar\n                \n            }\n            else if (AlgoCover != True )\n            {   \n                StaticVarSet(static_name_+&quot;CoverAlgo&quot;,0);\n                StaticVarSetText(static_name_+&quot;CoverAlgo_barvalue&quot;,&quot;&quot;);\n            }\n        }\n        \n      else if(EnableAlgo == &quot;LongOnly&quot;)\n        {\n        \n\t\t\t if (AlgoBuy==True AND StaticVarGet(static_name_+&quot;buyAlgo&quot;)==0 AND StaticVarGetText(static_name_+&quot;buyAlgo_barvalue&quot;) != lasttime)\n            {\n            \n\t\t\t\t\/\/Buy Signal\n\t\t\t\tif(tradetype_buyleg1==&quot;BUY&quot;)\n\t\t\t\t{\n\t\t\t\tPlaceOrder(tradetype_buyleg1,opttype_buyleg1,quantity_leg1,expiry_leg1,&quot;buy&quot;,&quot;leg1&quot;);\n\t\t\t\tPlaceOrder(tradetype_buyleg2,opttype_buyleg2,quantity_leg2,expiry_leg2,&quot;buy&quot;,&quot;leg2&quot;);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tPlaceOrder(tradetype_buyleg2,opttype_buyleg2,quantity_leg2,expiry_leg2,&quot;buy&quot;,&quot;leg2&quot;);\n\t\t\t\tPlaceOrder(tradetype_buyleg1,opttype_buyleg1,quantity_leg1,expiry_leg1,&quot;buy&quot;,&quot;leg1&quot;);\n\t\t\t\t}\n\t\t\t\t\n                StaticVarSetText(static_name_+&quot;buyAlgo_barvalue&quot;,lasttime);\n                StaticVarSet(static_name_+&quot;buyAlgo&quot;,1); \/\/Algo Order was triggered, no more order on this bar\n                \n            }\n            \n            \n            else if (AlgoBuy != True )\n            {  \n                StaticVarSet(static_name_+&quot;buyAlgo&quot;,0);\n                StaticVarSetText(static_name_+&quot;buyAlgo_barvalue&quot;,&quot;&quot;);\n            \n            }\n            \n             if (AlgoSell==True AND StaticVarGet(static_name_+&quot;sellAlgo&quot;)==0 AND StaticVarGetText(static_name_+&quot;sellAlgo_barvalue&quot;) != lasttime)\n            { \n            \n\t\t\t\t\/\/Sell Signal\n\t\t\t\tif(tradetype_buyleg1==&quot;SELL&quot;)\n\t\t\t\t{\n\t\t\t\tExitOrder(tradetype_buyleg1,opttype_buyleg1,expiry_leg1,&quot;buy&quot;,&quot;leg1&quot;); \n\t\t\t\tExitOrder(tradetype_buyleg2,opttype_buyleg2,expiry_leg2,&quot;buy&quot;,&quot;leg2&quot;); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tExitOrder(tradetype_buyleg2,opttype_buyleg2,expiry_leg2,&quot;buy&quot;,&quot;leg2&quot;);\n\t\t\t\tExitOrder(tradetype_buyleg1,opttype_buyleg1,expiry_leg1,&quot;buy&quot;,&quot;leg1&quot;);  \n\t\t\t\t}\n\t\t\t\t\n                StaticVarSet(static_name_+&quot;sellAlgo&quot;,1);\n                StaticVarSetText(static_name_+&quot;sellAlgo_barvalue&quot;,lasttime);\n            }\n            else if (AlgoSell != True )\n            {  \n                StaticVarSet(static_name_+&quot;sellAlgo&quot;,0);\n                StaticVarSetText(static_name_+&quot;sellAlgo_barvalue&quot;,&quot;&quot;);\n            \n            }\n            \n        } \n        else if(EnableAlgo == &quot;ShortOnly&quot;)\n        {\n            if (AlgoShort==True AND StaticVarGet(static_name_+&quot;ShortAlgo&quot;)==0 AND StaticVarGetText(static_name_+&quot;ShortAlgo_barvalue&quot;) != lasttime)\n            {\n\t\t\t\t\/\/Short\n\t\t\t\tif(tradetype_shortleg1==&quot;BUY&quot;)\n\t\t\t\t{\n\t\t\t\tPlaceOrder(tradetype_shortleg1,opttype_shortleg1,quantity_leg1,expiry_leg1,&quot;short&quot;,&quot;leg1&quot;);\n\t\t\t\tPlaceOrder(tradetype_shortleg2,opttype_shortleg2,quantity_leg2,expiry_leg2,&quot;short&quot;,&quot;leg2&quot;);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tPlaceOrder(tradetype_shortleg2,opttype_shortleg2,quantity_leg2,expiry_leg2,&quot;short&quot;,&quot;leg2&quot;);\n\t\t\t\tPlaceOrder(tradetype_shortleg1,opttype_shortleg1,quantity_leg1,expiry_leg1,&quot;short&quot;,&quot;leg1&quot;);\n\t\t\t\t}\n\t\t\t\t\n                StaticVarSetText(static_name_+&quot;ShortAlgo_barvalue&quot;,lasttime); \n                StaticVarSet(static_name_+&quot;ShortAlgo&quot;,1); \/\/Algo Order was triggered, no more order on this bar\n                \n            }\n            else if (AlgoShort != True )\n            {   \n                StaticVarSet(static_name_+&quot;ShortAlgo&quot;,0);\n                StaticVarSetText(static_name_+&quot;ShortAlgo_barvalue&quot;,&quot;&quot;);\n            }\n            if (AlgoCover==true AND StaticVarGet(static_name_+&quot;CoverAlgo&quot;)==0 AND StaticVarGetText(static_name_+&quot;CoverAlgo_barvalue&quot;) != lasttime)\n            {\n            \n\t\t\t\t\/\/Cover Signal\n\t\t\t\tif(tradetype_shortleg1==&quot;SELL&quot;)\n\t\t\t\t{\n\t\t\t\tExitOrder(tradetype_shortleg1,opttype_shortleg1,expiry_leg1,&quot;short&quot;,&quot;leg1&quot;); \n\t\t\t\tExitOrder(tradetype_shortleg2,opttype_shortleg2,expiry_leg2,&quot;short&quot;,&quot;leg2&quot;); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tExitOrder(tradetype_shortleg2,opttype_shortleg2,expiry_leg2,&quot;short&quot;,&quot;leg2&quot;);\n\t\t\t\tExitOrder(tradetype_shortleg1,opttype_shortleg1,expiry_leg1,&quot;short&quot;,&quot;leg1&quot;);  \n\t\t\t\t}\n               \n                StaticVarSetText(static_name_+&quot;CoverAlgo_barvalue&quot;,lasttime); \n                StaticVarSet(static_name_+&quot;CoverAlgo&quot;,1); \/\/Algo Order was triggered, no more order on this bar\n                \n            }\n            else if (AlgoCover != True)\n            {   \n                StaticVarSet(static_name_+&quot;CoverAlgo&quot;,0);\n                StaticVarSetText(static_name_+&quot;CoverAlgo_barvalue&quot;,&quot;&quot;);\n            }\n        } \n        \n    }\n    \n  \n_SECTION_END();<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Thought of making an open-source Tradingview Pinescript code demanded by most of the option traders to control the cost, control the risk, and configure the two-legged option trading strategy of their choice with slicing larger orders feature. So here is a two-legged options execution Tradingview module for the Algomojo trading platform where users can configure modules on top of their own trading logic to convert any spot\/futures signals into 9 types of two-legged options execution modules.<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[15,91],"tags":[207,208,209,44,205,119,212,211,143,206,213,214,210,33,169],"_links":{"self":[{"href":"https:\/\/algomojo.com\/blog\/wp-json\/wp\/v2\/posts\/506"}],"collection":[{"href":"https:\/\/algomojo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/algomojo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/algomojo.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/algomojo.com\/blog\/wp-json\/wp\/v2\/comments?post=506"}],"version-history":[{"count":4,"href":"https:\/\/algomojo.com\/blog\/wp-json\/wp\/v2\/posts\/506\/revisions"}],"predecessor-version":[{"id":635,"href":"https:\/\/algomojo.com\/blog\/wp-json\/wp\/v2\/posts\/506\/revisions\/635"}],"wp:attachment":[{"href":"https:\/\/algomojo.com\/blog\/wp-json\/wp\/v2\/media?parent=506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/algomojo.com\/blog\/wp-json\/wp\/v2\/categories?post=506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/algomojo.com\/blog\/wp-json\/wp\/v2\/tags?post=506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}