Login Page - Create Account

Support Board


Date/Time: Mon, 23 Jun 2025 09:00:48 +0000



Post From: [STRATEGY][AUTOMATE] How to automate my strategy into Sierrachart ?

[2022-03-04 15:32:03]
ForgivingComputers.com - Posts: 1071
Im a programmer (php, js, c+ etc..) but my problem here is find variable names like how to get the value of the last candel, the lenght of it wick etc..

Just about everything you are looking for will begin with sc. or SC_ or SC telling you it is part of the API.

For example:
Value of Last Candle:
float LastPrice = sc.BaseData[SC_LAST][sc.Index];

Length of upper wick:
float UpperWickSize = sc.BaseData[SC_HIGH][sc.Index] - fmax(sc.BaseData[SC_OPEN][sc.Index], sc.BaseData[SC_CLOSE][sc.Index]);

sc.BasaData is a two-dimensional Array with the OHLC of the bar, and sc.Index is the number of the bar, starting with 0 at the left of the chart.

The c:\sierrachart\acs_source folder has copies of the source code used to make almost all of the studies available with vanilla Sierra Chart. You can learn a lot by walking through some of the examples.

Note: The search function on the website is not the best, you are often better off searching Google with "site:sierrachart.com" along with your search string.