TradeStation EasyLanguage Tutorial 178 uses ELCollections to share a text string with another chart that uses
the same interval setting, but not necessarily the same symbol. Even through the same results could be obtained using GlobalDictionary in TradeStation, this is not available in MultiCharts whereas ELCollections works in both TradeStation and MultiCharts.
In this simple example, when a fast moving average crosses the slow moving average on the sending chart text is added to the chart (depending on whether the fast moving average crossed below or above the slow moving average.) A number is calculated representing the bar (BarStamp) and this number is added to a ‘Map’ together with a string. A Map associates keys and values. A key is a piece of data for which you want to store an associated value.
On the receiving chart the receiving program checks if there is an entry for the current bar (using the BarStamp
calculated in the same way as on the sending chart). If it exists the string is drawn on the chart.
Finally, if a cross has not occured the program removes any entry using the BarStamp of the current bar. This is
in case a cross occurred during the bar and entry was made in the Map, but then subsequently, the moving averages ‘uncrossed’ each other.
The sender only writes data to the map when there is a tick on the chart it is applied to. Similarly the receiving
program only reads from the map when there is a data tick on the chart it is applied to.
With more data more drawing objects will be added to the chart. The program does not include any mechanism for limiting the number of drawing objects.
In the above images the ‘sender’ chart is on the left and the receiver chart on the right.
Download tutorial 178 TradeStation EasyLanguage code for Gold Pass members
If you are a Gold Pass member you can copy the tutorial code below, please make sure that you are logged in with your Gold Pass user name and password.This content is for members only.
THE TRADING APPS, INDICATORS, SHOW ME STUDIES, STRATEGIES AND OTHER PROGRAMS HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES.
TO THE BEST OF MARKPLEX CORPORATION’S KNOWLEDGE, ALL OF THE INFORMATION ON THIS PAGE IS CORRECT, AND IT IS PROVIDED IN THE HOPE THAT IT WILL BE USEFUL. HOWEVER, MARKPLEX CORPORATION ASSUMES NO LIABILITY FOR ANY DAMAGES, DIRECT OR OTHERWISE, RESULTING FROM THE USE OF THIS INFORMATION AND/OR PROGRAM(S) DESCRIBED, AND NO WARRANTY IS MADE REGARDING ITS ACCURACY OR COMPLETENESS. USE OF THIS INFORMATION AND/OR PROGRAMS DESCRIBED IS AT YOUR OWN RISK.
ANY EASYLANGUAGE OR POWERLANGUAGE TRADING STRATEGIES, TRADING APPS, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (AND PARTS THEREOF) AND ASSOCIATED TECHNIQUES REFERRED TO, INCLUDED IN OR ATTACHED TO THIS TUTORIAL OR PROGRAM DESCRIPTION ARE EXAMPLES ONLY, AND HAVE BEEN INCLUDED SOLELY FOR EDUCATIONAL PURPOSES. MARKPLEX CORPORATION. DOES NOT RECOMMEND THAT YOU USE ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS (OR ANY PARTS THEREOF) OR TECHNIQUES. THE USE OF ANY SUCH TRADING STRATEGIES, SIGNALS, STUDIES, INDICATORS, SHOWME STUDIES, PAINTBAR STUDIES, PROBABILITYMAP STUDIES, ACTIVITYBAR STUDIES, FUNCTIONS AND TECHNIQUES DOES NOT GUARANTEE THAT YOU WILL MAKE PROFITS, INCREASE PROFITS, OR MINIMIZE LOSSES.