Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 14:24:36 +0000



[Programming Help] - ACSIL function

View Count: 353

[2023-07-30 20:19:27]
User373245 - Posts: 42
Do anyone know how to Set the BUY or SELL In ACSIL from a simple alert ID label. Rather than rebuild my Algo on source code to ACSIL in automated trading. I would like to just load the ID lable from the simple alert and have that be the buy or sell function that triggers the buy or sell order. Can I just grab the study from get study function or build a boolean of sorts. No sure quite how to go about this?
[2023-07-30 22:34:16]
emmanuel - Posts: 58
If you have an alert formula for your trade signals, you can use it with the "Trading System Based on Alert Condition" study to submit trades. Then you wouldn't need to use ACSIL.

If you must use ACSIL, then:

1. Create a study (more specifically a subgraph) which provides the trade signals. Ideally, the study should emit one of three values; Ex. 0 = do nothing, 1 = go long, -1 = go short.
2. In your ACSIL code use sc.Input[].SetChartStudySubgraphValues (ACSIL Interface Members - sc.Input Array: sc.Input[].SetChartStudySubgraphValues()) to add an input for the study providing the trade signals.
3. Load the values from the trade signals study using sc.Input[].GetChartStudySubgraphValues() (ACSIL Interface Members - sc.Input Array: sc.Input[].GetChartStudySubgraphValues()) into a SCFloatArray.
4. Use array indexing to read the value from the array. See https://www.sierrachart.com/index.php?page=doc/ACSIL_Members_scSubgraph.html#scSubgraphArrays.
5. You can then trigger your trades based on the signal found in the Subgraph array. This example shows how to use a study Subgraph as an input to a ACSIL study: Example ACSIL Trading Systems

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

Login

Login Page - Create Account