It looks like when I want to trade I need to manually make sure to only trade in the market hours as a test run did not work. It wanted to trade at midnight.
Now the issue is, that I only have daily data from Yahoo with a BarPeriod of 1440. So using a smaller BarPeriod when training and testing does not work.
I imagined I might be able to do something like the following code, but only when trading and still train only on the daily Yahoo data:
while (asset(loop(...)))
{
if (is(TRADEMODE))
{
FrameOffset = 15;
AssetZone = ET;
if (lhour(AssetZone) == FrameOffset) {
TimeFrame = -AssetVar[0];
AssetVar[0] = 0;
} else {
TimeFrame = 0;
AssetVar[0]++;
}
}
Trade();
}
This should make sure that trades always get executed at 15:00 local time when the market is open.
Now I am not sure if this approach will work, when I train with BarPeriod 1440 and then set BarPeriod to 60 together with the above approach.
Does anyone have experience with this and some advice? Can I do like that or do I really need hourly data for this to work?