{"id":85696,"date":"2021-04-29T11:52:00","date_gmt":"2021-04-29T15:52:00","guid":{"rendered":"https:\/\/ibkrcampus.com\/?p=85696"},"modified":"2025-02-12T16:43:58","modified_gmt":"2025-02-12T21:43:58","slug":"how-to-code-an-ib-algo-order-in-the-web-api","status":"publish","type":"post","link":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-code-an-ib-algo-order-in-the-web-api\/","title":{"rendered":"How to Code an IB Algo Order in the Web API"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1000\" height=\"563\" data-src=\"\/campus\/wp-content\/uploads\/sites\/2\/2021\/04\/api-tech-button-1.jpg\" alt=\"API\" class=\"wp-image-85704 lazyload\" data-srcset=\"https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/04\/api-tech-button-1.jpg 1000w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/04\/api-tech-button-1-700x394.jpg 700w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/04\/api-tech-button-1-300x169.jpg 300w, https:\/\/ibkrcampus.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/04\/api-tech-button-1-768x432.jpg 768w\" data-sizes=\"(max-width: 1000px) 100vw, 1000px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1000px; aspect-ratio: 1000\/563;\" \/><\/figure>\n\n\n\n<p>Interactive Brokers offers several algorithmic order types that are designed to include user-defined settings to your trades. The endpoint&nbsp;<strong>\/iserver\/contract\/{conid}\/algos&nbsp;<\/strong>can be used to identify the available strategies for a given contract.<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#e4eee5\"><strong>GET&nbsp; \/iserver\/contract\/{conid}\/algos<\/strong><\/p>\n\n\n\n<p><strong>Request inline:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><p style=\"font-size:12px\">String \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 addDescription \u00a0\u00a0\u00a0\u00a0\u00a0 Whether or not to add algo description to response. Set to 1 for yes, 0 for no\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 required: false<\/p><\/li>\n\n\n\n<li><p style=\"font-size:12px\">String\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 addParams\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Whether or not to show algo parameters. Set to 1 for yes, 0 for no\u00a0\u00a0\u00a0\u00a0       \u00a0\u00a0     \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0required: false<\/p><\/li>\n\n\n\n<li><p style=\"font-size:12px\">String\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 algos\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 List of algo ids delimited by \u201c;\u201d to filter by. Max of 8 algo ids can be specified.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 required: false<\/p><\/li>\n<\/ul>\n\n\n\n<p><strong>Response:<\/strong><\/p>\n\n\n\n<p><\/p>\n\n\n\n<ul><li><p style=\"font-size:12px\">Returns an array of algos<\/p><ul><li><p style=\"font-size:12px\">string&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp;<\/p><\/li><li><p style=\"font-size:12px\">string&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; description<\/p><\/li><li><p style=\"font-size:12px\">string&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id<\/p><\/li><li><p style=\"font-size:12px\">string&nbsp;&nbsp;&nbsp; parameters<\/p>\n<ul><li><p style=\"font-size:12px\">string&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The algo parameter<\/p><\/li><li><p style=\"font-size:12px\">boolean&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; required&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If true a value must be entered<\/li><li><p style=\"font-size:12px\">string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Descriptive name of the parameter<\/p><\/li><li><p style=\"font-size:12px\">string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; valueClassName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Format of the parameter, Enum: double, string, time, Boolean<\/p><\/li><li><p style=\"font-size:12px\">number&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; minValue&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Smallest value, only applies to parameters with valueClassName=Double<\/p><\/li><li><p style=\"font-size:12px\">number&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; maxValue&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Largest value, only applies to parameters with valueClassnName=Double<\/p><\/li><li><p style=\"font-size:12px\">boolean&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; defaultValue&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; User configured preset for this parameter<\/p><\/li><li><p style=\"font-size:12px\">string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; legalStrings&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The list of choices, example: \u201cALL:Get Done\u201d, \u201cALL:Aggressive\u201d, \u201cALL:Neutral\u201d, \u201cALL:Passive\u201d<\/p><\/li><li><p style=\"font-size:12px\">string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Detailed description of the parameter.<\/p><\/li><li><p style=\"font-size:12px\">number &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; guiRank&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The order in the UI, used when building dynamic UI so that more important parameter are presented first.<\/p><\/li><li><p style=\"font-size:12px\">boolean&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; priceMarketRule&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If true, must specify parameter using market rule format. Only applies to parameters with valueClassName=Double<\/p><\/li><li><p style=\"font-size:12px\">string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; enabledConditions&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The rules that UI should apply to algo parameters depending on chosen order type, Enum: MKT:speedup=:no, LMT:strategyType:&lt;&gt;:empty, MKT:strategyType:=:Marketable<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<strong>MKT:speedup=:no<\/strong>&nbsp;&nbsp;&#8211; &nbsp;hide SpeedUp param when MKT is chosen for order type.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<strong>LMT:strategyType:&lt;&gt;:empty<\/strong>&nbsp; &#8211;&nbsp; strategyType param cannot be empty when LMT is chosen for order type.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>MKT:strategyType:=:Marketable<\/strong>&nbsp; &#8211;&nbsp; set strategyType parm to Marketable and disable (no other choice) when MKT is chosen for order type.<\/p><\/li><\/ul><\/li><\/ul><\/li><\/ul>\n\n\n\n<p>First we\u2019ll send the endpoint \/algos for the corresponding conid to receive a list of all available algo names<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#a8efb3; font-size:11px\"><em>Please be sure to authenticate first in order to resolve the below URLs. <\/em><br><em>For authentication details, visit <a href=\"https:\/\/www.interactivebrokers.com\/en\/trading\/ib-api.php\">https:\/\/www.interactivebrokers.com\/en\/trading\/ib-api.php<\/a>.<\/em><\/p>\n\n\n\n<p>Request:<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#e4eee5\"><strong>GET&nbsp;https:\/\/localhost:5000\/v1\/api\/iserver\/contract\/8314\/algos<\/strong><\/p>\n\n\n\n<p>Response:<\/p>\n\n\n\n<p style=\"background-color:#fcfcdb;font-size:12px\" class=\"has-background\">\n{<br>\n  &nbsp;&nbsp;&nbsp;&#8220;algos&#8221;: [<br>\n    &nbsp;&nbsp;&nbsp;&nbsp;{<br>\n      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8220;name&#8221;: &#8220;Adaptive&#8221;,<br>\n      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8220;id&#8221;: &#8220;Adaptive&#8221;<br>\n    &nbsp;&nbsp;&nbsp;&nbsp;},<br>\n    &nbsp;&nbsp;&nbsp;&nbsp;{<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;Arrival Price&#8221;,<br>\n      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8220;id&#8221;: &#8220;ArrivalPx&#8221;<br>\n   &nbsp;&nbsp;&nbsp;&nbsp; },<br>\n    &nbsp;&nbsp;&nbsp;&nbsp;{<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;Close Price&#8221;,<br>\n      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8220;id&#8221;: &#8220;ClosePx&#8221;<br>\n   &nbsp;&nbsp;&nbsp;&nbsp; },<br>\n   &nbsp;&nbsp;&nbsp;&nbsp; {<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;DarkIce&#8221;,<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;id&#8221;: &#8220;DarkIce&#8221;<br>\n   &nbsp;&nbsp;&nbsp;&nbsp; },<br>\n   &nbsp;&nbsp;&nbsp;&nbsp; {<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;Percentage of Volume&#8221;,<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;id&#8221;: &#8220;PctVol&#8221;<br>\n    &nbsp;&nbsp;&nbsp;&nbsp;},<br>\n   &nbsp;&nbsp;&nbsp;&nbsp; {<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;Price Variant Percentage of Volume&#8221;,<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;id&#8221;: &#8220;PctVolPx&#8221;<br>\n   &nbsp;&nbsp;&nbsp;&nbsp; },<br>\n    &nbsp;&nbsp;&nbsp;&nbsp;{<br>\n      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8220;name&#8221;: &#8220;Size Variant Percentage of Volume&#8221;,<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;id&#8221;: &#8220;PctVolSz&#8221;<br>\n   &nbsp;&nbsp;&nbsp;&nbsp; },<br>\n    &nbsp;&nbsp;&nbsp;&nbsp;{<br>\n    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &#8220;name&#8221;: &#8220;TWAP&#8221;,<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;id&#8221;: &#8220;Twap&#8221;<br>\n   &nbsp;&nbsp;&nbsp;&nbsp; },<br>\n   &nbsp;&nbsp;&nbsp;&nbsp; {<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;Time Variant Percentage of Volume&#8221;,<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;id&#8221;: &#8220;PctVolTm&#8221;<br>\n   &nbsp;&nbsp;&nbsp;&nbsp; },<br>\n   &nbsp;&nbsp;&nbsp;&nbsp; {<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;VWAP&#8221;,<br>\n      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8220;id&#8221;: &#8220;Vwap&#8221;<br>\n   &nbsp;&nbsp;&nbsp;&nbsp; }<br>\n  &nbsp;&nbsp;&nbsp;]<br>\n}\n\n<\/p>\n\n\n\n<p>Now that we know the available algo strategies we\u2019ll send the endpoint \/algos again with additional parameters inline:<\/p>\n\n\n\n<p>Request:<\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#e4eee5\"><strong>GET&nbsp;https:\/\/localhost:5000\/v1\/api\/iserver\/contract\/8314\/algos?addDescription=1&amp;addParams=1&amp;algos=PctVolTm<\/strong><\/p>\n\n\n\n<p>Response:<\/p>\n\n\n\n<p style=\"background-color:#fcfcdb;font-size:12px\" class=\"has-background\">\n{<br><br>\n\n  &nbsp;&#8220;algos&#8221;: [<br>\n  &nbsp;&nbsp;  {<br>\n     &nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;Time Variant Percentage of Volume&#8221;,<br>\n    &nbsp;&nbsp;&nbsp;  &#8220;description&#8221;: &#8220;Algo that lets you participate in volume at a user-defined rate that varies with time.&#8221;,<br>\n    &nbsp;&nbsp;&nbsp;  &#8220;id&#8221;: &#8220;PctVolTm&#8221;,<br>\n     &nbsp;&nbsp;&nbsp; &#8220;parameters&#8221;: [<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;{<br>\n          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8220;guiRank&#8221;: 5,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;defaultValue&#8221;: false,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;Attempt to never take liquidity&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;id&#8221;: &#8220;noTakeLiq&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;valueClassName&#8221;: &#8220;Boolean&#8221;<br>\n      &nbsp;&nbsp;&nbsp;&nbsp;  },<br>\n      &nbsp;&nbsp;&nbsp;&nbsp;  {<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;guiRank&#8221;: 1,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;minValue&#8221;: 0.01,<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &#8220;maxValue&#8221;: 50,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;Target Percentage at Start Time&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;description&#8221;: &#8220;from 0.01 to 50.0&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;id&#8221;: &#8220;startPctVol&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;required&#8221;: &#8220;true&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;valueClassName&#8221;: &#8220;Double&#8221;<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;},<br>\n       &nbsp;&nbsp;&nbsp;&nbsp; {<br>\n          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8220;guiRank&#8221;: 2,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;minValue&#8221;: 0.01,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;maxValue&#8221;: 50,<br>\n          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8220;name&#8221;: &#8220;Target Percentage at End Time&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;description&#8221;: &#8220;from 0.01 to 50.0&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;id&#8221;: &#8220;endPctVol&#8221;,<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &#8220;required&#8221;: &#8220;true&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;valueClassName&#8221;: &#8220;Double&#8221;<br>\n     &nbsp;&nbsp;&nbsp;&nbsp;   },<br>\n      &nbsp;&nbsp;&nbsp;&nbsp;  {<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &#8220;guiRank&#8221;: 6,<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &#8220;defaultValue&#8221;: false,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;Attempt to match block trading volume&#8221;,<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &#8220;id&#8221;: &#8220;includeBlockTrades&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;valueClassName&#8221;: &#8220;Boolean&#8221;<br>\n       &nbsp;&nbsp;&nbsp;&nbsp; },<br>\n       &nbsp;&nbsp;&nbsp;&nbsp; {<br>\n          &#8220;guiRank&#8221;: 7,<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &#8220;name&#8221;: &#8220;Trade when price is more aggressive than:&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;description&#8221;: &#8220;evaluates with bid for buy order and ask for sell order&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;id&#8221;: &#8220;conditionalPrice&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;valueClassName&#8221;: &#8220;Double&#8221;<br>\n      &nbsp;&nbsp;&nbsp;&nbsp;  },<br>\n       &nbsp;&nbsp;&nbsp;&nbsp; {<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;guiRank&#8221;: 3,<br>\n        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &#8220;name&#8221;: &#8220;Start Time&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;description&#8221;: &#8220;defaults to start of market trading&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;id&#8221;: &#8220;startTime&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;valueClassName&#8221;: &#8220;Time&#8221;<br>\n       &nbsp;&nbsp;&nbsp;&nbsp; },<br>\n       &nbsp;&nbsp;&nbsp;&nbsp; {<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;guiRank&#8221;: 4,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;name&#8221;: &#8220;End Time&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;description&#8221;: &#8220;defaults to end of market trading&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;id&#8221;: &#8220;endTime&#8221;,<br>\n         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8220;valueClassName&#8221;: &#8220;Time&#8221;<br>\n       &nbsp;&nbsp;&nbsp;&nbsp; }<br>\n    &nbsp;&nbsp;&nbsp;  ]<br>\n    &nbsp;&nbsp;}<br>\n &nbsp; ]<br>\n}<br>\n<\/p>\n\n\n\n<p>Now we can send the endpoint&nbsp;<strong>\/iserver\/account\/{accountId}\/orders<\/strong>&nbsp;with the included id of the algo&nbsp;<strong>strategy<\/strong>&nbsp;and the list of algo&nbsp;<strong>strategyParameters<\/strong><\/p>\n\n\n\n<p class=\"has-background\" style=\"background-color:#e4eee5\"><strong>POST<\/strong>&nbsp;https:\/\/localhost:5000\/v1\/api\/iserver\/account\/DU26214\/orders<\/p>\n\n\n\n<p>Payload Request:<\/p>\n\n\n\n<p style=\"background-color:#fcfcdb;font-size:12px\" class=\"has-background\">\nconid: 8314,<br>\n\nsecType: \u201c8314:STK\u201d,<br>\n\ncOId: \u201ctestAlgoOrder\u201d,<br>\n\norderType: \u201cLMT\u201d,<br>\n\nprice: 127,<br>\n\nside: \u201cBUY\u201d,<br>\n\ntif: \u201cDAY\u201d,<br>\n\nquantity: 1,<br>\n\nstrategy: \u201cPctVolTm\u201d<br>\n\nstrategyParameters: {<br>\n\nnoTakeLiq: false,<br>\n\nmonetaryValue: 200,<br>\n\nincludeBlockTrades: false,<br>\n\nconditionalPrice: 128,<br>\n\nstartTime: 20210412,<br>\n\nendTime: 20210413,<br>\n\nstartPctVol: 0.1,<br>\n\nendPctVol: 0.2<br>\n\n}\n<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>If you have any further questions or issues sending IB Algo Orders please reach out to the API Group, ref:&nbsp;<a href=\"https:\/\/www.interactivebrokers.com\/en\/index.php?f=47047\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.interactivebrokers.com\/en\/index.php?f=47047<\/a>.<\/p>\n\n\n\n<p>Visit the IBKR API Center for Downloads, Resources, and Technical Details:<br><a href=\"https:\/\/www.interactivebrokers.com\/en\/trading\/ib-api.php\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.interactivebrokers.com\/en\/trading\/ib-api.php<\/a>.<\/p>\n\n\n\n<p>See the previous installment in this series: <a href=\"\/campus\/ibkr-quant-news\/tutorial-web-api-connect-to-brokerage-session\/\">Tutorial: Web API \u2013 Connect to Brokerage Session<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will help you get started with Interactive Brokers&#8217; algorithmic order types that are designed to include user-defined settings to your trades.<\/p>\n","protected":false},"author":614,"featured_media":85700,"comment_status":"closed","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[340,343,338,350,341,351,352,344,2197,9763],"tags":[9640,9641,851,4086,865,575,9643,9642,9552],"contributors-categories":[13576],"class_list":{"0":"post-85696","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-api-development","8":"category-programing-languages","9":"category-ibkr-quant-news","10":"category-quant-asia-pacific","11":"category-quant-development","12":"category-quant-europe","13":"category-quant-north-america","14":"category-quant-regions","15":"category-quant-south-america","16":"category-rest-development","17":"tag-algo-order","18":"tag-algo-strategies","19":"tag-algo-trading","20":"tag-algos","21":"tag-github","22":"tag-ibkr-api","23":"tag-strategy-parameters","24":"tag-time-variant-percentage-of-volume","25":"tag-web-api","26":"contributors-categories-interactive-brokers"},"pp_statuses_selecting_workflow":false,"pp_workflow_action":"current","pp_status_selection":"publish","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Code an IB Algo Order in the Web API | IBKR Quant<\/title>\n<meta name=\"description\" content=\"This tutorial will help you get started with Interactive Brokers&#039; algorithmic order types that are designed to include user-defined settings to your...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/85696\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Code an IB Algo Order in the Web API | IBKR Quant Blog\" \/>\n<meta property=\"og:description\" content=\"This tutorial will help you get started with Interactive Brokers&#039; algorithmic order types that are designed to include user-defined settings to your trades.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-code-an-ib-algo-order-in-the-web-api\/\" \/>\n<meta property=\"og:site_name\" content=\"IBKR Campus US\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-29T15:52:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-12T21:43:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/04\/api-tech-button.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"IBKR API\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"IBKR API\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\n\t    \"@context\": \"https:\\\/\\\/schema.org\",\n\t    \"@graph\": [\n\t        {\n\t            \"@type\": \"NewsArticle\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/how-to-code-an-ib-algo-order-in-the-web-api\\\/#article\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/how-to-code-an-ib-algo-order-in-the-web-api\\\/\"\n\t            },\n\t            \"author\": {\n\t                \"name\": \"IBKR API\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/a70292c923c6262ec34ebe59e937f0cc\"\n\t            },\n\t            \"headline\": \"How to Code an IB Algo Order in the Web API\",\n\t            \"datePublished\": \"2021-04-29T15:52:00+00:00\",\n\t            \"dateModified\": \"2025-02-12T21:43:58+00:00\",\n\t            \"mainEntityOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/how-to-code-an-ib-algo-order-in-the-web-api\\\/\"\n\t            },\n\t            \"wordCount\": 1933,\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/how-to-code-an-ib-algo-order-in-the-web-api\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/04\\\/api-tech-button.jpg\",\n\t            \"keywords\": [\n\t                \"Algo Order\",\n\t                \"Algo Strategies\",\n\t                \"Algo Trading\",\n\t                \"algos\",\n\t                \"GitHub\",\n\t                \"IBKR API\",\n\t                \"Strategy Parameters\",\n\t                \"Time Variant Percentage of Volume\",\n\t                \"Web API\"\n\t            ],\n\t            \"articleSection\": [\n\t                \"IBKR API Development\",\n\t                \"Programming Languages\",\n\t                \"Quant\",\n\t                \"Quant Asia Pacific\",\n\t                \"Quant Development\",\n\t                \"Quant Europe\",\n\t                \"Quant North America\",\n\t                \"Quant Regions\",\n\t                \"Quant South America\",\n\t                \"REST Development\"\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"WebPage\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/how-to-code-an-ib-algo-order-in-the-web-api\\\/\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/how-to-code-an-ib-algo-order-in-the-web-api\\\/\",\n\t            \"name\": \"How to Code an IB Algo Order in the Web API | IBKR Quant Blog\",\n\t            \"isPartOf\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\"\n\t            },\n\t            \"primaryImageOfPage\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/how-to-code-an-ib-algo-order-in-the-web-api\\\/#primaryimage\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/how-to-code-an-ib-algo-order-in-the-web-api\\\/#primaryimage\"\n\t            },\n\t            \"thumbnailUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/04\\\/api-tech-button.jpg\",\n\t            \"datePublished\": \"2021-04-29T15:52:00+00:00\",\n\t            \"dateModified\": \"2025-02-12T21:43:58+00:00\",\n\t            \"description\": \"This tutorial will help you get started with Interactive Brokers' algorithmic order types that are designed to include user-defined settings to your trades.\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"ReadAction\",\n\t                    \"target\": [\n\t                        \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/how-to-code-an-ib-algo-order-in-the-web-api\\\/\"\n\t                    ]\n\t                }\n\t            ]\n\t        },\n\t        {\n\t            \"@type\": \"ImageObject\",\n\t            \"inLanguage\": \"en-US\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/ibkr-quant-news\\\/how-to-code-an-ib-algo-order-in-the-web-api\\\/#primaryimage\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/04\\\/api-tech-button.jpg\",\n\t            \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2021\\\/04\\\/api-tech-button.jpg\",\n\t            \"width\": 1000,\n\t            \"height\": 563,\n\t            \"caption\": \"API\"\n\t        },\n\t        {\n\t            \"@type\": \"WebSite\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#website\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"name\": \"IBKR Campus US\",\n\t            \"description\": \"Financial Education from Interactive Brokers\",\n\t            \"publisher\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\"\n\t            },\n\t            \"potentialAction\": [\n\t                {\n\t                    \"@type\": \"SearchAction\",\n\t                    \"target\": {\n\t                        \"@type\": \"EntryPoint\",\n\t                        \"urlTemplate\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/?s={search_term_string}\"\n\t                    },\n\t                    \"query-input\": {\n\t                        \"@type\": \"PropertyValueSpecification\",\n\t                        \"valueRequired\": true,\n\t                        \"valueName\": \"search_term_string\"\n\t                    }\n\t                }\n\t            ],\n\t            \"inLanguage\": \"en-US\"\n\t        },\n\t        {\n\t            \"@type\": \"Organization\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#organization\",\n\t            \"name\": \"Interactive Brokers\",\n\t            \"alternateName\": \"IBKR\",\n\t            \"url\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/\",\n\t            \"logo\": {\n\t                \"@type\": \"ImageObject\",\n\t                \"inLanguage\": \"en-US\",\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\",\n\t                \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"contentUrl\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/wp-content\\\/uploads\\\/sites\\\/2\\\/2024\\\/05\\\/ibkr-campus-logo.jpg\",\n\t                \"width\": 669,\n\t                \"height\": 669,\n\t                \"caption\": \"Interactive Brokers\"\n\t            },\n\t            \"image\": {\n\t                \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/logo\\\/image\\\/\"\n\t            },\n\t            \"publishingPrinciples\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/about-ibkr-campus\\\/\",\n\t            \"ethicsPolicy\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/cyber-security-notice\\\/\"\n\t        },\n\t        {\n\t            \"@type\": \"Person\",\n\t            \"@id\": \"https:\\\/\\\/ibkrcampus.com\\\/campus\\\/#\\\/schema\\\/person\\\/a70292c923c6262ec34ebe59e937f0cc\",\n\t            \"name\": \"IBKR API\",\n\t            \"url\": \"https:\\\/\\\/www.interactivebrokers.com\\\/campus\\\/author\\\/ibkrapi\\\/\"\n\t        }\n\t    ]\n\t}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Code an IB Algo Order in the Web API | IBKR Quant","description":"This tutorial will help you get started with Interactive Brokers' algorithmic order types that are designed to include user-defined settings to your...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.interactivebrokers.com\/campus\/wp-json\/wp\/v2\/posts\/85696\/","og_locale":"en_US","og_type":"article","og_title":"How to Code an IB Algo Order in the Web API | IBKR Quant Blog","og_description":"This tutorial will help you get started with Interactive Brokers' algorithmic order types that are designed to include user-defined settings to your trades.","og_url":"https:\/\/www.interactivebrokers.com\/campus\/ibkr-quant-news\/how-to-code-an-ib-algo-order-in-the-web-api\/","og_site_name":"IBKR Campus US","article_published_time":"2021-04-29T15:52:00+00:00","article_modified_time":"2025-02-12T21:43:58+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/04\/api-tech-button.jpg","type":"image\/jpeg"}],"author":"IBKR API","twitter_card":"summary_large_image","twitter_misc":{"Written by":"IBKR API","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/how-to-code-an-ib-algo-order-in-the-web-api\/#article","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/how-to-code-an-ib-algo-order-in-the-web-api\/"},"author":{"name":"IBKR API","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/a70292c923c6262ec34ebe59e937f0cc"},"headline":"How to Code an IB Algo Order in the Web API","datePublished":"2021-04-29T15:52:00+00:00","dateModified":"2025-02-12T21:43:58+00:00","mainEntityOfPage":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/how-to-code-an-ib-algo-order-in-the-web-api\/"},"wordCount":1933,"publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/how-to-code-an-ib-algo-order-in-the-web-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/04\/api-tech-button.jpg","keywords":["Algo Order","Algo Strategies","Algo Trading","algos","GitHub","IBKR API","Strategy Parameters","Time Variant Percentage of Volume","Web API"],"articleSection":["IBKR API Development","Programming Languages","Quant","Quant Asia Pacific","Quant Development","Quant Europe","Quant North America","Quant Regions","Quant South America","REST Development"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/how-to-code-an-ib-algo-order-in-the-web-api\/","url":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/how-to-code-an-ib-algo-order-in-the-web-api\/","name":"How to Code an IB Algo Order in the Web API | IBKR Quant Blog","isPartOf":{"@id":"https:\/\/ibkrcampus.com\/campus\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/how-to-code-an-ib-algo-order-in-the-web-api\/#primaryimage"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/how-to-code-an-ib-algo-order-in-the-web-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/04\/api-tech-button.jpg","datePublished":"2021-04-29T15:52:00+00:00","dateModified":"2025-02-12T21:43:58+00:00","description":"This tutorial will help you get started with Interactive Brokers' algorithmic order types that are designed to include user-defined settings to your trades.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/how-to-code-an-ib-algo-order-in-the-web-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/ibkr-quant-news\/how-to-code-an-ib-algo-order-in-the-web-api\/#primaryimage","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/04\/api-tech-button.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/04\/api-tech-button.jpg","width":1000,"height":563,"caption":"API"},{"@type":"WebSite","@id":"https:\/\/ibkrcampus.com\/campus\/#website","url":"https:\/\/ibkrcampus.com\/campus\/","name":"IBKR Campus US","description":"Financial Education from Interactive Brokers","publisher":{"@id":"https:\/\/ibkrcampus.com\/campus\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ibkrcampus.com\/campus\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ibkrcampus.com\/campus\/#organization","name":"Interactive Brokers","alternateName":"IBKR","url":"https:\/\/ibkrcampus.com\/campus\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/","url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","contentUrl":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2024\/05\/ibkr-campus-logo.jpg","width":669,"height":669,"caption":"Interactive Brokers"},"image":{"@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/logo\/image\/"},"publishingPrinciples":"https:\/\/www.interactivebrokers.com\/campus\/about-ibkr-campus\/","ethicsPolicy":"https:\/\/www.interactivebrokers.com\/campus\/cyber-security-notice\/"},{"@type":"Person","@id":"https:\/\/ibkrcampus.com\/campus\/#\/schema\/person\/a70292c923c6262ec34ebe59e937f0cc","name":"IBKR API","url":"https:\/\/www.interactivebrokers.com\/campus\/author\/ibkrapi\/"}]}},"jetpack_featured_media_url":"https:\/\/www.interactivebrokers.com\/campus\/wp-content\/uploads\/sites\/2\/2021\/04\/api-tech-button.jpg","_links":{"self":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/85696","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/users\/614"}],"replies":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/comments?post=85696"}],"version-history":[{"count":0,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/posts\/85696\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media\/85700"}],"wp:attachment":[{"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/media?parent=85696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/categories?post=85696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/tags?post=85696"},{"taxonomy":"contributors-categories","embeddable":true,"href":"https:\/\/ibkrcampus.com\/campus\/wp-json\/wp\/v2\/contributors-categories?post=85696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}