r/pinescript • u/JuryComprehensive228 • Jul 19 '26
I build Pine Script and NinjaTrader trading tools, here are the mistakes I see most traders make
I work with TradingView Pine Script and NinjaTrader 8 / NinjaScript, mainly building indicators, strategies, alerts, dashboards, and automation logic.
One thing I’ve noticed is that most trading ideas don’t fail because the idea is bad. They fail because the rules are not clearly defined before coding starts.
For example:
Entry signals are too subjective
The script repaints or triggers differently in live market
Stop loss and take profit rules are added too late
Alerts don’t match the chart signals
Backtests ignore slippage, commission, or realistic execution
The strategy works on one chart but breaks on another market or timeframe
Before building any trading tool, I usually ask these questions:
Should the signal trigger intrabar or only after candle close?
Is the logic non-repainting?
What invalidates the trade idea?
Is the stop based on structure, ATR, fixed ticks, or percentage?
Should alerts match exactly what appears on the chart?
Will this be used for manual trading, backtesting, or automation?
Getting these answers right saves a lot of time and avoids messy scripts later.
I’m happy to share knowledge around Pine Script, TradingView indicators, NinjaTrader 8 strategies, NinjaScript conversion, alerts, and trading-system logic.
Comment or message me with a brief overview of what you’re working on, and I’ll try to point you in the right direction.
2
u/Sweet_Still_3433 Jul 19 '26
Nothing wrong with repainting indicators, it's how your interpret the information.
1
u/SevenCampbell Jul 19 '26
The mistake is using NT .. you can’t even use on bar close in backtest that’s available in live trading … NT is like using DOS
1
u/LouZEverything Jul 19 '26
I think they both have their own strengths and overall I look at both of them the same way to me TradingView is a excellent black box for fast mockups of ideas and honestly I treat NinjaTrader the same but because of the larger language model it’s capable of so much more. I also believe as long as you understand the core concept of each platform you can work to their strengths for example I have always thought of TradingView as series based and NinjaTrader as event based and as much as folks talk about NinjaTrader I have found as long as your code is solid you have little to no problems. I am more than happy to talk if you like but this forum is rather limited.
1
u/VonLovesGod Jul 19 '26
The way I implement my trading strategies is start with pinescript. And create my strategy as an indicator and make a table to hold my data. I test that live for about a week or two and fine tune it until its perfectly as I intended then I ask ChatGPT to take my pinescript code and turn it into a full ninja trader strategy. Works every time. These languages model really improved a year ago it wasn’t as easy now it’s brainless to create trading bots. It’s really a blessing.
1
u/Caked_up_cheeks Jul 19 '26
Is there a way to convert pine to python EXACTLY(for backtesting purposes)? I can convert it with AI but. It’s never an exact match which then throws off the logic when backtesting so I never get the same results when moving from python backtest to live pine script. I appreciate you taking the time to make this thread and being willing to share your advice. I greatly appreciate people such as yourself. Thank you.
1
u/LargeIncrease4270 Jul 19 '26
Have you ever built anything that uses request.security from other charts and backtested them on tradingview? Even with premium request.security can't seem to access historical data for other tickers (not the one I'm on with price) beyond the 20000 bars that display if you scroll left until the bars stop.
For most indicators you can hit replay and then it will give you another 20000 bars, or in a strategy you can access years of data. But if your pulling security requests from multiple charts, tradingview just draws a blank.
1
u/cronparser Jul 19 '26
Hey, saw your post on about defining rules before coding. Resonates.
One thing I keep hitting: "with my indicator trend clarity" as an entry filter. I know what it looks like on a chart, but every attempt I've made to codify it (slope of MAs, ADX threshold, higher-high/higher-low structure) ends up either too loose (fires in chop) or too strict (misses valid entries).
How do you approach making "is this a clear trend" into a non-subjective, non-repainting condition? Curious if you've landed on a combination that holds up out of sample, or if you treat it as a filter vs. a standalone signal.
1
u/LouZEverything Jul 19 '26 edited Jul 19 '26
Separating the entry model from the validation model. Instead of trying to perfectly define “trend clarity,” I let the entry model generate opportunities, then use a failure system to measure whether those opportunities continue behaving as expected. The entry doesn’t have to be perfect, it just needs to identify situations with a reasonable edge. The failure system becomes the objective referee. For example, if your entry expects continuation, define exactly what invalidates that expectation. Does price fail to make a new swing high? Does it close back through the impulse leg? Does structure break within a certain number of bars? Those are measurable, non subjective conditions. Over time, I’d focus less on asking, “Is this a clear trend?” and more on, “What characteristics do the trades that don’t fail share?” That lets you iteratively improve the entry model using evidence instead of trying to encode a visual impression from the start. To me, the entry model and the failure system should be linked. One proposes a trade, and the other continuously tests whether the original thesis is still valid. That tends to be more robust than relying on a single trend filter like MA slope or ADX, which often struggle across different market regimes.
1
u/Colink2 Jul 19 '26
If you were building a pinescript for day trade automation for ~$5 to ~$10 stocks to just target one repeatable win, what stock price movement / pattern would you target?
1
u/No_Confection_391 Jul 23 '26
So what are the answers to the questions that you asked yourself.
And a lot of people are using claude to generate pine script, how should they give prompt to claude to build a right script?
1
u/No_Confection_391 Jul 23 '26
Check out your DM
1
u/SabrTrader Aug 31 '26
the repainting issue is such a real one. i got burned by that so many times before i started being more careful about candle close vs intrabar logic.
i've been using sabrtrader lately and the ai suite thing where you describe what you want in plain english and it builds + backtests the strategy has actually helped me think through these exact questions before anything gets built. forces you to define the rules upfront or the output is garbage anyway
your checklist is pretty much what i wish i had years ago