Relative Content

Tag Archive for pine-script-v5

How to close all open trades on current candle when backtesting?

When working with Pinescript v5 in TradingView, how can I close all open trades on the current candle when backtesting? I would like to have a checkbox to activate such a “close all open trades for backtesting purposes” feature and tried several different approaches, but none worked.

How to add numerical values ​calculated from pine Script custom strategy to “Performance Summary”

AvgLongFirstDayLabel := label.new(bar_index, low – 10, text = “出现做多信号之后X天可以盈利:” + str.tostring(LongAvgFirstDay), style=label.style_label_up, color=color.rgb(255, 110, 110), size=size.normal) I wrote a strategy and calculated the value of “the first profit can be made on X day after the long signal appears”. Now I use a label to display this label on the last K line. I want […]