This code snippet demonstrates how to use the `GRAPHONPRICE` function in ProBuilder to display multiple timeframe indicators on a single price chart. It includes examples of daily and hourly moving averages and Bollinger Bands.
timeframe(daily)
ema20daily = average[20,1]
bolupdaily = BollingerUp[20](close)
boldndaily = BollingerDown[20](close)
timeframe(default)
a = 0
if a>0 then
buy at market
endif
// --- PLOT MTF INDICATORS ON PRICE CHART
graphonprice ema20daily coloured(200,200,0) as "E"
graphonprice bolupdaily coloured(0,200,0) as "Bollinger Up daily"
graphonprice boldndaily coloured(0,200,0) as "Bollinger Down daily"
TIMEFRAME(Daily,updateonclose)
MediaGiorno = average[50,0](close)
TIMEFRAME(1 hour,updateonclose)
MediaOraria = average[50,0](close)
TIMEFRAME(default)
buy at -close limit //istruzione inutile, ma richiesta da ProBackTest
GraphOnPrice MediaGiorno coloured(255,0,0,255) AS "MediaG"
GraphOnPrice MediaOraria coloured(0,128,0,255) AS "MediaO"
Explanation of the Code:
This example is useful for understanding how to manage multiple timeframes and visualize various technical indicators on a single chart using ProBuilder’s capabilities.