Login Page - Create Account

Support Board


Date/Time: Mon, 16 Jun 2025 08:49:37 +0000



[Programming Help] - SendOrdersToTradeService is not consistent with 'Trade >> Trade Simulation Mode On'

View Count: 314

[2025-05-08 07:25:08]
User61576 - Posts: 450
i have a custom study file in which we take input for live trading as follows-
"ProductionMode.Name = "Production Mode Enable";
ProductionMode.SetYesNo(false);
"
the above lines are in sc.setdefaults and then after sc.setdefaults is the following line-
"sc.SendOrdersToTradeService = ProductionMode.GetYesNo();"
the problem is when i open a chartbook which has multiple charts and i apply the custom study, change the value to yes so it should be in live trading, the trades are happening successfully but i am getting the message "SendOrdersToTradeService is not consistent with 'Trade >> Trade Simulation Mode On'" in my trade service log. Somebody in support board suggested the change "sc.SendOrdersToTradeService = !sc.GlobalTradeSimulationIsOn;" which i tried today, the trade service log is telling me the message for charts "Delta 100 v#2" and "Delta 100 v#3". But i did not even apply the custom study file to those charts. I applied it on "100 trades #1". Then I applied my custom study to delta v#2 and delta v#3 and trades happened but still i was getting the same message in trade service log. My chart settings are as follows- trade>>
Trade simulation mode on (unchecked) , auto trading enabled - global (checked), auto trading enabled - chart (checked). Is there any sierra chart setting that i am missing or is the issue in my code because i have followed the instructions of keeping "sc.SendOrdersToTradeService = ProductionMode.GetYesNo();" after sc.setdefaults. Also, i am only getting these message in trade service log when i enter a trade in a chart. as soon as the trade ends, the message stops in trade service log but as soon as it enters a trade again then i get the same message again till the trade is finished. Also checked if by mistake the value of sendorders is getting changed anywhere else in the code and it is not being changed.
[2025-05-09 11:46:31]
Sierra_Chart Engineering - Posts: 19924
Refer to:
Automated Trading Management: SendOrdersToTradeService

Are you getting the messages repetitively?:
. Also, i am only getting these message in trade service log when i enter a trade in a chart. as soon as the trade ends, the message stops in trade service log but as soon as it enters a trade again then i get the same message again till the trade is finished.
If so, this means there are orders continuously being sent and you should avoid that.

Maybe you also have another instance of the automated trading system you are not aware of.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2025-05-09 14:39:15
[2025-05-11 08:03:11]
User61576 - Posts: 450
yes i have been getting the messages repeatedly for the chart but only for the time that they are in trade. Also my custom study has a variable to check if we are currently in trade or not, so it is not possible that orders are being sent continuously. i also checked the SendOrdersToTradeService documentation and i am following the instructions as they are given. in my sc.setdefaults, i have initialized production mode and set it as false. after sc.setdefaults, i have put "sc.SendOrdersToTradeService = ProductionMode.GetYesNo();" so, when i apply custom study and change it to yes, it should be checked every tick and value should be consistently 1. i added some print logs to see if value is getting changed during the trade and it was consistently 1. could this be a race condition of some sorts? charts not fully loading and my custom study file already applied? or should i not take input and just use "sc.SendOrdersToTradeService = !sc.GlobalTradeSimulationIsOn;" after sc.setdefaults? I completely forgot to mention that for the charts which i get this message, the trades are happening normally as they used to. it's just this message which keeps repeating in trade service log. So, in message log it showed "SendOrdersToTradeService value is 1", and at the same time in trade service log it shows 0 and global simulation mode on is also 0. so i feel it is race condition but please let me know what should I do in this case.
[2025-05-11 10:54:40]
User431178 - Posts: 713
the trade service log is telling me the message for charts "Delta 100 v#2" and "Delta 100 v#3". But i did not even apply the custom study file to those charts.

So which exact studies are on charts #2 and #3?
If the error messages are emanating from those charts, then surely you must have another study (not your custom one) on there that is misconfigured?
The fact that your study submits orders correctly also implies that the problem is elsewhere.

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

Login

Login Page - Create Account