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.



응답함

1
개발자 1
등급
(265)
프로젝트
596
35%
중재
64
20% / 58%
기한 초과
147
25%
작업중
게재됨: 1 기고글, 22 코드
2
개발자 2
등급
(452)
프로젝트
565
26%
중재
24
42% / 38%
기한 초과
85
15%
무료
게재됨: 6 코드
3
개발자 3
등급
(548)
프로젝트
632
33%
중재
39
38% / 49%
기한 초과
11
2%
로드됨
4
개발자 4
등급
(4)
프로젝트
5
20%
중재
2
0% / 100%
기한 초과
1
20%
무료
게재됨: 3 코드
5
개발자 5
등급
(278)
프로젝트
340
37%
중재
6
50% / 17%
기한 초과
7
2%
무료
게재됨: 5 코드
6
개발자 6
등급
(449)
프로젝트
477
69%
중재
6
67% / 0%
기한 초과
2
0%
무료
7
개발자 7
등급
(87)
프로젝트
121
68%
중재
5
80% / 0%
기한 초과
12
10%
무료
8
개발자 8
등급
(2640)
프로젝트
3355
67%
중재
77
48% / 14%
기한 초과
342
10%
무료
게재됨: 1 코드
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
무료
비슷한 주문
hello great developer ’m looking for an experienced NinjaTrader developer to help set up software on my VPS, create custom chart templates with multiple indicators, and build an arbitrage dashboard/trade copier system. The project includes multi-account management and integration with Bookmap. I need a custom dashboard to monitor and control multiple accounts efficiently. Please message me if you have strong
What informtion would you need for Ninjatrader futures automated trading and how long would it take ? if anyone can give me answer i will be happy to discuss more about the project thanks fill free to bid to the project thanks
Requirements: - Convert my written trading rules into TradingView Pine strategy - Then convert into MT5 EA - Entry must be next candle open after signal candle close - Stop loss on signal candle high/low - Position sizing: fixed % risk per trade - Portfolio risk cap across symbols - One trade per symbol at a time - Must understand backtesting differences (spread, slippage, fill logic) Important: I want to be able to
Hi there, your attention is urgently needed if you have the right profession in both MQL4 and Ninjascript code, as I am in need of a very reliable programmer to help convert my MQL4 code into a well functioning ninjatrader, this includes the full reconstruction of the entire code, applicant must be able to provide their previous work in line with this specs thanks
Proficient coder needed for converting my MQL4 code to a well functional Nintrader 8 strategies, coder must be able to provide seamless tailored solutions as I need the NT8 strategy: - Replicate the exact same logic, behavior, and decision flow as the MT4 EA - Take the same trades under comparable market conditions - Include all internal logic, states, controls, and integrations present in the code - Be a faithful
Data Integrity 500 - 1000 USD
The trading bot is an automated software system designed to monitor financial markets, execute trades, and manage risk based on predefined strategies. The bot aims to maximize profits while minimizing human intervention and emotional decision-making. Scope: Supports automated trading on selected exchanges (e.g., Binance, Bitget, Coinbase). Executes trades based on technical indicators, signals, or AI models. Provides
I want a modification on my ea . A spread filter or slipage filter such that when the market price is less than 50 point away from the pend order , then ea check the spread if less than the set filter spread. If spread is more than the set spread, the ea will delete the pend order . Secondly , if the broker price is moved or sliped the pending order from the original price it was set by the tolerable slipage distance
1. Objective Create an MT5 automation script (or set of scripts) that fully automates my strategy optimization workflow, including: • Batch optimization runs • Automatic filtering of results • Automatic forward testing • Exporting and organizing results into structured files/folders The goal is to reduce manual work and allow one‑click execution of the entire pipeline. 2. Platform & Environment • MetaTrader 5 •
Would it be possible to connect Futures prop firm with Rithmic or Tradeovate platform to Ninjatrader automated trading ? If anyone can do this for me I will be happy to get started with the person right away
I have a open source Tradingview indicator that I want it to be converted to Ninja Trader8. I have attached it. Please let me know, if you can do it and for how muc

프로젝트 정보

예산
90+ USD
기한
에서 1  3 일