Learn
Scripting Tips and Tricks
Improving backtest performance by hiding plots
before you run your script live or backtest it, you might decide to hide all of your plots this will lead to improved performance since the script processing engine will not need to plot every backtest what is commenting out your plots? simply put, commenting out your plots is putting "//" in front of the line of code, so it doesn't get read by the script processing engine this line is not commented plot(close, "close", "#ff0000") this line is not commented //plot(close, "close", "#ff0000") how can i hide the plots with a single variable? by adding the section of code that has been given below, all you will need to do is turn the input to true or false if its true, then all of your plots will be shown, if it is false, then the plots will be hidden enable plotting = boolinput("show plots?", false) // wrap all plot() inside the if statement if (enable plotting) { plot(close, "close", "#ff0000") plot(open, "open", "#00ff00") plot(high, "high", "#0000ff") }