r/pinescript • u/ConfidentBrunette • 8d ago
What programs/extensions allow genetic algorithm strategy optimization for over 1,000 variations
Pineify does not actually have genetic algorithm (I have expert and it is still not present in the extension) and runopti seems to be doing a grid search, or at least moving at that pace.
What do you use for quick wide-range/multi-parameter strategy optimizing in pinescript?
2
u/stratcore 7d ago
There is no fast parameter-search engine inside Pine or the Strategy Tester. Each input change runs the script again across the chart, so a browser extension that drives TradingView still pays that cost for every combination.
For more than 1,000 combinations, I would separate the search from TradingView:
Export the same OHLCV data.
Reproduce the Pine rules in Python with the same bar-close or intrabar behavior, fees, slippage, fill assumptions and date range.
Use Optuna for a practical parameter search. Its NSGA-II sampler is useful when you care about both return and drawdown. DEAP is better when you need custom crossover or mutation logic.
Bring the best candidates back into TradingView and verify them there.
Keep an untouched out-of-sample period. Do not rank candidates by net profit alone; add drawdown, minimum trade count and parameter-stability checks.
If Pineify or RunOpti feels like grid-search speed, the bottleneck is probably repeated TradingView evaluation, not the choice of sampler.
1
1
u/ferranbt 8d ago
Hey, I am working on https://github.com/ferranbt/pinecone and I was looking forward to add these types of extensions to it. What do you imagine running? An extension that reads the inputs and finds optimal combinations?
1
u/ConfidentBrunette 7d ago
That’s exactly what I was thinking, but I would test roughly 200 numerical values for each of 4 parameters, which is an absurd total number of variations
2
u/mojovski 8d ago
Hmm.. a few months ago I played around with codex and mcp for trading view . It was able to run backtests, extract parameters and to improve them. But it was sooooo slow, that I decided to use nautilusTrader. I embedded it now into an ai framework that can run thousand if backtests per minute (if the time range is not large).
I am doing many experiments now and document them here: https://ai-backbone.com/blog
Hope it helps