Every Tick in Sequence in Difference Indexes of an Array on Same Bar [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
Jobauma
Posts: 109
Joined: 16 Apr 2013
Has thanked: 24 times
Been thanked: 4 times

Every Tick in Sequence in Difference Indexes of an Array on Same Bar [SOLVED]

Postby Jobauma » 13 Jan 2019

Hi.

This is something I'm wondering if is possible. Is it possible to get the sequence of every tick in different indexes of an array on the same bar? :)

Example:

Code: Select all

if (Bars.Time[0])
{
Array.Value = Bars.Close[0];

// Array[0] = 0.5500 // Tick 1
// Array[1] = 0.5501 // Tick 2
// Array[2] = 0.5499 // Tick 3
// Array[3] = 0.5499 // Tick 4 ( Same tick, different index )
}
Instead of:

Code: Select all

if (Bars.Time[0])
{
Array.Value = Bars.Close[0];

// Array[0] = 0.5500 // Tick 1
// Array[0] = 0.5501 // Tick 2
// Array[0] = 0.5499 // Tick 3
// Array[0] = 0.5499 // Tick 4
}


Best regards,
Johannes Hillestad Baumann
Last edited by Jobauma on 13 Jan 2019, edited 1 time in total.

Jobauma
Posts: 109
Joined: 16 Apr 2013
Has thanked: 24 times
Been thanked: 4 times

Re: Every Tick in Sequence in Difference Indexes of an Array on Same Bar

Postby Jobauma » 13 Jan 2019

Hi.

I solved it with storing the previous tick change ( only interested in the previous tick value ) :)

Code: Select all

// If High has Changed ( not Low )
if ( Bars.High[0] != m_PreviousTick_High &&
Bars.Low[0] == m_PreviousTick_Low )
m_HighLow = Bars.High[0];

// If Low has Changed ( not High )
else if ( Bars.Low[0] != m_PreviousTick_Low &&
Bars.High[0] == m_PreviousTick_High )
m_HighLow = Bars.Low[0];

// Previous Tick Updated to Current Tick ( Previous Tick Next Time )
m_PreviousTick_High = Bars.High[0];
m_PreviousTick_Low = Bars.Low[0];
Thanks.



Best regards,
Johannes Hillestad Baumann


Return to “MultiCharts .NET”