Support Board
Date/Time: Mon, 10 Mar 2025 07:19:12 +0000
[Programming Help] - ACSIL Example Study (TradingTriggeredStopOrderEntry) Orders not executing?
View Count: 856
[2022-03-18 19:19:40] |
User92573 - Posts: 547 |
Dear Support I've copied the example "TradingTriggeredStopOrderEntry" and compiled the code but although both the trigger-line and order-line are showing on the chart, a stop order is not being posted as price reaches the trigger-line and nor is the order executed when price reaches the order-line. Stop Order trigger-line appears on left at correct price
Stop Order-line appears on left at correct offset But as stated orders are not triggered. Am I missing something? Many thanks |
[2022-03-18 19:31:41] |
1+1=10 - Posts: 270 |
Hi User92573, I’m a fellow customer that codes in ACSIL quite frequently. Have you enabled auto trading on the chart? Does anything explained here help?: Automated Trading From an Advanced Custom Study: Debugging/Troubleshooting Automated Trading Systems |
[2022-03-18 20:27:34] |
User92573 - Posts: 547 |
Hi thank you. Yes, Auto-trading for chart is enabled; and Chart-Trade = On. Nothing is being sent to the Log. A little lost as to what is preventing the orders executing. Everything is as the example study - no alterations. |
[2022-03-18 22:14:09] |
1+1=10 - Posts: 270 |
The studies in the OrderEntryStudies.cpp are actually not examples. They are the source code for built-in SC studies. You can find the "Trading: Triggered Stop Order" in the same list of all the other built-in SC studies. I'm just pointing it out because the true SC example trading system studies are simpler. For instance see the "TradingSystem.cpp" file's first study, "scsf_TradingExample". Anyway, considering you're discussing an actual built-in study I'd certainly expect it to work. Nothing is being sent to the Log.
I presume you're talking about the Message Log? Also, check the "Trade Activity Log" & "Trade Service Log" found under the "Trade" menu. |
[2022-03-18 23:11:51] |
User92573 - Posts: 547 |
Yes, I appreciate that. As they are not compiled I think of the ACS studies as examples. No, all logs are empty. I'm currently at loss but at least it "probably" explains why my own code is also not working. I had put that down to a misunderstanding on my part, but as the Sierra Study is also not working it is likely something else entirely. Any other thoughts gratefully received. In the meantime I'll go through everything yet again. I'm assuming that specific study is working for you? Many thanks |
[2022-03-18 23:49:39] |
1+1=10 - Posts: 270 |
As they are not compiled I think of the ACS studies as examples.
That's fair. I had put that down to a misunderstanding on my part, but as the Sierra Study is also not working it is likely something else entirely.
I can likely write a very simple example trading study faster than I can read and throughly understand SC's code. Especially because most ACSIL trading system don't have the point-and-click aspect to chose a price -- That study is really more intended for manual traders. What types of orders are you hoping to use? |
[2022-03-19 06:20:09] |
User92573 - Posts: 547 |
I think I need a few days away. So, the issue was that I'd incorrectly read the support information and then applied some flawed logic of my own when setting things up. I completed what seemed all of the necessary steps and then while going through the Trade menu rationalised that I would not need 'Auto Trading Enabled - Global' as I was only using that one test chart and thus, 'Auto trading Enabled - Chart' was the only option required (that simple). Automated Trading From an Advanced Custom Study: Debugging/Troubleshooting Automated Trading Systems
For the automated trading system study to be allowed to send orders whether simulated or non-simulated, it is also necessary to enable Trade >> Auto Trading Enabled. ... which is the information that registered Automated Trading Management: SendOrdersToTradeService
SendOrdersToTradeService This variable applies to the automated trading system it is set on. The default value for this variable is FALSE (No). Setting SendOrdersToTradeService to FALSE (No) will send all orders and order actions to the Sierra Chart Trade Simulation system. ... I'd already included this so I went straight back to the platform and applied my 'flawed logic' without reading the next snippet a few lines further down. However, the SendOrdersToTradeService automated trading management variable must be set consistently with the global Trade >> Trade Simulation Mode On setting on the menu, otherwise order actions will be ignored.
I spent a few hours reprogramming and rethinking all of my code but nothing seemed to work so I decided to use the actual ACS code from Sierra which didn't work either, hence the support request. To summarise. If the outcome is not as expected always re-read the excellent documentation thoroughly from start to finish before questioning your own work. Thank you for taking the time to reply. Very helpful. Date Time Of Last Edit: 2022-03-19 06:22:55
|
[2022-03-19 11:16:40] |
1+1=10 - Posts: 270 |
I completely understand! It is rare that you have independent menu items as well as configuration variables that all must be in alignment! The docs are comprehensive but definitely verbose. I definitely have to create checklists quite often. Have a great weekend! |
[2022-03-20 15:53:15] |
ForgivingComputers.com - Posts: 1021 |
However, the SendOrdersToTradeService automated trading management variable must be set consistently with the global Trade >> Trade Simulation Mode On setting on the menu, otherwise order actions will be ignored.
No need to manually keep the two in sync if you add this to your study: sc.SendOrdersToTradeService = !sc.GlobalTradeSimulationIsOn;
|
[2022-03-20 16:02:51] |
1+1=10 - Posts: 270 |
Good point, @bradh! Yes, I should have noted some/most/all? of the menu items have corresponding ACSIL variables.
|
To post a message in this thread, you need to log in with your Sierra Chart account: