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
評価
(268)
プロジェクト
602
34%
仲裁
64
20% / 58%
期限切れ
147
24%
仕事中
パブリッシュした人: 1 article, 22 codes
2
開発者 2
評価
(453)
プロジェクト
566
26%
仲裁
24
42% / 38%
期限切れ
85
15%
パブリッシュした人: 6 codes
3
開発者 3
評価
(611)
プロジェクト
711
33%
仲裁
45
49% / 42%
期限切れ
14
2%
仕事中
4
開発者 4
評価
(4)
プロジェクト
5
20%
仲裁
2
0% / 100%
期限切れ
1
20%
パブリッシュした人: 3 codes
5
開発者 5
評価
(279)
プロジェクト
341
37%
仲裁
6
50% / 17%
期限切れ
7
2%
パブリッシュした人: 5 codes
6
開発者 6
評価
(460)
プロジェクト
487
70%
仲裁
6
67% / 0%
期限切れ
2
0%
7
開発者 7
評価
(87)
プロジェクト
121
68%
仲裁
5
80% / 0%
期限切れ
12
10%
仕事中
8
開発者 8
評価
(2672)
プロジェクト
3407
68%
仲裁
77
48% / 14%
期限切れ
342
10%
パブリッシュした人: 1 code
9
開発者 9
評価
(102)
プロジェクト
105
60%
仲裁
0
期限切れ
0
10
開発者 10
評価
(132)
プロジェクト
178
39%
仲裁
4
25% / 50%
期限切れ
14
8%
11
開発者 11
評価
(3)
プロジェクト
2
50%
仲裁
2
0% / 100%
期限切れ
0
類似した注文
Bonjour, je recherche un développeur MQL5 expérimenté pour créer un Expert Advisor pour MetaTrader 5 basé sur une stratégie de trading intégrant des principes de gestion des risques rigoureux et d'intelligence financière. Le robot doit être capable de gérer plusieurs paires de devises et d'optimiser automatiquement les entrées et sorties en fonction de conditions de marché prédéfinies."
MT4/MT5 HFT EA us30 30 - 3000 USD
Hello everybody, I'm looking for an experienced MQL4/MQL5 developer to optimize a High-Frequency Trading (HFT) Expert Advisor for both MT4 and MT5. The EA performs consistently and profitably on demo accounts, but when it is run on Raw and Standard live accounts under what appear to be the same trading conditions, it begins generating losses. I do not have the original source code (.mq4/.mq5); I only have the
I'm looking for an experienced NinjaTrader 8 (C#) developer to build a fully automated futures trading strategy. Please apply only if you have proven experience developing and testing NinjaTrader strategies. Project Overview Develop a fully automated NinjaTrader 8 strategy. Designed for Apex funded and evaluation accounts. Primary instruments: NQ/MNQ Futures (with flexibility to support other futures later). Trading
Hello I need to purchase the source code of an already built profitable mt5 EA with proven track recordIf you have something similar and you are open to selling the source code please apply to this post Please note I am not looking for a dev to build the product from scratch , but need something that is already built and have at least one year worth of track record
I need an Expert Advisor for MT5 on XAUUSD 1min timeframe using SMC concepts. STRATEGY RULES: SELL: 1. Identify previous day High/Low as liquidity 2. Entry only during London-NY session: 15:00-19:00 GMT+3 or broker clock. 3. If price sweeps previous day High and closes back below it 4. Check for bearish 1min FVG below sweep candle 5. Wait for BOS - lower low 6. Entry: Sell/buy at 50% of the FVG 7. SL: 10 pips above
Code An Loss Rate 90-100% MT5 EA , that can blow a 100 USD account a day ,with fixed TP of 3000 points and SL of 3000 For better Rate Calculations get an strategy that can lead to so
Shooter razor 30+ USD
Makes it takes trades by it self buy and sell, it must use the higher signals, also when I press stop it must not pick any trades I want it to take trades automatically when I press start also close by it self
8 cap prop firm passing 30 - 3000 USD
I am looking for an experienced MQL4/MQL5 HFT developer to build or optimize a High-Frequency Trading (HFT) Expert Advisor that can successfully pass proprietary trading firm challenges and perform consistently under live trading conditions with brokers such as 8cap or BlackBull Markets . The developer should have proven experience with HFT execution, ultra-low-latency trading, broker execution, slippage, spreads
I need a professional MT5 Expert Advisor (MQL5) for XAU/USD (Gold) only. Requirements: - Symbol: XAU/USD only - Timeframe: H1 trend, M5 entry - Smart Money Concept (SMC) - Liquidity Sweep - Break of Structure (BOS) - Order Block Retest - Confirmation Candle (Engulfing or Pin Bar) - ATR-based Stop Loss - Risk:Reward = 1:3 (adjustable) - Auto Lot (1% risk) - Break Even - Trailing Stop - Maximum 2 trades per day - One
I have a High-Frequency Trading (HFT) Expert Advisor for both MT4 and MT5 designed primarily for US30 (Dow Jones Index) . The EA performs consistently and profitably on demo accounts, but when I run it on an IC Markets Raw or Standard live account, it starts generating losses under what appear to be the same trading conditions. At this time, I cannot provide the source code (.mq4/.mq5). I can only provide the

プロジェクト情報

予算
90+ USD
締め切り
最低 1 最高 3 日