Topic: Data import - Exclude Weekend Data
I modified the script to remove Saturday and Sunday candles.
for (int i = bars - 1; i >= 0; i--)
{
if (TimeDayOfWeek(Time[i]) != 0 && TimeDayOfWeek(Time[i]) != 6)
{
StringAdd(time, IntegerToString((rates[i].time - millennium) / 60) + ",");
StringAdd(open, IntegerToString((int) MathRound(rates[i].open * multiplier)) + ",");
StringAdd(high, IntegerToString((int) MathRound(rates[i].high * multiplier)) + ",");
StringAdd(low, IntegerToString((int) MathRound(rates[i].low * multiplier)) + ",");
StringAdd(close, IntegerToString((int) MathRound(rates[i].close * multiplier)) + ",");
StringAdd(volume, IntegerToString(rates[i].tick_volume) + ",");
}
}
Everything worked well!
Today I decided to update my data and now the script has stopped working, giving me array out of range error for that if-statement.
Only change was MT update, did it mess up the script behaviour?