The GRAPHONPRICE instruction lets you display the values of variables you use in your ProBacktest program (“myvariable” in the example below) at the close of each bar on the price chart.

Syntax:

It can be useful to monitor the levels of some variables in your program to better understand the program’s results. When a GRAPHONPRICE instruction is used in your code, the variable will appear on your price chart.

GRAPHONPRICE instructions can also be ‘coloured(R,G,B,alpha)’ like any other variable returned as a graphical object.

Example 1: 

Plot indicators on chart directly from your ProBacktest program:

The below code will plot daily Bollinger Bands indicator on the default chart (the chart currently opened).

Example 2:

4 hours and 1 hour indicators plotted on the current chart:

Related entries

Share this