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...
Bars with Zero, Negative values or not coherent prices [SOLVED]
- 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
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?
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?
Re: Bars with Zero, Negative values or not coherent prices
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.
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.
- 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]
One of the prices cannot be missing. The price is always present - positive, negative or zero.1) One of the 4 prices is missing
Negative prices cannot be used for strategy calculation, but can be saved to the database and used for indicator calculation.2) Negative
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.3) Not coherent
You can go to Edit Data window and search for the required data entry, then modify it: Editing_Data#Finding_DataAnd if there is any tool/way/script to check fix them in Quote Manager.