I noticed that EndDate does not seem to work when I use my own Assets.csv file with price history downloaded from Yahoo.
When I set StartDate = 2005 and EndDate = 2006 the simulation still runs until now (2017).
This script reproduces the error:
Code:
function run()
{
StartDate = 2005;
EndDate = 2006;
BarPeriod = 1440;
Capital = 10000;
Margin = 650;
assetList("AssetsFXCMCFD.csv");
assetHistory("MSFT", FROM_YAHOO);
while (asset(loop("MSFT")))
{
vars price = series(priceClose());
var rsi = RSI(price, 2);
LifeTime = 5;
if (NumOpenLong == 0 && rsi < 5)
enterLong();
}
}
I get this in the simulation results:
Code:
Simulated account AssetsFXCMCFD.csv
Bar period 24 hours (avg 2088 min)
Test period 28.04.2005-12.01.2017 (2948 bars)
Lookback period 80 bars (16 weeks)
This is the relevant line for the AssetsFXCMCFD.csv: