Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 17:22:07 +0000



Poor reliability when trading options

View Count: 2636

[2013-12-10 15:49:45]
User76625 - Posts: 49
Hi, I'm using SC to trade options and am having a terrible time getting things to work as they should. Specifically, positions are not closing when my code dictates they should. Sometimes they do, many times they do not.

I suspect this has to do with the fact I have to use the "Use Order Fill Calculated Position" option for each options chart, and somewhere along the line something gets screwed up that throws off my position quantity and SC thinks I'm flat when I'm not, shows me with a position when I do not have one, etc.. But, of course, I often don't know that there's anything wrong until something doesn't happen when I think it should, or when something happens and I wasn't expecting it.

It simply makes trading options very unreliable without constantly monitoring many charts to make sure everything did what it was supposed to do. This defeats the purpose of automated trade management.

I have reviewed the documentation (http://www.sierrachart.com/index.php?l=doc/doc_TradeStatusWindows.html#OrderFillCalculatedPosition) and understand that the trade data can be wrong depending on what SC has as data in the trade activity log since it does not rely on the external trading service.

So is there no just no way to track options the same way as stock to reliably make sure that SC's position data matches your actual position data? When trading stock, (so far) 100% of the time things have gone as planned.

Could this issue be broker specific since they sometimes have special formats for symbols? I'm using IB for both data provider and broker, if that's relevant.

Any feedback or suggestions would be appreciated. Thank you.
[2013-12-11 07:21:48]
Sierra Chart Engineering - Posts: 104368
Knowing you are using Interactive Brokers is very relevant.

In the next release, we will be formatting the symbol for trade positions from Interactive Brokers as follows:
[Underlying Symbol]-OPT-[Expiration Date (YYYYMMDD or YYYYMM)]-[Strike Price]-[Call or Put]-[Exchange]-[Multiplier]-[Currency Code]

This should solve the problem, as long as you specify the option symbol in this format, and you should not have to rely upon the Order Fill Calculated Position.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2013-12-30 16:27:50]
User76625 - Posts: 49
Hi, I updated SC for the fix listed above (currently running 1067), but I'm still having problems getting my options positions to close. My code running on the options charts basically says "if PositionQuantity != 0 && "x" happen, then flatten the position." Well "x" is happening, but the positions are not flattening, assumedly because the system still thinks there is no position when there actually is one.

Under 'Trade Orders and Positions' my option positions do show correctly even with the "Use Order Fill Calculated Position" turned off, so that's a step in the right direction. But my charts still don't show an open Profit/Loss line with the "Show Orders and Position" option checked, which suggests it thinks there is no position associated with that chart.

Could this still have something to do with the fact that my chart uses "SMART" as the exchange and the actual position is "AMEX" (whatever the actual exchange is)? i.e., Chart symbol: AAPL-OPT-20140103-560-C-SMART-100-USD and actual position symbol: AAPL-OPT-20140103-560-C-AMEX-100-USD

Again, I'm using IB.

Please let me know if any additional information would be useful to diagnose the issue.
[2013-12-30 19:16:46]
User76625 - Posts: 49
Just as a quick update on a couple things I've noticed:

Under "Trade Orders and Positions - Trade Stats for Charts" tab it shows an open quantity of +1 for the symbol APL-OPT-20140103-560-C-SMART-100-USD. This symbol matches my the symbol used for chart data. (Apparently I can't copy and paste from this part of the TOaP window.)

Under the "Positions" tab it shows "Symbol  Quantity  Trade Account  Trade Service Average Price  Trade Service Position Quantity  
AAPL-OPT-20140103-560-C-AMEX-100-USD  1  DU157477  4.25465  1"

When I go to that chart and right click and hit "Flatten and Cancel" I get an error saying "Trade Order Error: Unable to Flatten or Reverse because a position does not exist for the symbol: AAPL-OPT-20140103-560-C-SMART-100-USD | 2013-12-30 11:49:54"

So it would look like the member "PositionQuantity" refers to the info in "Position" tab - would this issue get resolved if it instead referred to the "Trade Stats for Charts" tab? Or if the "Position" tab also showed the chart symbol instead of the actual exchange on which the order was filled (AMEX)?

[2013-12-31 21:56:00]
Sierra Chart Engineering - Posts: 104368
Why not specify the symbol this way using the specific exchange:
AAPL-OPT-20140103-560-C-AMEX-100-USD

This will definitely solve the problem. Does not seem like you need to use SMART because options are only going to trade on one exchange to our knowledge.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2013-12-31 21:58:22
[2014-01-01 07:52:22]
Lesmond - Posts: 21
SC Support: Does not seem like you need to use SMART because options are only going to trade on one exchange to our knowledge.

Not exactly. While a few contracts, like SPXPM options, trade on a single exchange (CBOE electronic + open outcry), most US options trade on multiple exchanges, so using SMART is an obvious choice when placing orders in IB's TWS. Here is a screenshot of AAPL contract in question taken from MyTrack's composite data screen:

http://img543.imageshack.us/img543/2383/e1ub.png

Level-1 NBBO quote looks like this (bottom line):

http://img41.imageshack.us/img41/3648/a46k.png

The screenshots were taken on Jan. 1st at 01:50 AM so some data, like Size, has already been purged, and NBBO (red quotes under bid & ask on the first screenshot) is stuck at GEM 3.50/3.90 for some reason (it should show AMEX 3.70 / BATS 3.80), but you get the general idea.

The problem reported by OP might be related to "primary_exchange" identifier issue that affects some US stock symbols, where a US symbol is identical to a symbol that trades on some overseas exchange, so further identification is required. It's explained by IB support here:

http://www.elitetrader.com/vb/showthread.php?s=99c71296478019d0bf23237d0c6e0a84&threadid=279936&perpage=6&pagenumber=6

If this is the case, then the possible solutions for option symbols would be as follows:

1) AAPL-OPT-20140103-560-C-SMART-AMEX-100-USD

2) AAPL-OPT-20140103-560-C-SMART/AMEX-100-USD
3) AAPL-OPT-20140103-560-C-SMART:AMEX-100-USD

Format #1 is preferred, but requires that the software (like Sierra) supports a separate "primary_exchange" field. If it's not supported then format #2 or #3 and TWS v936 or later is required.

Here is how it works with stocks:

1) MSFT-STK-SMART-NASDAQ-USD

2) MSFT-STK-SMART/NASDAQ-USD
3) MSFT-STK-SMART:NASDAQ-USD

I can't test all this myself because I don't have an active IB account at this point.
Date Time Of Last Edit: 2014-01-01 08:21:55
[2014-01-01 08:59:25]
User76625 - Posts: 49
I agree with the info above - most options trade on multiple exchanges. That's the main reason IB's SMART "exchange" exists - they route your order to the best exchange at that instant. If I use AMEX as my exchange, it goes to AMEX only.

To show that there are more exchanges out there, here is a very small section of trade log for AMZN, and they're from a month ago, but they show a couple illustrative examples:

Symbol  Trade Type  Entry DateTime  Exit DateTime  Avg Entry Price  Avg Exit Price  Entry Quantity  Exit Quantity  Max Open Quantity  Profit/Loss  Cum P/L  Runup  Drawdown  Max Open Profit  Max Open Loss  Entry Efficiency  Exit Efficiency  Total Efficiency  Commission  
AMZN 131213P00385000-OPT-BOX  Short  2013-12-10 07:52:52    4.20    10  0  10  0.00  -86.67  0.00  0.00  0.00  0.00  0.00%  0.00%  0.00%  0.00  
AMZN 131213P00385000-OPT-MIAX  Short  2013-12-10 07:52:52    4.20    8  0  8  0.00  -86.67  0.00  0.00  0.00  0.00  0.00%  0.00%  0.00%  0.00  

So the "SMART" routed order filled 18 contracts through 2 different exchanges.

The same thing happens with stock - I put in AAPL and it might fill in one or many of several exchanges, but as far as SC is concerned, AAPL is AAPL. So is there some way to make SC recognize that every AAPL 560 Call that expires on 1/3/14 belongs to the chart that uses the symbol structure AAPL-OPT-20140103-560-C-SMART-100-USD ?

I can't think of a real reason why I would want to differentiate between a AAPL-OPT-20140103-560-C-SMART-100-USD and a AAPL-OPT-20140103-560-C-AMEX-100-USD and a AAPL-OPT-20140103-560-C-PHLX-100-USD contract. They were all traded from the AAPL-OPT-20140103-560-C-SMART-100-USD chart, and if I want to close those positions, I want SC (and IB) to send my close orders to the best exchanges at that instant using IB's SMART routing.
[2014-01-03 19:03:30]
User76625 - Posts: 49
As an update - I tried the suggestion from the other poster above and added the "primary_exchange" identifier by adding "/AMEX" and ":AMEX" to SMART (to make the chart symbol AAPL-OPT-20140103-560-C-SMART/AMEX-100-USD) and while I did get data, any order submitted got stuck in "Order Sent" status, and were never actually transmitted to IB, so that did not fix the issue.

I also tried changing the exchange from SMART to AMEX only per support's reco; this gives me data for AMEX only (not the consolidated data from all exchanges that SMART would provide), but it does allow me to submit orders, both to open and close positions (since the chart symbol matched the position symbol, it recognized I had a position open so the code to close the position did run). However, it also will only send orders via AMEX exchange, which often is not the best routing option available, so that is not a viable fix.

So to recap - it would appear the issue I'm having stems from the fact that the "Position" symbol uses the actual exchange through which the order was routed (and never SMART), while the chart symbol will always use SMART. As such, the code running on that chart will never recognize that there is a position open.

I see that the "Trade Stats for Chart" tab is able to group all orders from a chart (regardless of the actual exchange) into a single symbol using SMART. Would it be possible to do the same for the "Positions" tab? It is my understanding that the s_SCPositionData Structure refers to the info under the "Positions" tab when you use the PositionQuantity member. So that might, theoretically, fix this issue.

Thanks again for all your help.
[2014-01-04 08:03:11]
Sierra Chart Engineering - Posts: 104368

So to recap - it would appear the issue I'm having stems from the fact that the "Position" symbol uses the actual exchange through which the order was routed (and never SMART), while the chart symbol will always use SMART. As such, the code running on that chart will never recognize that there is a position open.
We know how to solve this problem. We will be implementing a solution next week.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2014-01-07 03:03:59]
Sierra Chart Engineering - Posts: 104368
The solution to this will be out in version 1073.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account