DLLs, Spreadsheets, and How Study Timing and Precedence Matter

Ever noticed that the Sierra Chart study settings window has some information in it that looks like this:


S3 V3 Study Settings Shifted over

Each study has a time in ms (milli-seconds) and a CalcOrder or Calculation Precedence. The time represents the relative impact of each study, and the calculation order, the sequence they are exectuted in.

Each study is a function or subroutine that is called multiple times a second, and the time it takes to do that is important if you want your study to make a trading decision in the shortest amount of time.  The order in which the study is called is also important, as many studies rely on the results of other studies, and in order to get the latest results, you don’t want a study that needs data from another study to run at the top of the list, as it may end up getting old or incorrect data. 

The placement of the custom study functions in the list is predetermined to optimize the timing and precedence of the information needed. Non-essential studies are moved below the custom studies, as no automated decisions are being based on them. 

Note that Sierra generally calculates the precedence based on the studies themselves. Each built-in study as a Standard, Low, or Very Low Precedence. In general you can change the precedence of a study by moving it up or down the list.

One of the studies with very low precedence is the Spreadsheet System for Trading Study. It sees the output of all the studies that do calculations, so it automatically comes later than a DLL based custom study/system that does not need all data, just the data it cannot get internally which it gets from other studies on the chart. The DLL ends up running with a lower ms timing, and earlier in the list than a spreadsheet. However, Sierra Chart does not automatically determine what data the custom function relies on upon determining the proper CalcOrder for a study.  It is therefore important not to move studies up or down without recognizing the impact that change may have on the accuracy and performance of the custom studies.