Skip to content

Program 78 SEND DATA VERSION | Price volume peaks

P78SDV

Analysis of volume at chart price levels

Based on program 78, Program 78 SEND DATA VERSION (Program 78 SDV) uses a Global Dictionary to provide the chart price  levels (and color and style preferences) to another chart. In addition Program 78 SDV has been modified to use the HorizontalLine class rather than TrendLines and Drawing objects.  This has the added advantage of the program being simplified and easier to understand. The other functionality is almost identical to program 78.

Program 78 SDV is packaged with _Program78-READ_DATA_VERSION (Program78 RDV). This companion program reads the levels information from the Global Dictionary and draws the lines on a different chart.

Summary of Program 78 SDV functionality

Program 78 SDV estimates horizontal support and resistance lines based on the chart’s volume profile. The theory underlying Program 78 SV is that if significant volume has occurred at a specific price level then that level might have some significance as an area of support and/or resistance.

The Program 78 SDV volume profile calculation

The volume profile is stored in a dictionary. The closing price (converted to a string) is used as the index and the sum of volume for bars closing at that price is stored as its value.

When Program 78 SDV is first applied to the chart it populates the volume profile dictionary by counting back a user input number of bars (determined by the GoBackBars input) examining each bar. If there is not an index in the dictionary for a specific closing price, the closing price (converted to a string) and the volume are added to the dictionary. If the closing price is found in the dictionary, the volume of the newly found bar is added to the volume for this price.

Program 78 SDV applied to a Google momentum chart on the left. Date is received by Program 78 RDV and applied to a Google 5 minute chart on the right

At the close of each new bar the program stores the volume associated with that bar in a dictionary (PriceVolume) with a key of the closing price of the bar. If a key-value pair already exists in the dictionary for the price, the volume is added to the existing volume for that price.

Because we are only interested in the user input number of bars, after each new bar is formed the volume for the oldest bar stored in the dictionary is subtracted from the dictionary . If the volume for that price index is now zero, the price/volume pair is deleted from the PriceVolume dictionary.

For bars that are NOT tick/minute data nor an advanced chart type, e.g. daily, weekly, monthly charts the program uses Volume. For tick/minute data or an advanced chart type (Kagi, Renko, Kase etc), the program uses Ticks. For minute data you can set the “For volume, use:” field in the Format Symbol dialog to Trade Vol or Tick Count, as desired. When using advanced chart types, Ticks returns volume if the chart is built from 1-tick interval data.

Finding volume ‘pivots’

Once the volume profile dictionary is populated or updated, program 78 SDV looks for volume ‘pivots’. Referring to the image below, to qualify as a pivot there must be a user specified number of smaller bars above the pivot and below the pivot.

Once found these ‘pivots’ are stored in another dictionary (PriceVolumePivots). A vector of the keys for this new dictionary are then sorted by their volume values and the resulting price levels are drawn on the chart. The volume pivot with the highest volume is drawn using user inputs: Color1 and LineStyle1, the next highest is drawn using Color2 and LineStyle2 etc.

An image illustrating the volume profile and showing the top five volume profile pivots.
An image illustrating the volume profile and showing the top five volume profile pivots. The ‘y’ axis is price and the ‘x’ axis is volume. This image was created in a spreadsheet and this profile display functionality is not part of program 78 SDV or program 78 RDV. Note that each pivot has 3 lower values above and 3 lower values below.

In addition to drawing horizontal lines and labels on the chart to highlight the levels, the program also prints the information in the print log. This can be useful if a large number of bars were being analyzed and some of the horizontal lines were outside of the range of the chart.

New program functionality found in Program 78 SDV

Program 78 DSV. The sender chart (purple background) is sending data levels to the receiver charts (blue backgrounds)

The program puts the values of the levels into a Global Dictionary and keeps them updated at the close of each bar on the sending chart. The values can then be retrieved by another program (_Program78-READ_DATA_VERSION) and applied to one or more charts.

_Program78-SEND_DATA_VERSION and _Program78-READ_DATA_VERSION are available for immediate download for $145.95. The download is a TradeStation ELD file that includes the unprotected and commented program. This program will not work in MultiCharts because it uses the TradeStation collections and other functionality that is not available in the MultiCharts environment.

Make sure that the ShareRef user input is the same for  _Program78-SEND_DATA_VERSION and _Program78-READ_DATA_VERSION for a pair of charts that you wish to share levels.

Video

Program 78 includes 3 user exceptions
  • If the TopVolPivots input is greater than 20
  • If the LineThickness input is less than 0 or greater than 6
  • If the number of bars loaded for the symbol is less than the GoBackBars user input.

Inputs

Program 78 SDV

int TopVolPivots( 5 ), // The total number of lines to be drawn, with the highest occurrence values. TopVolPivots can be a positive integer up to 20
int Strength( 3 ), // Strength of pivots

int GoBackBars( 100 ), // The number of bars to store in the volume vector

// Define colors for lines
string Color1( “Red” ),
string Color2( “Magenta” ),
string Color3( “Green” ),
string Color4( “Cyan” ),
string Color5( “Yellow” ),
string Color6( “White” ),
string Color7( “White” ),
string Color8( “LightGray” ),
string Color9( “LightGray” ),
string Color10( “LightGray” ),

// Define line styles for lines
int LineStyle1( 0 ),
int LineStyle2( 1 ),
int LineStyle3( 2 ),
int LineStyle4( 3 ),
int LineStyle5( 4 ),
int LineStyle6( 5 ),
int LineStyle7( 6 ),
int LineStyle8( 0 ),
int LineStyle9( 1 ),
int LineStyle10( 2 ),

int LineThickness( 1 ), // Defines thickness of lines. LineThickness can be a positive integer up to 6
bool Print_Dialog( True ), // If set to TRUE, line information is printed in the print dialog

// Inputs added to _Program78-SEND_DATA_VERSION
string ShareRef( “Send1” ); // Unique name to differentiate the Global Dictionary

Program 78 RDV

string ShareRef( “Send1” ); // Unique name to differentiate the Global Dictionary

Technical architecture

Program 78 SDV and Program 78 RDV provide coding examples of:

  • vectors, dictionaries, and the global dictionary
  • the global dictionary update event
  • sorting vectors
  • horizontal drawing objects
  • creating user exceptions

THESE 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, 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.