Login Page - Create Account

Support Board


Date/Time: Tue, 06 May 2025 20:12:57 +0000



[Programming Help] - Can I disable “IsAutoTradingOptionEnabledForChart” in ACSIL?

View Count: 171

[2024-12-06 11:17:53]
gambcl - Posts: 9
I would like to write a study which acts as a generic watchdog for auto trading in a chart.

If certain conditions are met I would like to disable auto-trading for the current chart.

I have seen that there is a property IsAutoTradingOptionEnabledForChart for checking if
auto trading is enabled for the current chart, but is it possible to change this value at all?
[2024-12-06 12:30:00]
emmanuel - Posts: 62
No, that property is read-only. I haven't seen a way to change the auto-trading status from ACSIL, which is very likely on purpose.

Alternatively, you can have your watchdog study produce a subgraph with a known value (ex. 1) when auto-trading should be disabled. Then, you can have your trading studies read the value using `sc.Input[n].GetChartStudySubgraphValues()` and automatically disable themselves.

In fact, a good way to do it is have a trading study disable itself if the input value is non-zero. That way, you can set the default like this: `sc.Input[n].SetChartStudySubgraphValues(sc.ChartNumber, 0, 1)` which if I recall is the open price; Since the open price is unlikely to be 0, the trading study would be disabled by default.
[2024-12-06 12:38:50]
gambcl - Posts: 9
OK thanks.

The problem is that I won’t necessarily have the source code to the trading study, which is why I wanted to build a generic tool that could disable any study from auto-trading.

Sierra guys, is there any chance we can get a method to disable a chart’s auto-trading?

I can understand not giving ACSIL access to enable auto-trading for security reasons, but being able to disable auto-trading would be a useful feature.
[2024-12-06 14:43:14]
Sierra_Chart Engineering - Posts: 19461
You are able to lock trading:
ACSIL Interface Members - Functions: sc.SetTradingLockState()
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
[2024-12-06 16:40:43]
gambcl - Posts: 9
Yes I know, but that will stop trading on ALL charts won’t it?

I am trying to run auto-trading on multiple charts, each trading a separate account.

That’s why I would like to be able to stop auto-trading only on the specific chart
where my watchdog study instance is running, then I can add my watchdog study on each chart
and have them disable individually.

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

Login

Login Page - Create Account