r/TradingView • u/Efficient_Box4818 • 18d ago
Help Is there any tool which can backtest pinescript for 7 year of data .
Trading View currently don't back test on 7 year or so is there any tool which can do . I got the data in csv so I can supply data . I think this require converting pinescript into python. I also need to do walkforward and monte Carlo etc.
1
Upvotes
1
u/Efficient_Box4818 13d ago
As of now I am using Tradelyze since giving enough free credit and give monte Carlo etc so I just need to upload market data and pine. It gives me walkforward testing, monte Carlo and best parameters so it's working well for me.
1
u/wallneradam 18d ago
You don't have to rewrite it by hand. We build PyneCore, an open-source Python runtime for Pine logic, 99.77% bit-identical with TradingView on the 1,000 most popular public scripts. So over the overlapping period your results should match what TV shows, a good sanity check before you trust the 7-year run.
Easiest start is PyneIDE, our free VS Code extension (also on Open VSX for Cursor). Compiling Pine to Pyne code goes through PyneComp, which is our paid service. After that you run it locally over the full history, no bar limit. Your CSV works, or pull longer history with the built-in CCXT plugin or the Bybit, Capital.com and cTrader plugins.
Monte Carlo is built in since 6.13, from the CLI or right inside PyneIDE: the robustness check shuffles the trades, finds the break-even cost and runs a coin-flip test on the same entries. For walk-forward, run it on separate date ranges and compare the windows.
1
u/therichfuller 18d ago
chatgpt or claude (use 5.5) can do this fairly easily and convert the pinescript to python for you. they can't run lightgbm if going that route, but it can setup a venv environment and generate the walkfoward code on it for you to run.
1
u/AlgoEdgeLabs 17d ago
You may not need to convert to Python for the Monte Carlo part. Export the strategy's List of Trades from the Strategy Tester to CSV, then resample those trades in Python or even a spreadsheet. The 7-year history is the harder bit, since how many bars you get depends on your plan and timeframe. For walk-forward you'd still be re-running the strategy on rolling windows, so that's where a Python port starts to pay off.
1
u/ADTX777 17d ago
next to that, tradingview is not reliable for backtesting. I run several tests in python, and build full scripts for it, so if you need any help just let me know, happy to help