PROTECTED SOURCE SCRIPT
Study Backtester [MS]

Backtest your study like a strategy with our Study Backtester. Visualize your script's performance directly on the chart.
Simple to use, copy-paste a few lines of code (shown below) into your script, then set your script as input to the Study Backtester.
Visualize how your script performs against buy-and-hold over time, and get a nice print out of stats.
Settings
Version 1
Things To Note
How To Use
1) Add the following to the bottom your study's code.
//------------------------------------------------------------------------------
// FOR BACKTESTER
plot(buy ? 1 : sell ? -1 : na, title="Signals", display=display.none, editable=false)
2) Make sure `buy` and `sell` variables are assigned appropriately according to your strategy.
3) Add both your study and this script to your chart.
4) Set the "Signals Plot" setting of this script to: <your_study_name>: Signals
5) Adjust this script's settings (start date, commission, stoploss, etc) as necessary.
PM us with any questions about this script.
Simple to use, copy-paste a few lines of code (shown below) into your script, then set your script as input to the Study Backtester.
Visualize how your script performs against buy-and-hold over time, and get a nice print out of stats.
Settings
- Set your buy and sell signal inputs
- Add a stop loss
- Choose normal or trailing stop loss
- Choose the start date and time for backtesting
- Set trading commissions
- Use leverage or not
- Set carry cost for leveraged trades
Version 1
- Only supports buy-sell-buy-sell alternating signals. Any non-alternating signals will be ignored.
- Testing begins with 1 share of the asset at your first buy signal.
Things To Note
- This cannot enter or exit mid-candle. With the exception of the stop loss feature, which will calculate exits at the exact stop price.
- Stops are not treated as stop-orders, but as market-exists at the stop (or trailing stop) price.
- This DOES NOT take into account any loss of funds due to liquidation if price goes against you in a margin position.
- Short positions are not currently supported.
- Only `study` scripts are supported
How To Use
1) Add the following to the bottom your study's code.
//------------------------------------------------------------------------------
// FOR BACKTESTER
plot(buy ? 1 : sell ? -1 : na, title="Signals", display=display.none, editable=false)
2) Make sure `buy` and `sell` variables are assigned appropriately according to your strategy.
3) Add both your study and this script to your chart.
4) Set the "Signals Plot" setting of this script to: <your_study_name>: Signals
5) Adjust this script's settings (start date, commission, stoploss, etc) as necessary.
PM us with any questions about this script.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
For script access or PineScript questions, please visit our site:
marketscripters.com?utm_source=tradingview&utm_medium=signature
marketscripters.com?utm_source=tradingview&utm_medium=signature
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
For script access or PineScript questions, please visit our site:
marketscripters.com?utm_source=tradingview&utm_medium=signature
marketscripters.com?utm_source=tradingview&utm_medium=signature
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.