Skip to content

Quick-tip 45 | How to communicate to a receiving program that a sending program has been turned off

A Gold Pass member asked the following question based on a situation where he was using the Global Dictionary to share information between two charts (chart A and chart B): “If I disable the indicator in chart A, its last  computed amount remains in the global dictionary and the indicator in chart B continues plotting that last computed value. How can I communicate to chart B when an indicator is disabled or removed on chart A?

Information being shared between chart A (white background) and chart B (blue background)

Quick-Tip 45 uses two programs, a sending program (on Chart A) and a receiving program (on Chart B):

  • the sending program: _QuickTip45-Send
  • the receiving program: _QuickTip45-Receive

The sending program stores two moving averages in a Global Dictionary. The receiving program reads the information from the Global Dictionary and plots it. If the sending program’s status is set to ‘off’ the receiving program continues to plot the last value.

_QuickTip45-receive continuing to plot the last value after the sending program was turned off

This quick tip demonstrates how the sending program can communicate to the receiving program when it is un-initialized. The un-initialize event is used to change a value (“OnOff”) in the Global Dictionary to 0. This value is read by the receiving program. Watch the following video to understand the EasyLanguage syntax.

The receiving program no longer plots after the sending program was un-initialized
Quick-tip 45 is based on a slimmed down version of tutorial 161 with several modifications. It is an example of the use of TradeStation’s Global Dictionary. In this quick-tip the values of two moving averages are stored in a vector which is in turn stored in a GlobalDictionary. The corresponding receiver program reads the Global Dictionary to get the vector which contains the values that are plotted on the receiver chart.

Video explanation

Quick-tip 45 download

If you wish to save yourself some time by not having to type in the example programs, the Quick-tip 45 tutorial programs are available for IMMEDIATE download for $24.95. Click the ‘add to cart’ button below. After purchase you will be redirected to a download page, so please don’t close the browser until you have downloaded the program.

After download the programs can be opened, you will be able to see the program code and modify it if you wish.

Note: The program name begin with an underscore, so it will be towards the start of the list if you sort alphabetically.

_Quick-tip45 was developed for TradeStation 9.5 update 15 and above. It will not work with MultiCharts.

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.