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

İş Gereklilikleri

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.



Dosyalar:

ZIP
trash15.zip
3.6 Kb

Yanıtlandı

1
Geliştirici 1
Derecelendirme
(254)
Projeler
574
36%
Arabuluculuk
64
20% / 58%
Süresi dolmuş
147
26%
Serbest
2
Geliştirici 2
Derecelendirme
(441)
Projeler
547
25%
Arabuluculuk
21
38% / 38%
Süresi dolmuş
83
15%
Çalışıyor
3
Geliştirici 3
Derecelendirme
(490)
Projeler
561
33%
Arabuluculuk
27
44% / 44%
Süresi dolmuş
9
2%
Meşgul
4
Geliştirici 4
Derecelendirme
(4)
Projeler
4
0%
Arabuluculuk
1
0% / 0%
Süresi dolmuş
0
Çalışıyor
5
Geliştirici 5
Derecelendirme
(260)
Projeler
317
37%
Arabuluculuk
6
50% / 17%
Süresi dolmuş
7
2%
Serbest
6
Geliştirici 6
Derecelendirme
(391)
Projeler
417
69%
Arabuluculuk
4
75% / 0%
Süresi dolmuş
2
0%
Çalışıyor
7
Geliştirici 7
Derecelendirme
(45)
Projeler
61
61%
Arabuluculuk
2
50% / 0%
Süresi dolmuş
6
10%
Meşgul
8
Geliştirici 8
Derecelendirme
(2449)
Projeler
3086
66%
Arabuluculuk
77
48% / 14%
Süresi dolmuş
340
11%
Serbest
9
Geliştirici 9
Derecelendirme
(17)
Projeler
17
41%
Arabuluculuk
0
Süresi dolmuş
0
Serbest
10
Geliştirici 10
Derecelendirme
(132)
Projeler
176
39%
Arabuluculuk
4
25% / 50%
Süresi dolmuş
14
8%
Serbest
11
Geliştirici 11
Derecelendirme
(3)
Projeler
2
50%
Arabuluculuk
1
0% / 100%
Süresi dolmuş
0
Serbest
Benzer siparişler
Hey greetings am in need of a developer that can convert my simple tradingview indicator to MT4 I have the source code of the indicator and is also a public indicator on Tradingview site Kindly bid and let started
can you help me with Ctrader i need modification on the linkhttps://docs.google.com/document/d/1fggk49xWbnwahtfOlE-U7G6muZB1FT8eWmftGiY7R-s/edit?usp=sharing can you assist with cTrader modifications to enhance functionality and improve performance. do text me if you a professional on it i will be looking forward to your response best regards
I hope you're doing well. I am interested in learning more about your EA (Expert Advisor) trading bot. Specifically, I would like to review some performance data, particularly regarding the Profit and Loss (P&L) over recent weeks. Could you kindly provide a short video with today's date, showcasing the weekly stats from the last two months? I am looking for data covering the period from August 1st, 2024, to October
Hello great developer, im looking for a great developer on this project I have a project ready to automate operations from telegram to mt4/mt5 by taking signals from an email. Can you help me? peace be unto you
I need an expert to help me convert chopzone traingview pinescript to mt4, I need an expert to get it done for me on between 1 to 2 days i hope this will be done by then, i will attach the file and my budget is $30 as of minimum here
am looking for great developer that can help me on this project, I have an Indicator on Tradingview and want to convert that to an EA for Metatrader 4. Can you help me? peace be unto you
Need to copy the trades and orders generated by expert advisors from my MT4 platform to eToro broker. Etoro offers a trading API (). This could be used to make the connection to their propietary web platform. If the programmer considers there is more stable and faster way to do it then I'm open to suggestions
I am looking for an experienced MQL developer to create a simple Expert Advisor (EA) for MT4/MT5. The EA will be based on a combination of Exponential Moving Average (EMA) and Relative Strength Index (RSI) for trade entries and exits. Requirements : Proven experience in MQL4/MQL5 development Ability to deliver within deadlines Clear and regular communication during the project Experience with EAs involving moving
**Description:** I am looking for an experienced MQL4 programmer to develop a sophisticated Expert Advisor (EA) for MetaTrader 4 (MT4) using a **Hidden Markov Model (HMM)** to predict market trends for forex trading. The EA will be used for live trading on forex pairs like EUR/USD and should incorporate statistical modeling with advanced machine learning algorithms. ### **Requirements:** - **Strong MQL4 Expertise**
I'm planning on building/creating an mt4/5 trading indicator that use a break and retest strategy I will share a link for the idea strategy, Kindly message me to send you the link, I can't send it here

Proje bilgisi

Bütçe
90+ USD
KDV (21%): 18.9 USD
Toplam: 108.9 USD
Geliştirici için
81 USD
Son teslim tarihi
from 1 to 3 gün