CodeForTraders

...writing great code so you don't have to

TS Functions

TradeStation Functions

Functions give you information where you need it.  If an indicator or a strategy needs a value, or especially when both an indicator and a strategy need a value, functions are the convenient, consistent way to calculate and provide it.

Functions help keep strategies from becoming hundreds or thousands of lines long.  When code is "pushed down" into a function, the upper-level indicator or strategy becomes streamlined and easier to read, understand, and maintain.

Functions help you to avoid cutting and pasting the same code block all over a bunch of indicators and strategies.  Also, when critical code is placed into a function, any fixes or improvements need only be done in one place - in the function - in order to be available in all the strategies and indicators which use that function.

Wise use of functions is one of the key signs of growing sophistication and comfort in the EasyLanguage environment.

The right functions make the difficult easy.  Functions can:

  • fill higher-level arrays with historical values
  • ensure that indicators and strategies agree exactly on a calculation
  • save you alot of time compared to repetative cut-and-paste

Below are the functions and function-related products currently available for TradeStation..   There will be more to come.

GenSavePvtsArrXX.p -  This function is used to help another technique to save the pivot points of a numeric series (i.e. pivots of a price or indicator value).  For each pivot, we save: price, date, time, barnumber, and volume.  Many intermediate and advanced trading system ideas require knowledge of previous pivot points.  Kickstart your ability to work at higher level by putting this function to work for you today.

Money Management 01 -  This function offers 7 different methods for calculating the size of each new trade according to the progress of your account equity and your tolerance for risk. 

ModHA for ADE - This function performs the ModHA calculation on ADE data, returning information about trends and consolidations.