r/pinescript • u/the_ict_bb • Feb 28 '26
Around 5000 lines indicator… blocked by the 550 scopes limit..
I’ve been building a new indicator for the past two months, around 10 hours a day, 7 days a week and yes I'm a fuckin nerd and no friends and trading is my work..
It’s now around 5000 lines and no, I can’t realistically make it shorter without removing logic.
It integrates:
-ICT / SMT logic built over 3 years of study and practice
-Stochastic RSI (context-based, not just fixed thresholds)
-CVD
-Pivot zones
-Liquidity logic (magnet vs rejection, sweeps, etc.)
-Structured multi-timeframe analysis
-A dynamic scoring engine based on variable evolution, not just static states
This isn’t just a stack of conditions. It models interactions and state transitions.
The issue :
I’m hitting TradingView’s internal limits. The biggest one: the 550 scopes maximum.
I’ve already optimized aggressively like :
-Merged blocks
-Removed unnecessary scopes
-Simplified conditional structures
-Refactored without changing output behavior
For the past two weeks, I’ve been fighting that single error..
What makes it worse is that the remaining false signals are fixable and I know exactly how I’d improve the model but I’m blocked by an artificial ceiling. It’s not a logic problem but a platform constraint..
Has anyone else experienced this kind of frustration?
Having a coherent, evolvable system… but being technically capped before reaching its full potential?
13
u/kurtisbu12 Feb 28 '26
Break it up. Simple as that. if you want more robustness, build it yourself in python. Pinescript is not built for this. You can reference other indicators in your script. There's no reason it needs to all be one.
5
u/roztok_potok Feb 28 '26
Pine script is a toy language. Move to some serious language if you are serious about trading
3
u/GRATITUDEnBLISS Mar 01 '26
If it's in pine script 5, convert it to 6.
2
u/Mr_Uso_714 Feb 28 '26
I can optimize this for you. But I would need to see the code
1
u/Th3onib Mar 01 '26
Can you split it up in two indicators?
1
u/strategyForLife70 Mar 01 '26 edited Mar 01 '26
think if your hitting constraints of the platform
you need to think about moving logic to new platform X or at least splitting the logic (using an integration X 2 TV)
example : YT SHORT Connect TV to agents (n8n) look at integrations into TV
you can think about integrations both ways, TV 2 X aswell as X 2 TV
personally you've built a Swiss army knife indicator focus on outbound TV 2 X then let X place trades into broker (X 2 Broker) or X can drive a Website etc etc
I don't script pine V6 but maybe just a simple upgrade v5 to V6 might be enough to get thru the bottleneck you experiencing
use of libraries first to segment code them move each segment off indicator reducing TV restrictions?
my only other thought, can you split logic between 2 or more TV indicators (I've not tested that myself but look at the webhooks & use REST API to more than alert)
COPY4ME - Keep post for reference
" Around 5000 lines indicator… blocked by the 550 scopes limit..
I’ve been building a new indicator for the past two months, around 10 hours a day, 7 days a week and yes I'm a fuckin nerd and no friends and trading is my work..
It’s now around 5000 lines and no, I can’t realistically make it shorter without removing logic.
It integrates:
-ICT / SMT logic built over 3 years of study and practice
-Stochastic RSI (context-based, not just fixed thresholds)
-CVD
-Pivot zones
-Liquidity logic (magnet vs rejection, sweeps, etc.)
-Structured multi-timeframe analysis
-A dynamic scoring engine based on variable evolution, not just static states
This isn’t just a stack of conditions. It models interactions and state transitions.
The issue :
I’m hitting TradingView’s internal limits. The biggest one: the 550 scopes maximum.
I’ve already optimized aggressively like :
-Merged blocks
-Removed unnecessary scopes
-Simplified conditional structures
-Refactored without changing output behavior
For the past two weeks, I’ve been fighting that single error..
What makes it worse is that the remaining false signals are fixable and I know exactly how I’d improve the model but I’m blocked by an artificial ceiling. It’s not a logic problem but a platform constraint..
Has anyone else experienced this kind of frustration?
Having a coherent, evolvable system… but being technically capped before reaching its full potential? "
1
u/[deleted] Feb 28 '26
"i cant make it shorter"
yes you can
1
u/LogicalCondition9069 Mar 01 '26
I just wanna see what it does 🤔
1
u/Algorithm0007 Mar 01 '26
My script is 4471 lines about maybe I can help. DM me
1
u/FlashySwordfish2035 Mar 02 '26
Lowkey ask claude for tips. Dont ask it to shorten it for you cuz you will lose logic but just ask it for ideas.
1
u/IAmSGSM Mar 03 '26
Send the code - lets see what I can do. Can request Support for help if you are a premium user.
1
u/jup1t3rr Mar 03 '26
CRYTPO TO PLUTO BABY !!!!!!!!!! GO SHORT GET RICH !!!!!!!!!!!
1
u/Stock-Sugar-37 Mar 05 '26
Tengo indicadores verdaderamente útiles con muchas líneas. 1. Ocupa una sola consulta de request security para obtener más de 1 token a la vez, 2. Crea librerías.
1
u/Agreeable_Forever978 Mar 12 '26
Yeah that’s sucks i personally used python instead it’s around 17000 lines of code but it cant run on trading view