Login Page - Create Account

Support Board


Date/Time: Fri, 29 Nov 2024 03:39:13 +0000



ACSIL study won't use Trade Window attached orders

View Count: 535

[2023-03-10 18:57:29]
tecman240 - Posts: 16
Hi,
I'm creating an ACSIL study that creates a Stop-Limit entry order. The study will create the entry order, but I can't get it to include the attached orders defined in the Trade Window.
My study has the following set:

    sc.AllowOnlyOneTradePerBar = 1;
   sc.SupportAttachedOrdersForTrading = 1;
    sc.MaintainTradeStatisticsAndTradesData = true;
    sc.ReceivePointerEvents = ACS_RECEIVE_POINTER_EVENTS_WHEN_ACS_BUTTON_ENABLED;
    sc.AllowMultipleEntriesInSameDirection = true;
    sc.MaximumPositionAllowed = 3;

I've also tried setting sc.TradeWindowConfigFileName but that doesn't work either.
I must be missing something.
thanks,
[2023-03-10 19:57:49]
User90125 - Posts: 715
Try adding this to the sc.SetDefaults block:

sc.UseGUIAttachedOrderSetting = true;

See ACSIL Interface Members - Variables and Arrays: sc.UseGUIAttachedOrderSetting for more info.
[2023-03-10 20:28:09]
tecman240 - Posts: 16
The attached orders now appear, however If I don't set the order quantity in my study, no orders are placed.
Is there a way to have the study use the current quantity specified in the Trade Window?

thank you.
[2023-03-10 20:35:39]
User431178 - Posts: 544
ACSIL Interface Members - Variables and Arrays: sc.TradeWindowOrderQuantity
[2023-03-10 22:56:49]
User90125 - Posts: 715
Also make sure sc.MaintainTradeStatisticsAndTradesData is enabled in the SetDefaults block too, which it apparently is in the code you posted above.
Date Time Of Last Edit: 2023-03-10 22:59:24
[2023-03-11 16:37:06]
tecman240 - Posts: 16
Thanks, now the study quantity matches the trade window, however I get this Trade Log error message when trying to enter a position with quantity = 2:
Auto-trade: MESH23_FUT_CME[M] Rev. 6t #2 | Next Reversal Open | SellEntry | Bar start date-time: 2023-03-10 15:47:18.014 | SellEntry signal is ignored because maximum Short 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 | 2023-03-10 15:51:27.705

I can't figure out where this position limit error is coming from:
The Trade Position window shows no positions before attempting the above entry.
In my study I have sc.MaximumPositionAllowed = 4 in the SetDefaults section.
In Global Settings>>Symbol Settings:
- Use Global Trade Position Limit is unchecked,
- Symbol MES?##_FUT_CME Trade Position Limit =0 and Order Quantity Limit = 0

thank you for the help.
[2023-03-11 18:09:09]
User90125 - Posts: 715
Max. Position allowed: 1

Somewhere in your code or your setup, something is enforcing a Max Position of just 1 contract.
[2023-03-13 15:15:44]
tecman240 - Posts: 16
It must have been something with the simulator position. I cleared sim positions & data and now it works.

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

Login

Login Page - Create Account