Skip to content

Tutorial 191 | Information panel based on daily data

T191

Tutorial 191 demonstrates how to create a program to display a panel of information about another symbol.

The information displayed includes the symbol name, closing price, daily volume and the Relative Strength Index (RSI) calculated using daily data from a Price Series Provider (PSP). In this example the indicator is applied 5 times as part of a ‘study group.’

The program uses the PSP to provide the data for a symbol different from the charted symbol. The tutorial also demonstrates a way of calculating the RSI value using this PSP data.

PSP chart/coordination

Note: PSPs do not expose any historical data after the datetime of the current bar being processed in a chart. As new historic bars are processed, more data may be exposed. This is to prevent the study from “looking into the future.” No events are raised for historic data.
Link
Tutorial 191 applied to a 5 minute @NQ chart 5 times.
Tutorial 191 applied to a 5 minute @NQ chart 5 times.

Technical lessons

Technically, the tutorial program 91 is based around a price series provider (PSP). Because we are interested in daily information about a symbol, the PSP is the simplest way of achieving this. The PSP and an associated event were originally created using the toolbox and then the code copied from the ‘designer generated code.’ The calculation is similar to the standard RSI function, however care needs to be taken about the calculation that occurs at the end of each PSP bar. The tutorial program also demonstrates how to create a label and how to keep it stationary relative to the chart frame.
Note that the chart is divided in 50ths vertically. This number is multiplied by this fraction to position the string vertically from the top. E.g. 1, 2, 1.2, 3.5, 4 etc. This number is entered as VertPosition
Note that the chart is divided in 50ths vertically. This number is multiplied by this fraction to position the string vertically from the top. E.g. 1, 2, 1.2, 3.5, 4 etc. This number is entered as VertPosition

Explanation of tutorial 191

Overview and summary of the tutorial code

Tutorial 191 demonstrates how to create a program to display a panel of information about another symbol. The information displayed includes the symbol name, closing price, daily volume and the Relative Strength
Index (RSI) calculated using daily data. The program uses the Price Series Provider (PSP) to provide the data for another symbol. The tutorial also demonstrates a way of calculating the RSI value using this PSP data.

The PSP was initially setup by dragging the PSP component from the toolbox into the component tray. The various values were then modified and ‘update’ and ‘state changed’ events were created. Finally the code that
had been automatically generated in the designer generated code was copied into the program. The setup of the PSP was put in a ‘Once’ statement. The update event was modified to calculate an update for the RSI value for each new price tick.

A method to draw the text label was created in a similar way. The label was originally dragged from the toolbox into the component tray and then the code copied from the designer generated code.

The main calculation of the RSI is done when there is sufficient data in the PSP. For symbols where the last date on the chart is the current data the calculation is done for all the bars except for the last bar. The RSI is then recalculated and updated for each new tick in the PSP.

For symbols where the last date on the chart is not the current date, all the PSP bars are used to calculate the RSI.

Finally, with each tick the position of the label is checked and adjusted to ensure that it stays in the same place relative to the top right hand corner of the chart.

The tutorial program is designed to run on continuous symbols.

Hopefully you can understand this tutorial and replicate it for your own use and education. If you want to save some time typing in the code then the Tutorial 191 indicator is available for  IMMEDIATE download for $24.95  by clicking the following ‘add to cart’ button. 

The tutorial is NOT compatible with MultiCharts.

The image shows a workspace for tutorial 191. The charts with a white background are daily charts with the RSI indicator applied. These are useful in checking the calculation of tutorial 191. They will be slight differences in the timing.
The image shows a workspace for tutorial 191. The charts with a white background are daily charts with the RSI indicator applied. These are useful in checking the calculation of tutorial 191. They will be slight differences in the timing.

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.