Instruction to display the historical values of ProBacktest variables on charts. It can be use many times on the same ProBacktest strategy, all values will be displayed on the same window chart.
Syntax :
1 |
GRAPH myvariable AS "my variable" |
GRAPH instructions can also be ‘coloured(R,G,B)’ like any other variable returned as a graphical object.
Example :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
myMACD = MACD[12,26,9](close) long = myMACD crosses over 0 if(MACD>0) THEN signals = 1 ELSE signals = -1 ENDIF IF long THEN BUY 1 LOT AT close+10 LIMIT ENDIF SET STOP %TRAILING 0.5 GRAPH signals coloured(255,0,0) AS "MACD signals" |
Is there an alternative code for “Graph” in version 11.0
No, still the instruction needed to debug your strategy’s code.
Is it possible to execute graph in a loop? I can’t get it work because of AS “xxx”
Never used in a loop but i dont think so!
I would appreciate in a upgrade a new instruction : graph… at (X,Y) which act as drawtext where X could be Barindex or variable used with Anchor and Y any kind of number (for example low – ticksize). Because graphonprice only displays a curve