Skip to content

Program 74 | Convergent Fibonacci levels from lines drawn with the drawing tool | GlobalDictionary Edition

Convergent Fibonacci Levels Placed In Global Dictionary

Program 74 GlobalDictionary Edition allows a user to draw trend lines on a chart with the drawing tools (the green line above), for which Fibonacci retracement levels are automatically calculated and drawn (the white dotted lines). This ‘sending’ program is a Show-me study named:  _Program74_GDictVer.

As new trend lines are added, the program calculates when the Fibonacci levels (the white dotted lines) relating to the drawn lines are ‘convergent’ (close to each other according to a user input). The convergent lines are drawn on the chart (the thicker yellow lines) and their price levels are stored in the GlobalDictionary.

A separate receiver program (_Program74_GDictVer_Rec, an Indicator) reads the information from the GlobalDictionary and draws lines on charts where it is inserted. In the above image the receiving chart is the chart with a white background and the lines, corresponding with the yellow lines on the sending chart, are drawn in purple.

The ‘sending’ and ‘receiving’ programs are coordinated by the use of a user input: UniqueName. This means that, so long as different UniqueName values are used, it is possible to have several different sending and receiving charts. It is also possible to have a sending chart ‘sending’ levels data to two or more ‘receiving’ charts.

In the image the left chart (the sending chart) is a 60 minute @ES chart. On the chart on the right (the receiving chart) is plotted 5 minute @ES. More horizontal lines can be seen on the chart on the left because the scale is broader.
In the image the left chart (the sending chart) is a 60 minute @ES chart. On the chart on the right (the receiving chart) is plotted 5 minute @ES. More horizontal lines can be seen on the chart on the left because the scale is broader.

A previous program: _Program74V1.1 uses the GlobalVariable.DLL to share data between 2 charts. This approach required that users visited the TradeStation forum and downloaded and installed the latest version of the GlobalVariable.DLL and store it on their computer. Since this DLL was released, the GlobalDictionary became available.

GlobalDictionary gives a programmer the ability to create a collection of key/value pairs without installing additional software. This data in the key/value pairs can be shared between EasyLanguage analysis techniques and strategies. GlobalDictionary can be configured in two ways: to share values within the same window type and to share with additional window types. This new program (_Program74_GDictVer) uses the GlobalDictionary and means that the user no longer has to install the GlobalVariable.DLL but uses a capability that is already built into TradeStation.

Link
One sending and two receiving charts
One sending and two receiving charts

Video explanation of Program 74 Global Dictionary version

Download Program 74 (Global Dictionary Edition) AND the Program 74 (GlobalVariable.DLL Edition)

Program 74 (Global Dictionary Edition) AND Program74 (GlobalVariable.DLL version) (the sender and receiver programs and the related function) are available for  IMMEDIATE download for $84.95  by clicking the following ‘add to cart’ button.

These TradeStation EasyLanguage programs are fully functional and unprotected, i.e. you can see the source code.

After download the program can be opened, you will be able to see the program code and modify it. After purchase you will be redirected to a download page, so don’t close the browser.

Note that the program 74 package was developed for TradeStation 9.5 and above and is not compatible with MultiCharts.

The download consists of an ELD that includes this program: _Program74_GDictVer and _Program74_GDictVer_Rec. It also inclueds _Program74V1.1 and _Program74V1.1-Receiver. These were the programs originally included with the GlobalVariable.DLL version of program 74.

Inputs

The inputs for the sending program: _Program74_GDictVer are 

double ProximityVal( 1 ), // Filter horizontal lines to leave only the ones that are within this value to each other
string UniqueName( “List” ), // Unique name used for key in global variable. Make sure this is the same string as used in the receiving chart

// Color the trend line drawn
string TLColor( “Green” ), // Set the trendlines to this color

// Style the Fib lines
string FColor( “White” ), // Set the color of the Fibonacci lines
int FWeight( 0 ), // Set the weight of the Fibonacci lines

// Style the convergence lines
string CColor( “Yellow” ), // Set the color of the convergence lines
int CWeight( 3 ); // Set the weight of the convergence lines

The inputs for the receiving program: _Program74_GDictVer_Rec are

string UniqueName( “List” ), // Unique name used for key in global variable. Make sure this is the same string as used in the sending chart
string FColor( “White” ), // Set the color of the horizontal lines
int FWeight( 3 ); // Set the weight of the horizontal lines

Link
Program 74 with a momentum bars sending chart and Kagi and Line Break receiving charts
Program 74 with a momentum bars sending chart and Kagi and Line Break receiving charts
Link
The sending chart with one trendline drawn (in green). The Fibonacci levels are the white dotted horizontal lines.
The sending chart with one trendline drawn (in green). The Fibonacci levels are the white dotted horizontal lines.
Link
The same chart with two trendlines (in green) added. More Fibonacci levels are drawn and the program calculates lines that are at the same level, or close. These are highlighted in yellow.
The same chart with two trendlines (in green) added. More Fibonacci levels are drawn and the program calculates lines that are at the same level, or close. These are highlighted in yellow.
Link
The sending and receiving charts. The yellow lines on the sending chart are transferred to the receiving chart (on the right).
The sending and receiving charts. The yellow lines on the sending chart are transferred to the receiving chart (on the right).

Programming techniques used in the programs

  • Programmatically retrieve data about trendlines drawn with the drawing tools
  • Add a click event to a trend line drawn with the drawing tools
  • Detect when a trend line is clicked
  • Create and use vector
  • Draw horizontal lines
  • Store horizontal lines in a vector
  • Store a vector in the tag of the trend line
  • Store levels in a vector which is, in turn, stored in the Global Dictionary
  • Style trend lines and horizontal lines
  • Use the _VectorQuickSort function
  • Generate an exception of inputs values are incorrect

  • Retrieving data from the Global Dictionary
  • Deleting and creating horizontal lines
  • Using the timer

Styling options

On the sending chart, the trendline (i.e. the line you draw manually) can be styled for color using the TLColor input. The horizontal lines that show the calculated Fibonacci levels can be styled for color and weight by FColor and FWeight respectively. The convergent lines can be styled for color and weight by CColor and CWeight respectively.

On the receiving chart, the horizontal lines can be styled for color and weight by FColor and FWeight respectively.

A StopCalculationException is generated if FWeight or CWeight are not acceptable values. Make sure FWeight and CWeight inputs are between 0 and 6.

Color options

AliceBlueDarkSlateGrayLightSalmonPaleVioletRed
AntiqueWhiteDarkTurquoiseLightSeaGreenPapayaWhip
AquaDarkVioletLightSkyBluePeachPuff
AquamarineDeepPinkLightSlateGrayPeru
AzureDeepSkyBlueLightSteelBluePink
BeigeDimGrayLightYellowPlum
BisqueDodgerBlueLimePowderBlue
BlackFirebrickLimeGreenPurple
BlanchedAlmondFloralWhiteLinenRed
BlueForestGreenMagentaRosyBrown
BlueVioletFuschiaMaroonRoyalBlue
BrownGainsboroMediumAquamarineSaddleBrown
BurlywoodGhostWhiteMediumBlueSalmon
CadetBlueGoldMediumOrchidSandyBrown
ChartreuseGoldenrodMediumPurpleSeaGreen
ChocolateGrayMediumSeaGreenSeashell
CoralGreenMediumSlateBlueSienna
CornflowerBlueGreenYellowMediumSpringGreenSilver
CornsilkHoneydewMediumTurquoiseSkyBlue
CyanHotPinkMediumVioletRedSlateBlue
DarkBlueIndianRedMidnightBlueSlateGray
DarkBrownIndigoMintCreamSnow
DarkCyanIvoryMistyRoseSpringGreen
DarkGoldenrodKhakiMoccasinSteelBlue
DarkGrayLavenderNavajoWhiteTan
DarkGreenLavenderBlushNavyTeal
DarkKhakiLawnGreenOldLaceThistle
Dark MagentaLemonChiffonOliveTomato
DarkOliveGreenLightBlueOliveDrabTurquoise
DarkOrangeLightCoralOrangeViolet
DarkOrchidLightCyanOrangeRedWheat
DarkRedLightGoldenrodYellowOrchidWhite
DarkSalmonLightGrayPaleGoldenrodWhiteSmoke
DarkSeaGreenLightGreenPaleGreenYellow
DarkSlateBlueLightPinkPaleTurquoiseYellowGreen

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.