Login Page - Create Account

Support Board


Date/Time: Thu, 06 Mar 2025 12:50:53 +0000



ACSIL: max quantity 1 when there is no such configured limit

View Count: 1239

[2022-01-26 15:13:45]
User166108 - Posts: 73
For reasons I cannot fathom, occasionally when submitting orders through ACSIL I get the following message:


Auto-trade: MNQ-202203-GLOBEX-USD [CBV][M] 5 Min #1 | <ACSIL FUNCTION> | BuyEntry | Bar start date-time: 2022-01-26 10:05:00.000 | BuyEntry signal is ignored because maximum Long Position quantity allowed has been reached or would be exceeded with new order. Max. Position allowed: 1. Resulting Position without working orders: 2. Resulting Position with all working orders except exits: 2. Resulting Position with Market working orders: 2 | 2022-01-26 10:05:36.911

Other times I have no problem with my quantity. For example, see an example fill below.


ActivityType  DateTime  Symbol  OrderActionSource  InternalOrderID  ServiceOrderID  OrderType  Quantity  BuySell  Price  Price2  OrderStatus  FillPrice  FilledQuantity  TradeAccount  OpenClose  ParentInternalOrderID  PositionQuantity  FillExecutionServiceID  HighDuringPosition  LowDuringPosition  Note  AccountBalance  ExchangeOrderID  ClientOrderID  TimeInForce  Username
Orders  2022-01-26 09:49:34.974626  MNQ-202203-GLOBEX-USD  IB order fill (execution)  15713  4244  Market  5  Buy      Filled  14416.85  5  <REDACTED>  Close    -1  0000e1a7.61f2dff2.01.01        0.00      Day  

To be clear there is NO limit for MNQ in symbol settings. This is causing issues with proper execution and I do not know how to fix it. I cannot go live with my ACSIL function until I understand why this is happening.

Is there a max quantity I'm supposed to set in s_SCNewOrder that is not being set? I cannot see it if so.
[2022-01-26 15:25:26]
User166108 - Posts: 73
Seems like there *is* such a variable which is uninitialized?

Automated Trading Management: MaximumPositionAllowed

My position size is managed outside of the ACSIL at the broker, is it possible to set this to be ignored?
[2022-01-26 16:02:07]
Sierra Chart Engineering - Posts: 104368
Yes this is the variable you need to set as you require:
Automated Trading Management: MaximumPositionAllowed

It does need to be set to something. It cannot be ignored. You can just set it to a large number.
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
[2022-01-26 16:21:23]
User166108 - Posts: 73
That explains why it would work occasionally. I thought I was losing my mind.

I feel a little scared doing DBL_MAX so I'll just put in something reasonable anyway.

If I may make a suggestion it should probably be initialized to 0 so that it never works and then people have to figure out why as opposed to it randomly working.
[2022-01-29 07:01:26]
User166108 - Posts: 73
Update: I tested and DBL_MAX doesn't work, presumably there is some sort of an addition/subtraction occurring which overflows. I'm using instrument-specific limits for now.
[2022-01-30 17:02:12]
ForgivingComputers.com - Posts: 1021
I tested and DBL_MAX doesn't work

Try INT_MAX.
[2022-01-30 17:20:27]
User166108 - Posts: 73

Try INT_MAX.

Hmm specifically I did something like
std::numeric_limits<decltype(sc.MaximumPositionAllowed)>::max()
.

I guess INT_MAX makes more sense.

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

Login

Login Page - Create Account