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

Spezifikation

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.



Dateien:

ZIP
trash15.zip
3.6 Kb

Bewerbungen

1
Entwickler 1
Bewertung
(265)
Projekte
596
35%
Schlichtung
64
20% / 58%
Frist nicht eingehalten
147
25%
Arbeitet
Veröffentlicht: 1 Artikel, 22 Beispiele
2
Entwickler 2
Bewertung
(452)
Projekte
565
26%
Schlichtung
24
42% / 38%
Frist nicht eingehalten
85
15%
Frei
Veröffentlicht: 6 Beispiele
3
Entwickler 3
Bewertung
(548)
Projekte
632
33%
Schlichtung
39
38% / 49%
Frist nicht eingehalten
11
2%
Beschäftigt
4
Entwickler 4
Bewertung
(4)
Projekte
5
20%
Schlichtung
2
0% / 100%
Frist nicht eingehalten
1
20%
Frei
Veröffentlicht: 3 Beispiele
5
Entwickler 5
Bewertung
(278)
Projekte
340
37%
Schlichtung
6
50% / 17%
Frist nicht eingehalten
7
2%
Frei
Veröffentlicht: 5 Beispiele
6
Entwickler 6
Bewertung
(449)
Projekte
477
69%
Schlichtung
6
67% / 0%
Frist nicht eingehalten
2
0%
Frei
7
Entwickler 7
Bewertung
(87)
Projekte
121
68%
Schlichtung
5
80% / 0%
Frist nicht eingehalten
12
10%
Frei
8
Entwickler 8
Bewertung
(2640)
Projekte
3355
67%
Schlichtung
77
48% / 14%
Frist nicht eingehalten
342
10%
Frei
Veröffentlicht: 1 Beispiel
9
Entwickler 9
Bewertung
(102)
Projekte
105
60%
Schlichtung
0
Frist nicht eingehalten
0
Frei
10
Entwickler 10
Bewertung
(132)
Projekte
178
39%
Schlichtung
4
25% / 50%
Frist nicht eingehalten
14
8%
Frei
11
Entwickler 11
Bewertung
(3)
Projekte
2
50%
Schlichtung
2
0% / 100%
Frist nicht eingehalten
0
Frei
Ähnliche Aufträge
Hello developers, I’m looking for a professional trading bot that works using pending orders only (Buy Stop & Sell Stop). Main requirements: The bot must open multiple pending orders continuously. Stable execution without freezing or missing orders. Clean and professional logic suitable for real trading. Fully customizable settings (distance, lot size, TP/SL, trailing, etc.). If anyone already has a ready-made
Develop a fully automated MT5 Expert Advisor based on a multi-timeframe institutional trend-pullback strategy with: Regime filtering (H4) Execution logic (H1) ATR-based stop model Multi-stage trailing system Risk-based position sizing Portfolio-level risk protection Detailed performance logging This EA will be used for client capital (PAMM/MAM environment). Stability and risk control are higher priority than high
Hello, I have an existing MT5 Expert Advisor that works perfectly on a demo account. The strategy is profitable and executes trades correctly in demo testing. However, when I run the same EA on a live account, it takes trades but the results are not profitable. The performance is significantly different compared to demo. I am looking for an experienced MQL5 developer who can: Analyze the EA logic Identify why live
I am looking to purchase a proven scalping Expert Advisor with verified live account performance. Requirements: • Minimum 6 months live trading history • Proven profitability with controlled drawdown • Scalping strategy with Buy and Sell trades • Works on XAUUSD (Gold), MT5 preferred • Includes Stop Loss and Take Profit • Suitable for small accounts ($100) • Reasonable one time price Please share live performance
Hello, I want a grid trading bot for the Gate.io crypto exchange. I currently have a working grid bot written in MQL5, and I want a similar bot implemented in Python. The MQL5 bot can be translated, but the codebase is large and it was not designed to be easily ported to Python. Therefore, I prefer that the final Python bot preserves the same core grid logic, but is implemented cleanly in Python rather than doing a
The EA should only set TP and SL( Both Optional, We can set one at the time or no one at the same time or both active at the same time) 1. We active trade ourself , But in The EA this should ask if what the the TP and SL in form of USD we need. We'll put the Exact Required profit and or loss. This EA should calculate and set the tps and Sls itself to all the trades, and when we change the USD profit from info meter
Phahla fx boto 30+ USD
99.99% signal accuracy 10-15 trades distribution all currency trade and meta AI assistance on loss[advice] stop and start robot cyber security firewall protection activation code: 20060605TLP20 Please create a trading bot with any logo with the name elevation
Refine signal trigger execution . Optimize live chart performance . Ensure stable and clean code structure : Stable and clean code is important . Otherwise its a mess . Apply with as much accurate structure you foresee
RED DEVIL AI 30+ USD
50 EMA > 200 EMA → Uptrend confirmed Price pulls back to touch or cross below 50 EMA RSI > 50 ATR(14) > 20-period ATR average (volatility expanding) Current candle closes bullish ➡ Enter BUY at candle close50 EMA < 200 EMA → Downtrend Price pulls back to touch or cross above 50 EMA RSI < 50 ATR filter confirms volatility Current candle closes bearish ➡ Enter SELL at candle closeATR(14) Take Profit: 2.5 × ATR(14) This
This post is subject to developers response . Edit the post as you like . May be with me you can make a come back . So , , , Shift calculations . More to the calculation then you can comprehend is known . What else comes to your mind

Projektdetails

Budget
90+ USD
Ausführungsfristen
von 1 bis 3 Tag(e)