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
595
35%
Schlichtung
64
20% / 58%
Frist nicht eingehalten
147
25%
Frei
Veröffentlicht: 1 Artikel, 22 Beispiele
2
Entwickler 2
Bewertung
(452)
Projekte
564
26%
Schlichtung
24
42% / 38%
Frist nicht eingehalten
85
15%
Arbeitet
Veröffentlicht: 6 Beispiele
3
Entwickler 3
Bewertung
(539)
Projekte
620
33%
Schlichtung
36
39% / 53%
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
475
69%
Schlichtung
6
67% / 0%
Frist nicht eingehalten
2
0%
Arbeitet
7
Entwickler 7
Bewertung
(87)
Projekte
120
68%
Schlichtung
5
80% / 0%
Frist nicht eingehalten
12
10%
Arbeitet
8
Entwickler 8
Bewertung
(2625)
Projekte
3334
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
GoldTrade EA 30 - 60 USD
Hi, I am looking for someone who has already developed a high-performance Gold EA that can outperform the one shown in my screenshot. If you have such an EA, please apply for this job. Please describe how the EA works (for example, whether it uses a grid system) and provide backtest results along with the set files. If the EA meets my expectations, you can make the necessary adjustments and I will use it as my own
I am looking for someone who has or who can modify the Margin Trader EA by MaryJane preferably the MT5 version by making it pyramid using a fixed lot size addition(preferably 1st trade lot size) instead of using all the margin available to define the lotsize
Create simple EA 30 - 60 USD
Start BUY:- when i click start BUY button new panel should open which should contain bellow points:- Trigger Price Time frame Cross/Close RR ration Trailing Stop ratio Maximum Trade count Risk (percentage or cash) (Option to Increase risk when SL hit) Remove Trigger (True/False ) I will explain above point one by one here bellow •Trigger price :- here we enter price at which when market cross or
I want to check if this indicator is repainting or not Whick mean the results of back testing is legit or not if anyone can help me to review it kindly to well to contact me i will be happy to work and go on long term work with anyone thanks
PrimeFlowEA — v1 Specification Objective: PrimeFlowEA v1 is designed to enforce disciplined, rule-based execution within a single daily trading session. The goal of v1 is correct behavior and execution discipline , not optimization or performance tuning. 1. Market & Time Platform: MetaTrader 5 (MQL5) Symbol(s): User-selectable (single symbol per chart) Execution timeframe: Configurable (default: M5 / M15)
Specifications – Development of an MQL5 Expert Advisor (Reverse Engineering) Project context: I have access to a real trading history consisting of more than 500 trades executed over a period of approximately 3 years. These trades have been exported into a CSV file containing all available information, including date, time, symbol, order type, entry price, and exit price. Important: I do not have access to the
1.Sinyal Perdagangan : Sinyal beli: garis MACD utama memotong garis sinyal ke atas (macd_current>signal_current && macd_previous<signal_previous). Sinyal jual: garis MACD utama memotong garis sinyal ke bawah (macd_current<signal_current && macd_previous>signal_previous). Gambar di bawah menunjukkan kasus beli dan jual. 2. Posisi ditutup pada sinyal yang berlawanan: Posisi beli ditutup pada sinyal jual, dan posisi
Trading Bot Executes Trades on Specific Days via TradingView Alerts **As a** trader, **I want** to develop a trading bot that integrates with TradeLocker and MTS, **So that** when a TradingView alert (based on a 2,4,5,10,15,30 minute break and retest strategy whichever one) is triggered first. the bot will execute trades on both platforms, but only on specific days of the week. --- ## Acceptance Criteria 1
Project Description I am looking to collaborate with an experienced MQL5 / algorithmic trading developer who also has hands-on experience with Large Language Models (LLMs) and AI-driven systems. This is a long-term partnership opportunity , not a one-off paid freelance job. I bring 9 years of practical Elliott Wave trading experience , applied in live market conditions. The objective is to translate Elliott Wave
Hello, I’m looking for an experienced MT4 (MQL4) developer to convert the Lucky Reversal indicator from indicatorspot.com into a fully functional Expert Advisor (EA). Project Scope Code an MT4 EA that replicates the exact logic and signals of the Lucky Reversal indicator Trades should open and close automatically based on the indicator’s rules Must match indicator behavior 1:1 (no approximations) EA Requirements MT4

Projektdetails

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