Login Page - Create Account

Support Board


Date/Time: Tue, 21 Jan 2025 07:42:50 +0000



Post From: Report Possible Bug: sc.SellEntry() Incorrectly Displays Order Fills

[2018-08-01 15:53:33]
Richard Chinn - Posts: 28
Report Possible Bug: sc.SellEntry() Incorrectly Displays Order Fills

Sierra Chart Version 1785 64-bit. No settings were changed from the original download except as noted

"I am using my own custom automated trading study running as a SIMULATION."

SETUP:
true: sc.AllowOnlyOneTradePerBar
Checked: Trade>>Chart Trade Mode On
Checked: Trade>>Show Order Fills
Checked: Trade>>Show Orders And Positions
Checked: Trade>>Auto Trading Enabled - Global
Checked: Trade>>Auto Trading Enabled - Chart

OBSERVATION:

- An order has filled
- Chart display is: 1@2824.25
- Study tries to fill another order in the same bar
- Message sent to Trade Service Log stating trade is ignored because AllowOnlyOneTradePerBar is true
- The attempted fill 1@2826.00 is displayed as a fill on the same bar

Chart display is incorrect. The second "order fill" is reflected on the same bar even though the additional 1@2826.00 was rejected.
This happens multiple times with each new attempt and rejection until the bar is closed, displaying a new “fill” on the chart each time.


I only observed this with the sc.SellEntry() function. It hasn’t happened in my program with the sc.BuyEntry() function.
The program performs correctly in the sense that no additional fills are made.

CODE SNIPPET:


s_SCNewOrder NewOrder;    
NewOrder.OrderQuantity = 1;
NewOrder.OrderType = SCT_ORDERTYPE_MARKET;
NewOrder.TimeInForce = SCT_TIF_DAY;

orderResult = (int)sc.SellEntry(NewOrder);

if (orderResult < 1)
sc.AddMessageToLog(sc.GetTradingErrorTextMessage(orderResult), 1);

DOCUMENTATION SEARCH: None
SUPPORT BOARD SEARCH: sc.SellEntry / sc.BuyEntry: No relevant threads found

Thanks
Richard