Hi. Im new to efs. Im making everything with note pad (as to say hacking up other code). Im using this basic 8/21 crossover ema for backtesting right now. How do I make the 8 ema white and the 21 blue? They are both white right now. Thanks!
PHP Code:
var fast = new MAStudy(8, 0, "Close", MAStudy.EXPONENTIAL);
var slow = new MAStudy(21, 0, "Close", MAStudy.EXPONENTIAL);
function preMain() {
setPriceStudy(true);
setColorPriceBars(true);
setDefaultPriceBarColor(Color.white);
}
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.blue);
else if(Strategy.isShort())
setPriceBarColor(Color.red);
return new Array(f,s);
}
Comment