Debug: array out of range issue + 2 buffers return value of 1 on live chart for every bar

Specifiche

Only for developers with experience in debugging, and array-out-of-range issues.


A custom indicator seems to work on a static chart, but 1 buffer still has mistakes in it, resulting in a value of 1 for every bar: the code needs to be reviewed and modified, resulting in a working indicator for every symbol, for every timeframe: sometimes when the timeframe is switched, the chart closes automatically, but all the time the value of ExtMapBuffer2 (Aqua) is 1 on the live chart, sometimes there is an "array out of range" issue. The second buffer: NonRepaintBuffer (red line on the image below) is based on the first one:  ExtMapBuffer2. ExtMapBuffer2 repaints around turning points, so this second buffer is added ( NonRepaintBuffer ) that does not change values in the past. As the red line is calculated based on the aqua line, the error must be contained within the  ExtMapBuffer2 calculation.



So review, edit & fix please.

I'm happy to answer any questions.

- - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - -  - - - - - 

About the indicator:

A zig-zag NRP close is applied to an oscillator.

On this, a counter is added, to keep track of the number of bars since the last "zag" (that does not repaint). The counter adds 0 for a counter-trend bar, and 1 for a trend bar. So when in a rising segment, you have a small counter-trend down-swing, the counter is flat. If after this counter-trend down-swing the trend goes back up, and a new high is made, the counter takes the value as if there would not have been a counter-trend piece (like only rising bars). (& vice versa for falling segment).

Every trend change starts with a retracement against the current trend, so the counter will be flat during this time, but when the trend goes further (than an acceptable retracement as in the setting for the zigzag), a new leg of the zig zag is created. 

The problem with the current code, is that at that moment (when a new leg of the zigzag close nrp on the oscillator appears), the counter jumps back to the start of the retracement (of the flat part), instead of the end of the flat part. 

So it is not a repainting error, it is a code error.

To fix this, a new buffer that does not repaint is added.



Con risposta

1
Sviluppatore 1
Valutazioni
(268)
Progetti
603
34%
Arbitraggio
65
22% / 57%
In ritardo
147
24%
In elaborazione
Pubblicati: 1 articolo, 22 codici
2
Sviluppatore 2
Valutazioni
(453)
Progetti
566
26%
Arbitraggio
24
42% / 38%
In ritardo
85
15%
Gratuito
Pubblicati: 6 codici
3
Sviluppatore 3
Valutazioni
(619)
Progetti
722
33%
Arbitraggio
46
48% / 41%
In ritardo
14
2%
Caricato
4
Sviluppatore 4
Valutazioni
(4)
Progetti
5
20%
Arbitraggio
2
0% / 100%
In ritardo
1
20%
Gratuito
Pubblicati: 3 codici
5
Sviluppatore 5
Valutazioni
(279)
Progetti
341
37%
Arbitraggio
6
50% / 17%
In ritardo
7
2%
Gratuito
Pubblicati: 5 codici
6
Sviluppatore 6
Valutazioni
(461)
Progetti
488
70%
Arbitraggio
6
67% / 0%
In ritardo
2
0%
Gratuito
7
Sviluppatore 7
Valutazioni
(87)
Progetti
121
68%
Arbitraggio
5
80% / 0%
In ritardo
12
10%
In elaborazione
8
Sviluppatore 8
Valutazioni
(2675)
Progetti
3414
68%
Arbitraggio
77
48% / 14%
In ritardo
342
10%
Gratuito
Pubblicati: 1 codice
9
Sviluppatore 9
Valutazioni
(102)
Progetti
105
60%
Arbitraggio
0
In ritardo
0
Gratuito
10
Sviluppatore 10
Valutazioni
(132)
Progetti
178
39%
Arbitraggio
4
25% / 50%
In ritardo
14
8%
Gratuito
11
Sviluppatore 11
Valutazioni
(3)
Progetti
2
50%
Arbitraggio
2
0% / 100%
In ritardo
0
Gratuito
Ordini simili
I DO NOT need any programming or strategy development. I already have a working NinjaTrader 8 automated strategy based on a 3/5 EMA crossover. I need you to run my existing strategy through NinjaTrader Strategy Analyzer/Optimizer, test the existing adjustable parameters, and find robust settings with the best profit factor and lowest reasonable drawdown. I will provide the existing NinjaScript ZIP. I do not want the
Project Description I am looking for an experienced MQL5/MT5 Expert Advisor developer to develop an automated trading EA for XAUUSD on the M3 timeframe , running on an Exness account . The EA will automate a manual strategy based on SNR/GAP zones , using two setup types: Price Rejection Price Correction The EA should identify valid BUY/SELL setups around predefined SNR/GAP areas, apply configurable RSI, SMA, EMA and
I DO NOT need any programming or strategy development. I already have a working NinjaTrader 8 automated strategy based on a 3/5 EMA crossover. I need you to run my existing strategy through NinjaTrader Strategy Analyzer/Optimizer, test the existing adjustable parameters, and find robust settings with the best profit factor and lowest reasonable drawdown. I will provide the existing NinjaScript ZIP. I do not want the
NinjaTrader 8 / NinjaScript Phase 1 build: convert an existing Auction Market Theory (AMT) strategy into objective, alert-only decision-support logic. Not a bot, no auto-execution — trades stay manual. Covers NQ/MNQ, ES, CL, MGC using 30-min TPO/Volume Profile context with 5-min confirmation: one 5-min close outside VAH/VAL = acceptance, close back inside = rejection. Dashboard shows bias, auction state, location
Hi i need help to connect my chat gtp with ninja trader I have all tools. Just need supervision and seeking a professional who can do that for me. This the bridge extension https://crosstrade.io/blog/chatgpt-to-ninjatrader-mcp-walkthrough
I am looking for a professional developer with proven experience in NinjaTrader/NinjaScript and TradingView/Pine Script . Please only contact me if you have actual experience developing trading strategies for these platforms . I am not looking for inexperienced developers or generic/template solutions. I will provide the additional examples and detailed strategy requirements to the selected developer. If you have the
Hello there, I am looking for a automated strategy for ninjatrader 5 Looking for a proven profit factor of 1.5 ( minimum ) on 15 mins time frame . I do MNQ futures I do not have the logic, but I like mean reverssion variable , plus RSI etc . that could make the automated tool robust and long lasting. i need fast response if you have
Date:29.08.2026 **TECHNICAL SPECIFICATIONS** PDF Attached for reference rest all details given below. Required: Creation, Integration and successful execution of trading algo/robot in MT5 using MT5 VPS. Brokers: Trades to be executed in both brokers Swissquote and Pepperstone. Symbols: All available in MT5. ** Common parameters for all executions: · Manual Start/Stop. · Session time (defined / always
can you help me with I have an indicator that I built and I work with PickMyTrade. The entries come through the alerts I get from Trading View . Trading View needs to send an alert and PickMyTrade executes a trade at that exact same second. Now, I have a problem in Trading View with the synchronization between the alert and the signal. I have a box that I built for a trade. It needs to output the box and get an
Looking for a developer in NinjaTrader For coding Inst - ES,NQ Chart type - Tick, range, volume & time Brief- Fib levels mapped on chart which act as entries, tgts and stops all based on candle close. (Maybe) use MACD for filtering direction. Daily manual input of the TWO fib Anchor levels is part of the strategy. I need a well experienced developer to bid and before biding check the attached file well. the PDF and

Informazioni sul progetto

Budget
90+ USD
Scadenze
da 1 a 3 giorno(i)