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

指定

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.



附加的文件:

ZIP
trash15.zip
3.6 Kb

反馈

1
开发者 1
等级
(254)
项目
573
36%
仲裁
64
20% / 58%
逾期
147
26%
空闲
2
开发者 2
等级
(440)
项目
546
25%
仲裁
21
38% / 38%
逾期
83
15%
工作中
3
开发者 3
等级
(486)
项目
552
32%
仲裁
28
43% / 43%
逾期
8
1%
繁忙
4
开发者 4
等级
(4)
项目
4
0%
仲裁
0
逾期
0
工作中
5
开发者 5
等级
(259)
项目
316
37%
仲裁
6
50% / 17%
逾期
7
2%
空闲
6
开发者 6
等级
(383)
项目
411
69%
仲裁
3
100% / 0%
逾期
2
0%
繁忙
7
开发者 7
等级
(42)
项目
58
60%
仲裁
2
50% / 0%
逾期
6
10%
工作中
8
开发者 8
等级
(2441)
项目
3076
66%
仲裁
77
48% / 14%
逾期
340
11%
空闲
9
开发者 9
等级
(13)
项目
13
31%
仲裁
0
逾期
0
空闲
10
开发者 10
等级
(131)
项目
172
38%
仲裁
4
25% / 50%
逾期
13
8%
工作中
11
开发者 11
等级
(3)
项目
2
50%
仲裁
1
0% / 100%
逾期
0
空闲
相似订单
I am looking for an experienced MQL5 developer to help me finalize and optimize an Expert Advisor (EA) for the FTMO challenge. I have already built a significant portion of the code, but it requires further refinement and optimization to ensure it functions according to the trading strategy I intend to use. I am happy to share all the resources, including the current code, reference materials, and detailed
dreams good and have a great Cash out from your smart phone , tuyoywuiy glamorous flood see full idk idk slow so dolls stupid sis workouts who's spark koalas oral waits also doggo idk
I need a modification on my existing Ea if you can Can fixed risk management to lot size instead of percentage. don’t want strategic risk management input to be based on percentage Instead lot size. The strategic risk management function I need turned from percentage to lot based And I need sells and buys to have separate tps and sl options Budget:$100 Day: 1 day
NADGIO 30+ USD
I need a developer that can convert two Buy and Sell indicators into a trading robot. the indicators has an input parameter, this should be made available for adjustment. Features 1. Break Even 2. Trailing Stop 3. Global TP and SL 5. Time Filter 6. News Filter (If possible)
I need a developer who can convert trading view indicator in to mt5 expert advisor with some modifications. The other details will shared once chosen the developer. Looking for someone who has good knowledge of forex, mql5,and pine script
I have thee best concept period, hence i got less to say. Actions speaks louder then words. Sign up and lets get started as there is a big world that awaits all your your adventures
Forex Trading Robot 100 - 300 USD
Guys do you have or can you create me a Trading bot for : MT4 that i can use on XAUUSD , EURUSD , GBPUSD that can trade 24/7 I need it to be profitable I like it can bring me 10- 50% a month or more if possible
Calling those have the skills I would for an EA to be made using the SSL hybrid indicator by Minkel100 as a signal that compiles with the following requirements Entry conditions: When ever price crosses the ma Baseline and the color changes EXIT conditions: When ever price crosses the ma Baseline and the color changes Margin size of the trade: 0.97% of account E.g account size $10000 Margin size $97 Meaning each
NRTR - indicator for MetaTrader 5 NRTR (Nick Rypock Trailing Reverse) - indicator for MetaTrader 4 NRTR WATR - indicator for MetaTrader 4 NRTR GATOR - indicator for MetaTrader 5 X2MA NRTR - indicator for MetaTrader 5 NRTR - indicator for MetaTrader 5 NRTR GATOR - indicator for MetaTrader 4 NRTR - indicator for MetaTrader 4 Stalin_NRTR - indicator for MetaTrader 5 NRTR Color Line - indicator for MetaTrader 5 NRTR Rosh
I'm looking for someone with experience in building an Expert Advisor (EA) that works for both MT4 and MT5 platforms. I have my own trading strategy, and I place my orders daily within a specific time window, for example, between 4:00 AM and 9:00 AM, based on the high and low of the candles during that period. The Take Profit (TP) and Stop Loss (SL) levels will be set using Fibonacci retracement levels. Also, I want

项目信息

预算
90+ USD
VAT (21%): 18.9 USD
总计: 108.9 USD
开发人员
81 USD
截止日期
 1  3 天