I have historical prices on SP500. If i put in 01-01-1950 as from date and 01-05-2010 as to date and then test a strategy notting appears on summary. Every thing is $0, but the Chart appears correctly, but there is no executions, trades or orders.
The test strategy is pretty simple. Buy if the short average cross above the long average and sell when the short average cross below the long average.
protectedoverridevoid OnBarUpdate()
{
// Condition set 1
if (CrossAbove(SMA(MediumAverage), SMA(LongAverage), 1))
{
EnterLong(DefaultQuantity, "BUY");
}
// Condition set 2
if (CrossBelow(SMA(MediumAverage), SMA(LongAverage), 1))
{
ExitLong("SELL", "");
}
}
I hope someone can help me.
Comment