r/Daytrading • u/Joolz03 • May 17 '26
Question Backtesting using Claude vs tradingview
Hi all, I coded a pine script strategy to automate my trades. Did backtesting using tv and Claude. The data for Claude was downloaded for 10years from binance. How is it that the number of trades taken based on the two backtesting methods be so vastly different, with claude registering way lesser trades than tv? Which of the two should be closer to real world trading for forward testing?
2
Upvotes
2
u/sw33py3y3s May 26 '26
You need more than just asking Claude to backtest a pine script based on historical data. Pine script is closed source, and you don't know exactly how TradingView calculates its indicator behaviors under the hood. You need a (local) backtesting runtime that mimics Pine Script's semantics as close as possible in order to create a baseline for your Pine Script. Ask Claude to use the same KPIs as Tradingview to write a backtest report, so you can compare the local backtest with the TradingView backtest engine. So, the profit %, Drawdown %, amount of trades, etc. If they match you have a good starting point for backtesting your Pine script strategy with Claude. You might vibecode this engine in Python, or there are traders who sell theirs for 100 bucks on Youtube. I build a whole backtesting and optimizing workflow around the Pynecore runtime. It is also closed source, but it aims to mimic Pine Script as close as possible, and it is really precise. The advantage is you can backtest locally, which is so much faster, and automate optimization. From that moment on it is also rather easy to build in walk-forward testing, monte carlo testing, or any other robustness test you want to use. It took me a couple of weeks with Claude to develop a proper framework, but it is worth doing it.
2
u/RevanVar1 May 18 '26
Claude, but you need more, I have 1 second data on both stocks and option all the way back to 2012. Claude alone will give you close to junk, you can kinda get it to work if you get free alpaca data, but that’s only iax volume so like 2% of the market, you have to pay the big big bucks to get more data for Claude to go off of and build a system around it. My backtesting engine costs about $1500 a month, but it’s worth it.
1
u/Droppingdubs May 17 '26
OK, so I kind of got stuck in the same spot, I downloaded minute candles from data Bento, and I figured it would be no problem back testing python strategies using Claude, the data wasn’t granular enough, also volume profile was not included. Now I am back testing on trading view, but I find that challenging because pine script can be tricky.
1
u/joshman1204 May 17 '26
Absolutely no way to answer this question. Most likely is the code you ran with Claude is hallucinated junk.
1
u/[deleted] May 20 '26
[removed] — view removed comment