Login Page - Create Account

Support Board


Date/Time: Fri, 10 May 2024 08:47:50 +0000



[Programming Help] - Meaning of different negative return values for InternalOrderID

View Count: 815

[2017-05-22 18:32:16]
binaryduke - Posts: 360
Hi SierraChart

I have a prototype trading system generating trades for a different symbol to the chart to which the trading system is applied. Consequently BuyOrder and SellOrder are being used for order placement (via Interactive Brokers). I am confident that the s_SCNewOrder object has valid values for OrderQuantity, OrderType and Symbol.

After calling sc.BuyOrder with the s_SCNewOrder object, the returned value is either -1 or -5 depending upon other changes within the code. Nothing is logged within the Trade Activity Log, Trade Service Log or within the IB client.

Do the negative values have specific meanings to aid diagnosis?

Thanks

Lee.
Date Time Of Last Edit: 2017-05-22 18:51:14
[2017-05-22 19:23:27]
binaryduke - Posts: 360
To expand on this, the contract being traded is an option contract and the symbol follows the format specified within your documentation:
e.g. SPX-OPT-20170524-2400-C-SMART-100-USD

Both this and SPXW-OPT-20170524-2400-C-SMART-100-USD

return a negative value when specified as part of a sc.BuyOrder call using an s_SCNewOrder object.

SPX-OPT-20170524-2400-C-SMART-100-USD is a valid symbol as I can open a chart for it and see it in a quote board.

Thanks

Lee.
[2017-05-23 04:51:14]
Sierra Chart Engineering - Posts: 104368
Refer to the documentation for this here:
Automated Trading From an Advanced Custom Study: Order Error Constants
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
[2017-05-23 18:36:09]
binaryduke - Posts: 360
Thank you. This helps.

1. For testing, my study is placing an order for the following IB symbol: SPX-OPT-20170524-2405-C-SMART-100-USD
2. I have set up the following symbol within Global Symbol Settings (screenshot attached):
Symbol: SPX-OPT-########-####-?-SMART-100-USD
Use pattern matching: enabled
Price Display Format: .01
Tick Size 0.050000
Currency Value Per Tick: 100
Real Time Price Multiplier: 1
Default Order Quantity: 1
I believe this should be correct to enable symbol definition against the IB option symbology.

Orders placed for this symbol with sc.BuyOrder and sc.SellOrder still return a -5 error code.

It is possible to place orders for this symbol via a trade window when the symbol is charted.

Please could you point me in the right direction.

Thanks

Lee.
Date Time Of Last Edit: 2017-05-23 18:36:47
imageIB option symbol.png / V - Attached On 2017-05-23 18:36:37 UTC - Size: 65.32 KB - 235 views
Attachment Deleted.
[2017-05-23 19:07:02]
Sierra Chart Engineering - Posts: 104368
That does look correct.

Just make sure there are no spaces at the end of the symbol in the Symbol Settings.

This should not be necessary but restart Sierra Chart and try again.
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
[2017-05-23 19:27:44]
binaryduke - Posts: 360
Thanks for the quick response. There are no spaces at the end of the symbol - it's the content between these quotes "SPX-OPT-########-####-?-SMART-100-USD".

Having restarted I'm still receiving the -5 error for orders placed for SPX-OPT-20170524-2400-C-SMART-100-USD

Is there any way to get deeper logging to try to resolve this?
[2017-05-23 19:42:07]
binaryduke - Posts: 360
Apologies! Now working. Minor error in the test symbol. Updating Global Symbol Settings fixed the root '-5' error. Thanks.
[2017-05-23 19:51:42]
ejtrader - Posts: 688
binaryduke - can you paste the fixed settings? Would be curious to know what the error was.

Thanks
[2017-05-23 20:11:03]
binaryduke - Posts: 360
The settings listed above for Global Symbol Settings were correct. My edited code for testing after making this change had a typo in the symbol :rolleyes:

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

Login

Login Page - Create Account