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

Spécifications

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.



Dossiers :

ZIP
trash15.zip
3.6 Kb

Répondu

1
Développeur 1
Évaluation
(254)
Projets
574
36%
Arbitrage
64
20% / 58%
En retard
147
26%
Gratuit
2
Développeur 2
Évaluation
(441)
Projets
547
25%
Arbitrage
21
38% / 38%
En retard
83
15%
Travail
3
Développeur 3
Évaluation
(490)
Projets
561
33%
Arbitrage
27
44% / 44%
En retard
9
2%
Occupé
4
Développeur 4
Évaluation
(4)
Projets
4
0%
Arbitrage
1
0% / 0%
En retard
0
Travail
5
Développeur 5
Évaluation
(260)
Projets
317
37%
Arbitrage
6
50% / 17%
En retard
7
2%
Gratuit
6
Développeur 6
Évaluation
(391)
Projets
417
69%
Arbitrage
4
75% / 0%
En retard
2
0%
Travail
7
Développeur 7
Évaluation
(45)
Projets
61
61%
Arbitrage
2
50% / 0%
En retard
6
10%
Occupé
8
Développeur 8
Évaluation
(2449)
Projets
3086
66%
Arbitrage
77
48% / 14%
En retard
340
11%
Gratuit
9
Développeur 9
Évaluation
(17)
Projets
17
41%
Arbitrage
0
En retard
0
Gratuit
10
Développeur 10
Évaluation
(132)
Projets
176
39%
Arbitrage
4
25% / 50%
En retard
14
8%
Gratuit
11
Développeur 11
Évaluation
(3)
Projets
2
50%
Arbitrage
1
0% / 100%
En retard
0
Gratuit
Commandes similaires
Enter buy trade at close of candle when bar closes above the 3 emas. Emas are 34 ema, 64 ema and 128 ema. For a buy trade the 34 ema must be above the other two emas. The 64 ema should be in the middle. The 128 ema should be below the other two emas. For a buy trade the Awesome Oscillator should be above the middle line and colored green. Exit a buy trade when price touches 64 ema. Sell trade same conditions as buy
I want to make AI based on Attached Picture Swing High low. If you have experience can share demo first. Stop loss, take profit, trailing , break even ,DD etc. also amiable
Hello, I’m looking for a TradingView indicator that fits my forex trading needs. If you can create or customize one for me, please reach out. I'd appreciate your help! Thanks in advance."
Pls I need help I don’t have much but pls accept my little payment for the work thanks 🙏 mt5 file Once it opens buy and move positively to buy let it use auto trailing to follow the trend that’s if I choose to use trailing option and before the trailing starts it must reach the actual profit target example if I set profit target to 500 then once profit is at 500 let trailing immediately protect it and any 1 pip
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
Hello my developer colleagues, am also a developer like you but i just hear about this mql site and i will like to sell, develop and build bots for buyer. But i don't know how to become a seller here please i need help in helping me to create a seller account on mql and i will be very glad if you can help me out and i will appreciate you
Preciso de um EA que abra ordens a mercado a partir de um indicador, Ele precisa obter take e stop loss fixos, spread máximo, horários de início e final das operações, meta e stop diário, martingale, painel e a função no script para que eu possa ceder o EA apartir do id do mt4 de terceiros
Hello Investors, I'm selling a profitable and stable expert advisor trading on the Gold (XAUUSD) pair using a cutting-edge scalping strategy. The EA is able to generate a stable monthly income without using martingale strategy, and with an optional cut loss in place. Particularly the average monthly gain can go from 2-3% (at a relatively low risk, with an historical max DD of 6%) to 20-30% (with an aggressive style
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
Would I honestly need is someone who can make a profitable EA for me that can at least make me around $80 a day starting with $50 and the EA must be able to work with exness the EA should automat trades 24/7. Broker = Exness Pairs = USD/JPY XAU/USD and etc Chart time frames = M1 M15 History = last month till last 6 months. Lot size 0.10 take profit at $2 stop

Informations sur le projet

Budget
90+ USD
TVA (21%): 18.9 USD
Total: 108.9 USD
Pour le développeur
81 USD
Délais
de 1 à 3 jour(s)