find specific values ​​in series

Questions about MultiCharts .NET and user contributed studies.
HellGhostEvocatorX
Posts: 74
Joined: 10 Feb 2022
Has thanked: 44 times
Been thanked: 8 times

find specific values ​​in series

Postby HellGhostEvocatorX » 07 May 2022

I don't know if the title really fits.

I need the previous high point and the one before and possibly before... I rebuilt the zigzag indicator (with the pivotHigh function).

so I use

Code: Select all

m_swingpriceH = new VariableSeries<Double>(this);


My problem is how do I find the previous highs? I get the last one for example

m_swingpriceH[1]

.


With

m_swingpriceH[2]

I would only get the price from 2 bars ago though.

But I don't know how many bars ago the previous high was...

I was thinking of making an array and filling it with northings so I could write [2] for the previous one.
However, I have read that the arrays in multicharts are always filled with 0 if there is no value for a candlestick.
However, I don't know how to include arrays in Multicharts.net either. Is there a simple example here somewhere?
So far I've been using variable objects and series

Now I'm at a loss, I've tried and read a lot, but somehow I couldn't find anything. The solution is probably very simple, but I can't figure it out.

Maybe someone has an idea.

HellGhostEvocatorX
Posts: 74
Joined: 10 Feb 2022
Has thanked: 44 times
Been thanked: 8 times

Re: find specific values ​​in series

Postby HellGhostEvocatorX » 07 May 2022

hmmm just got those

https://www.multicharts.com/support/bas ... highvsbar/

Function "again" found.
It might work, I'll try it tomorrow :)

Other ideas are of course always welcome ;)

I've learned a lot through trial and error, but sometimes a nudge in the right direction is a lot more effective :D

HellGhostEvocatorX
Posts: 74
Joined: 10 Feb 2022
Has thanked: 44 times
Been thanked: 8 times

Re: find specific values ​​in series

Postby HellGhostEvocatorX » 17 May 2022

Code: Select all

using System.Collections.Generic; private List<Double> xyz xyz = new List<Double>();
Hello again :) I managed to do that with the high memory with an array. That's not my problem anymore.
After a long search, I found what I was looking for at tradingcode.net :) the keyword "list" helped me here.

1.
Now I have the problem how to perform actions only on the next bar.

So I want to sort of process a step chain

if step 1 save x

if step 2 (next bar) save y

if step 3 (next bar)
delete x and y

I don't want to include any condition, like the value is bigger, then do this or that, just do something when there's a new bar.
So I just want to look at the time plane.




2.
I also have the problem, if I want to run through a for-loop, for example, it always runs through it only for the current bar and not e.g. for the next bars.

How do I do it?

HellGhostEvocatorX
Posts: 74
Joined: 10 Feb 2022
Has thanked: 44 times
Been thanked: 8 times

Re: find specific values ​​in series

Postby HellGhostEvocatorX » 20 May 2022

So I have now solved the whole thing as follows, since the entire programming is probably run through exactly once per bar, I simply took a counter, which then counts up to 1 for the current bar and then to 2 for the next one. So if the counter is 2 is I have the next bar.
After a fixed condition, it is then set to zero again :)

But maybe there is an easier way.

Code: Select all

[code] x34.Value++; if (x34.Value>=2) { x31.Value = 0;//next Bar
[/code]


Return to “MultiCharts .NET”