problem trying to assign value from one loop to a set of arrays - page 2

 
Lorentzos Roussos:
I'm guessing you are trying to create a "Map" of where the highs are and where the lows are for future fast access.

Provided you are starting the scan from right to left , keep a value of the previous found point (high or low,bar value) and when you find a high or low 
with the zigzag then pass the point of the current high/low (bar value) into your storing array.
The HighsMap and the LowsMap must be a series array just like OHLC arrays so that HighsMap[0] corresponds to bar 0.
Now since data is always coming into the chart , the Map must be constructed as a distance from the next high/low (hence the right to left scan)isi

is it possible for u to show me in term of how the coding should be, conceptually.

 
Minions Labs:

your code is incomplete.

You are mentioning 2 arrays

that we don`t know where they come from. Are they globals? are they initialized correctly? If you are new to MQL5, take a look at Variables Scope. Maybe this is your problem.


;)

u r right this is part of the standard zigzag code from mql5.com, i left out the whole code to focus on the part i'm having problem with.

the Highmapbuffer[i] is the value of the high bar and i is the bar number or position of that corresponding high bar produced by other part of zigzag code 

the comments are part of what i'm trying to extract the high values from this section of the code, any idea of what i might have done wrong?

Reason: