Topic: Invalid pointer access error
Hi, I am having a problem with any strategy I create to EA that it says "invalid pointer access in 'strat-name.mq4' (3013,19)
void Strategy::GetRequiredCharts(string &charts[])
{
ArrayResize(charts,1);
charts[0]=GetSymbol()+","+DataPeriodToString(GetPeriod());
for(int i=0; i<Slots(); i++)
{
if(!Slot[i].IndicatorPointer.IsAllowLTF)
continue;
if(!IsLongerTimeFrame(i))
continue;
string chart=GetSlotChart(i);
if(!ArrayContainsString(charts,chart))
ArrayAppendString(charts,chart);
}
}
It says the problem is this line:
if(!Slot[i].IndicatorPointer.IsAllowLTF)
Is there a quick solution within EA code that I can fix? I am also trying to learn EA coding so I am using this as practice. Thank you.