Since different stocks have different lot sizes and prices, is there any way to make a single Global Preset configuration for all of them or we need to make separate Ticker specific configuration which means more than 175 Presets for Options and Combos?
First of all 95% of NSE Stock Options are Illiquid. Specifically for derivatives, my advise would be instead of looking for Trade signals everywhere, it is better to laser focus on handpicked ones, basis liquidity, volatility, and other stats...
Now to answer your question! No, you do not need to create presets for each one of them, if you wish to preset for large number of tickers...
User discretion is once again advised
!!! YOU ARE DISCOURAGED TO DO THIS IF YOU DO NOT KNOW WHAT YOU ARE DOING !!!
IBKR settings are stored here in this file - "
C:\Jts\<long alphabet identifier like "epakf......gil">\tws.xml"
Path might vary depending your installation location. Take a backup of the XML before modifying anything. Don't worry! Even if you screw-up, you would need to re-install TWS... set things up from scratch... that's all...
Now you need a XML parser, using your programming language preference, you need to dynamically insert below
<OrderDefaultNode></OrderDefaultNode> for each of your Tickers with its corresponding
symbol as "Ticker Symbol",
ArString string as "Ticker Symbol",
defSize as "Lot Size" and other preset as you deem fit...
XML:
<OrderDefaultNode>
<OrderDefault varName="element" side="0" useClosePositionSizeFirst="false" useCumulativeSizeForMarketDepth="true" preferSmart="false" useDefaultAmt="false" strategy="false" active="false" useRemainingTicketSize="true" defaultDisplaySizeTo50PercOfSize="false" defaultDestination="true" hedgeOrderOffsetType="false" version="19" defSize="5700" sizeInc="#" rfqSize="5700" orderOrigin="7" blotterPrecautionTypeFT="0" blotterPrecautionTypeFDR="0" blotterPrecautionMultiplierFT="1" blotterPrecautionMultiplierFDR="1" numOfTicks="20" numOfTicksFT="0" numOfTicksFDR="0" cashQtyEstimateFactor="25" expandedStrategyLastUse="0" timestamp="1641715709298" trailingOffset="1.0" hedgeOrderOffset="0.01" hedgeOrderPctOffset="0.0" closeCurrencyOffset="0.01" rebalanceCashOffset="0.01" defaultAmt="0.0" defaultCryptoBuyMktAmount="0.0" relativeOffset="0.01" sizeDivisor="0.0" roundingThreshold="0.0" useForUSSTKOnly="false" pegMidOffsetsDistance="0.005" percentCheck="3" percentCheckFT="3" percentCheckFDR="3" timeInForce="DAY" hedgeOrderType="1" orderType="2" ticketOrderType="1" closeCurrencyOrderType="1" rebalanceCashOrderType="1" bookTraderSizeMultipliers="1,2,3,5" secType="OPT" symbol="TATAMOTORS" trailingUnit="0">
<startTime></startTime>
<endTime></endTime>
<ArString varName="secDefs">
<String>TATAMOTORS</String>
</ArString>
<Fraction varName="preciseDefSize" numerator="#" denominator="0" isANum="false" simplified="true"/>
<Attributes varName="attribs">
<OpenCloseAttrib val="C"/>
<TriggerMethod>
<TwsEnum type="jfix.FixTriggerMethod" varName="val" val="0"/>
</TriggerMethod>
<TouchedTrigger val="1.0" allowZero="false"/>
<CommissionPolicy>
<TwsEnum type="jfix.FixCommissionPolicy" varName="val" val="0"/>
</CommissionPolicy>
</Attributes>
<OCAType varName="ocaType" fixString="ReduceOnFillNonBlock"/>
<AlgoExchangeSettings varName="algoExchangeSettings">
<AlgoAttributePresetMap varName="algoAttributeMap"/>
</AlgoExchangeSettings>
<defaultQuantityType>Shares</defaultQuantityType>
<OdPrimaryOrder varName="odPrimaryOrder" reverseBidAsk="true" initComponentSize="#" subComponentSize="#" priceIncrement="#" profitTaker="#" restoreSize="false" adjustedOrderType="-1" adjustedTrailingAmount="#">
<PriceTypeQuantityUnit varName="limit" quantity="0.0" unit="0" useParentOrdPrc="false">
<priceType>Ask</priceType>
<priceTypeExt>Ask</priceTypeExt>
</PriceTypeQuantityUnit>
<PriceTypeQuantityUnit varName="priceCap" quantity="0.0" unit="0" useParentOrdPrc="false">
<priceType>None</priceType>
<priceTypeExt>None</priceTypeExt>
</PriceTypeQuantityUnit>
<PriceTypeQuantityUnit varName="stop" quantity="1.0" unit="0" useParentOrdPrc="false">
<priceType>Limit</priceType>
<priceTypeExt>Limit</priceTypeExt>
</PriceTypeQuantityUnit>
<PriceTypeQuantityUnit varName="stopLimit" quantity="0.03" unit="0" useParentOrdPrc="false">
<priceType>Stop</priceType>
<priceTypeExt>Stop</priceTypeExt>
</PriceTypeQuantityUnit>
<PriceTypeQuantityUnit varName="relativeLimit" quantity="0.0" unit="0" useParentOrdPrc="false">
<priceType>None</priceType>
<priceTypeExt>None</priceTypeExt>
</PriceTypeQuantityUnit>
<PriceTypeQuantityUnit varName="touchedTrigger" quantity="-1.0" unit="0" useParentOrdPrc="false">
<priceType>Last</priceType>
<priceTypeExt>Last</priceTypeExt>
</PriceTypeQuantityUnit>
<PriceTypeQuantityUnit varName="adjustedTrigger" quantity="0.0" unit="0" useParentOrdPrc="false">
<priceType>None</priceType>
<priceTypeExt>None</priceTypeExt>
</PriceTypeQuantityUnit>
<PriceTypeQuantityUnit varName="adjustedStop" quantity="1.0" unit="0" useParentOrdPrc="false">
<priceType>None</priceType>
<priceTypeExt>None</priceTypeExt>
</PriceTypeQuantityUnit>
<PriceTypeQuantityUnit varName="adjustedStopLimit" quantity="0.0" unit="0" useParentOrdPrc="false">
<priceType>None</priceType>
<priceTypeExt>None</priceTypeExt>
</PriceTypeQuantityUnit>
<AlgorithmSleeveSettings varName="sleeveAlgoSettings">
<AlgoExchangeSettings varName="algoExchangeSettings">
<AlgoAttributePresetMap varName="algoAttributeMap"/>
</AlgoExchangeSettings>
</AlgorithmSleeveSettings>
</OdPrimaryOrder>
<AttachedOrderData2 varName="attachedOrder2" orderType="-1" offset="0.0" initComponentSize="#" subComponentSize="#" priceIncrement="#" trailingAmount="#" trailingUnit="0" adjustedTrailingAmount="#" adjustedTrailingUnit="0" autoAttachStopLoss="false" autoAttachProfitTaker="false">
<PriceTypeQuantityUnit varName="limit" quantity="1.0" unit="0" useParentOrdPrc="false">
<priceType>Parent_Order</priceType>
<priceTypeExt>Parent_Order</priceTypeExt>
</PriceTypeQuantityUnit>
<autoStop>NONE</autoStop>
<PriceTypeQuantityUnit varName="stop" quantity="-1.0" unit="0" useParentOrdPrc="false">
<priceType>Parent_Order</priceType>
<priceTypeExt>Parent_Order</priceTypeExt>
</PriceTypeQuantityUnit>
<PriceTypeQuantityUnit varName="stopLimit" quantity="0.0" unit="0" useParentOrdPrc="false">
<priceType>None</priceType>
<priceTypeExt>None</priceTypeExt>
</PriceTypeQuantityUnit>
<PriceTypeQuantityUnit varName="adjustedTrigger" quantity="1.0" unit="0" useParentOrdPrc="false">
<priceType>None</priceType>
<priceTypeExt>None</priceTypeExt>
</PriceTypeQuantityUnit>
<PriceTypeQuantityUnit varName="adjustedStop" quantity="1.0" unit="0" useParentOrdPrc="false">
<priceType>None</priceType>
<priceTypeExt>None</priceTypeExt>
</PriceTypeQuantityUnit>
<PriceTypeQuantityUnit varName="adjustedStopLimit" quantity="0.0" unit="0" useParentOrdPrc="false">
<priceType>None</priceType>
<priceTypeExt>None</priceTypeExt>
</PriceTypeQuantityUnit>
</AttachedOrderData2>
<modifiedByUser>TOUCHED_BY_USER</modifiedByUser>
<presetVariant>ORDER_PRESET_SEC_TYPE_LEVEL</presetVariant>
<AlgorithmFavoritesSettings varName="algoFavoritesSettings">
<List varName="algoExchangeSettings" type="jsetting.ArAlgoExchangeSettings"/>
</AlgorithmFavoritesSettings>
</OrderDefault>
<ListOfOrderDefaultNode varName="children"/>
</OrderDefaultNode>
Save the XML, then upload that onto TWS using:
One related thing I have noticed is that if the option quantity is more than 100 then the Breakeven calculated by the Performance Profile is incorrect.
Ideally 1 option contract = 100 units of its underlying, but in our country given stock option illiquidity, STT and many other non-correlated aspects, such as the "extravagent lot size", the equivariance never remain balanced. So, the assumptive deduction is ought to be incorrect.
To make it easy, simply (SellPrice - BuyPrice) * Qty == "bhau bhagwan che"