Hello There,
I started backtesting crossing two moving averages 20 and 40 MA including 5 minutes candles.
Code below:
var fast = new MAStudy(20, 0, "Close", MAStudy.SIMPLE);
var slow = new MAStudy(40, 0, "Close", MAStudy.SIMPLE);
function preMain() {
setStudyTitle("MA_Crossover");
setPriceStudy(true);
setColorPriceBars(true);
setDefaultPriceBarColor(Color.black);
setShowCursorLabel(false);
}
function main() {
var f = fast.getValue(MAStudy.MA);
var s = slow.getValue(MAStudy.MA);
if(f == null || s == null)
return;
if(f >= s && !Strategy.isLong())
Strategy.doLong("Crossing Up", Strategy.MARKET, Strategy.THISBAR);
if(f < s && !Strategy.isShort())
Strategy.doShort("Crossing Down", Strategy.MARKET, Strategy.THISBAR);
if(Strategy.isLong())
setPriceBarColor(Color.lime);
else if(Strategy.isShort())
setPriceBarColor(Color.red);
return new Array(f,s);
}
The Problem is that I set up a time template with 1095 day! But eSignal tests back only from 14.07.08 - 31.12.08. This are approx. 5 a half months but not 3 years according to 1095 days. Is there a limitation regarding backwarding 5 minute candles 3 years?
Many thanks.
Roland
I started backtesting crossing two moving averages 20 and 40 MA including 5 minutes candles.
Code below:
var fast = new MAStudy(20, 0, "Close", MAStudy.SIMPLE);
var slow = new MAStudy(40, 0, "Close", MAStudy.SIMPLE);
function preMain() {
setStudyTitle("MA_Crossover");
setPriceStudy(true);
setColorPriceBars(true);
setDefaultPriceBarColor(Color.black);
setShowCursorLabel(false);
}
function main() {
var f = fast.getValue(MAStudy.MA);
var s = slow.getValue(MAStudy.MA);
if(f == null || s == null)
return;
if(f >= s && !Strategy.isLong())
Strategy.doLong("Crossing Up", Strategy.MARKET, Strategy.THISBAR);
if(f < s && !Strategy.isShort())
Strategy.doShort("Crossing Down", Strategy.MARKET, Strategy.THISBAR);
if(Strategy.isLong())
setPriceBarColor(Color.lime);
else if(Strategy.isShort())
setPriceBarColor(Color.red);
return new Array(f,s);
}
The Problem is that I set up a time template with 1095 day! But eSignal tests back only from 14.07.08 - 31.12.08. This are approx. 5 a half months but not 3 years according to 1095 days. Is there a limitation regarding backwarding 5 minute candles 3 years?
Many thanks.
Roland
Comment