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

Tarea técnica

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


Archivos adjuntos:

Han respondido

1
Desarrollador 1
Evaluación
(5)
Proyectos
7
29%
Arbitraje
2
50% / 0%
Caducado
2
29%
Libre
2
Desarrollador 2
Evaluación
(17)
Proyectos
19
26%
Arbitraje
3
67% / 33%
Caducado
2
11%
Trabaja
3
Desarrollador 3
Evaluación
(10)
Proyectos
25
28%
Arbitraje
2
0% / 0%
Caducado
1
4%
Trabajando
4
Desarrollador 4
Evaluación
(51)
Proyectos
58
52%
Arbitraje
1
0% / 0%
Caducado
0
Libre
5
Desarrollador 5
Evaluación
(8)
Proyectos
18
17%
Arbitraje
3
67% / 0%
Caducado
0
Libre
6
Desarrollador 6
Evaluación
(63)
Proyectos
84
26%
Arbitraje
23
22% / 48%
Caducado
23
27%
Libre
7
Desarrollador 7
Evaluación
(42)
Proyectos
88
14%
Arbitraje
30
30% / 57%
Caducado
36
41%
Trabaja
Solicitudes similares
Hello great developer i need a developer that can work on a Tradorvate trade copier i want to create tradorvate trade copier I will be available for to answer any questions Thanks Peace be unto you
The overall goal is to develop a backtester for external binary options indicators that give output buffers (arrows) for signals that will reveal the most profitable expiration times and what hours are best to trade. I want you to deliver the source code and I retain rights to the code. I want to discover for example on a 5min chart whether 1 minute, 2 minute or 8 minute, etc expiration time is most profitable. I
Life Creator 40 - 1000 USD
the topic of this robot is ,,life creator'' becouse when you have no idea what to do, this robot can help you and teach you how you can do it. The robot gonna creat you your own tactics which can help you in future. When you gonna see that it's really work you start to be happy and you gonna want to have more of this
You need to be able to convert the IBS Indicator which is written like this in ProRealCode: r = max(range,0.0001) ibs = (close-low)/r Also, you need to be able to convert the Momentum indicator written like this in ProRealCode: https://www.prorealcode.com/documentation/momentum/ Return value of the Momentum technical indicator of the Nth bar : (close – close of the N-th last bar). 1 Momentum [ N ] Calculation: It is
Hft live account 30 - 200 USD
i need a high frequency trading (hft) expert advisor, that can be used to trade on demo and live accounts icmarket and 8cap. The EA has to be highly profitable, giving daily profit. If a test version is available, please send, to foster a faster transaction. like the ones that pass prop firm and demo but adjustment where it work on live with low latency
Hello [Programmer's Name], I hope this message finds you well. I am seeking your expertise to develop a forex Expert Advisor (EA) capable of identifying trading opportunities based on crossover signals from the following indicators: - MACD - RSI (including Connor RSI) - Stochastic RSI - Stochastic - Moving Averages (MA) with periods: 5, 10, 20, 50, 100, and 200 Key requirements for the EA include: - Integration of
Hello, i need a robot for gold trading being able to determine a trend or instant changes on a micro scale so its just going to scalp very fast but, for example lets say we have an equity of 500 bucks it needs to take profit at 5 and open a new position and just continiue going like that all day, but i also want it to determine buying opportunities based off of a very wide range of candlestick data of gold the day
CPI ROBOKING 30+ USD
*Strategy: CPI-Based Trading* *Instruments:* XAUUSD (Gold), UsTech100 (Nasdaq 100), USDJPY *CPI Release:* 1. *Higher-than-expected CPI:* - XAUUSD: SELL (Gold prices may drop due to potential rate hike) - UsTech100: SELL (Tech stocks may drop due to potential rate hike) - USDJPY: BUY (USD may strengthen due to potential rate hike) 2. *Meets or lower-than-expected CPI:* - XAUUSD: BUY (Gold prices may rise due
Hello, I have an EA already created and what I require is a modification to the code so that when a backtest is executed, it generates a CSV file with custom data that I want to extract to perform an analysis of the backtest operations
Create mt4 ea 50+ USD
To convert the provided MT4 indicator script into an Expert Advisor (EA) and implement prompt functionality for user input, we need to modify the code to handle external parameters and provide a user-friendly interface. Below is the EA code that incorporates prompts for user inputs

Información sobre el proyecto

Presupuesto
100+ USD
IVA (21%): 21 USD
Total: 121 USD
Para el ejecutor
90 USD
Plazo límite de ejecución
de 1 a 8 día(s)