Bars with Zero, Negative values or not coherent prices  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
ALC
Posts: 25
Joined: 13 May 2011
Has thanked: 8 times
Been thanked: 3 times

Bars with Zero, Negative values or not coherent prices

Postby ALC » 02 Oct 2014

My question is relatively simple,

I made a small script to test the quality of the data I'm using:

var cond1 = bar.OpenValue == 0;
var cond2 = bar.HighValue == 0;
var cond3 = bar.LowValue == 0;
var cond4 = bar.CloseValue == 0;
var condPriceMissing = cond1 || cond2 || cond3 || cond4;

var cond5 = bar.OpenValue < 0;
var cond6 = bar.HighValue < 0;
var cond7 = bar.LowValue < 0;
var cond8 = bar.CloseValue < 0;
var condPriceNegative = cond5 || cond6 || cond7 || cond8;

var cond9 = bar.HighValue < bar.OpenValue;
var cond10 = bar.HighValue < bar.CloseValue;
var cond11 = bar.LowValue > bar.OpenValue;
var cond12 = bar.LowValue > bar.CloseValue;
var condPriceNotCoherent = cond9 || cond10 || cond11 || cond12;

if (condPriceMissing)
{
//Log
}
else
{
if (condPriceNegative) { //Log return; }
if (condPriceNotCoherent) //Log
}

I discovered the following:
a very little percent of the data is missing
a greater percent is negative
a greater percent again is not coherent.

On the top 1000 instruments per volume:
4 are missing
10 are with negative values
254 are not coherent for a total of about 500 bars...

So my wandering is: how does multi-charts manage those three situations?
Should I check the coherence of each bar on my scripts, which are the best pratics on those cases?

I think that a tool on quote manager will be very helpful, providing alternatives like interpolation and so on...

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Bars with Zero, Negative values or not coherent prices

Postby Henry MultiСharts » 02 Oct 2014

Hello ALC,

What is the source of this data?
Is your question related to saving this data to the database or you want to know how the code will be calculated on such data?

ALC
Posts: 25
Joined: 13 May 2011
Has thanked: 8 times
Been thanked: 3 times

Re: Bars with Zero, Negative values or not coherent prices

Postby ALC » 02 Oct 2014

Both of them if you want:

How does MC manage those 3 situations?
1) One of the 4 prices is missing
2) Negative
3) Not coherent

And if there is any tool/way/script to check fix them in Quote Manager.

Thanks.

ALC.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Bars with Zero, Negative values or not coherent prices  [SOLVED]

Postby Henry MultiСharts » 03 Oct 2014

1) One of the 4 prices is missing
One of the prices cannot be missing. The price is always present - positive, negative or zero.
2) Negative
Negative prices cannot be used for strategy calculation, but can be saved to the database and used for indicator calculation.
3) Not coherent
If the price values do not correspond to the selected price scale/min move then they will be shown "as is" on a chart and will not be adjusted.
And if there is any tool/way/script to check fix them in Quote Manager.
You can go to Edit Data window and search for the required data entry, then modify it: Editing_Data#Finding_Data


Return to “MultiCharts .NET”