Fix this custom Zigzag indicator (on an oscillator + counter)

Техническое задание

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.

I refer to the image below: the Aqua colored line is how the counter jumps back, while the red line is how it should be.

I'm happy to answer any questions.


example_eurusd_visual_backtest.png


Файлы:

Откликнулись

1
Разработчик 1
Оценка
(6)
Проекты
8
25%
Арбитраж
2
50% / 0%
Просрочено
2
25%
Свободен
2
Разработчик 2
Оценка
(19)
Проекты
22
23%
Арбитраж
5
40% / 60%
Просрочено
2
9%
Работает
3
Разработчик 3
Оценка
(16)
Проекты
35
23%
Арбитраж
4
0% / 50%
Просрочено
2
6%
Работает
4
Разработчик 4
Оценка
(55)
Проекты
66
58%
Арбитраж
1
0% / 0%
Просрочено
0
Свободен
5
Разработчик 5
Оценка
(9)
Проекты
19
16%
Арбитраж
3
67% / 0%
Просрочено
0
Свободен
6
Разработчик 6
Оценка
(70)
Проекты
91
25%
Арбитраж
26
19% / 54%
Просрочено
25
27%
Свободен
7
Разработчик 7
Оценка
(45)
Проекты
91
13%
Арбитраж
34
26% / 59%
Просрочено
37
41%
Свободен
Похожие заказы
I need a developer to start robot from scratch based on existing EA that is running live. I do not have the source file as my previous coder did not give it to me. What I do have is the investor password which is running the EA from the coder side but not from my end. I like someone to monitor the account and re create the same system for me
Project Overview: I am looking for a highly experienced MetaTrader 4 (MQL4) developer to build a sophisticated automated trading system. This is not a standard grid bot; it requires complex trade management, dynamic exposure rebalancing, and a custom "Salami" liquidation module for partial loss mitigation . Key Features to Implement: Virtual Grid & Dynamic Trend: Price-action-based grid triggers without pending
I am seeking an experienced MQL5 developer to build a high-precision Gold (XAUUSD) scalping Expert Advisor. The objective is to achieve a Profit Factor (PF) of 2.0 or higher with a focus on institutional logic rather than retail lagging indicators.The EA must be designed to pass a "100% Real Ticks" backtest (Exness/Dukascopy data) over a 30-day period with a $500 initial deposit.Core Requirements & Strategy
I’ve been following your profile and I'm interested in your expertise with the ATAS API and C# development. I have a clear technical scope for a high-performance M1 indicator focused on Binary Options and Scalping. ​The core logic is based on institutional Order Flow convergence: ​Stacked Imbalances: 300% ratio with a minimum of 3 consecutive levels. ​Delta/Price Divergence: Filtering for market exhaustion (New Highs
can you help me with editing the existing ATR Trailing Stop Indicator to include a logic to include additional script, where my ninZaRenko bars when it closes above OR below the dynamic stop line, I will be out of trade. Please remember, in this Indicator, now when the price touches the stop line, I am stopped out .. . I want to edit the script, in lieu of the price touch, I like to update this logic to when the bar
APARTE DE PASAR EL CÓDIGO A MT5 QUIERO QUE CONTENGA TODOS LOS DATOS NECESARIOS PARA QUE ESTE NUEVO CÓDIGO SE PUEDA USAR EN LA FÁBRICACIÓN DE UN ROBOT, NO SE MUCHO DE ESTO PERO INVESTIGUE QUE DEBE LEER BUFFERS Y OTRAS COSAS
2 FX pairs M15 execution with higher timeframe bias Session-based trading (UK time) Fixed % risk per trade Controlled pyramiding (add to winners only) Strict daily loss limits (FTMO-style) Proper order handling (SL always set) Basic logging (CSV) Strategy logic will be provided in detail after NDA / agreement. Must deliver: Source code (.mq5) Compiled file (.ex5) Clean, well-commented code Short support window for
Hi, are you able to create a script/indicator on tradingview that displays a chart screener and it allows me to input multiple tickers on the rows. then the colums with be like "premarket high, premarket low, previous day high, previous day low" . When each or both of the levels break, there will pop up a circle on the chart screener, signaling to me what names are above both PM high and previous day high or maybe
DO NOT RESPOND TO WORK WITH ANY AI. ( I CAN ALSO DO THAT ) NEED REAL DEVELOPING SKILL Hedge Add-On Rules for Existing EA Core Idea SL becomes hypothetical (virtual) for the initial basket and for the hedge basket . When price hits the virtual SL level , EA does not close the losing trades. Instead, EA opens one hedge basket in the opposite direction. Original basket direction Hedge basket direction (opposite) Inputs
Hi I have a simple task (hopefully) I have a custom strategy that I built with the help of Claude Anthropic - everything is finished and I zipped it with power shell but when importing it NT8 gives me the error message that the file was made from an older, incompatible version or not a NinjaScript. My folder structure is correct as far I can see so I don't know what the issues is and it's costing me too much to go

Информация о проекте

Бюджет
100+ USD
Сроки выполнения
от 1 до 8 дн.