var study = new MAStudy(2, 2, "OHLC/4", MAStudy.EXPONENTIAL);
function preMain() {
setPriceStudy(true);
}
function main() {
var v = study.getValue(MAStudy.MA);
if(v == null)
return;
if(close() >= v) {
Alert.email("es geht hoch", "HOCH!");
vLastAlert = 1;
Alert.addToList(getSymbol(), "Es geht Aufwaerts", Color.black, Color.green );
if(!Strategy.isLong()) {
Strategy.doLong("Aufwaerts!", Strategy.MARKET, Strategy.THISBAR);
}
} else {
Alert.email("es geht runter", "RUNTER!");
vLastAlert = 1;
Alert.addToList(getSymbol(), "Es geht Runter", Color.white, Color.red );
if(!Strategy.isShort()) {
Strategy.doShort("Abwaerts!", Strategy.MARKET, Strategy.THISBAR);
}
}
if(Strategy.isLong()) {
setBarBgColor(Color.green);
} else if(Strategy.isShort()) {
// setBarBgColor(Color.red);
}
return v;
}
function preMain() {
setPriceStudy(true);
}
function main() {
var v = study.getValue(MAStudy.MA);
if(v == null)
return;
if(close() >= v) {
Alert.email("es geht hoch", "HOCH!");
vLastAlert = 1;
Alert.addToList(getSymbol(), "Es geht Aufwaerts", Color.black, Color.green );
if(!Strategy.isLong()) {
Strategy.doLong("Aufwaerts!", Strategy.MARKET, Strategy.THISBAR);
}
} else {
Alert.email("es geht runter", "RUNTER!");
vLastAlert = 1;
Alert.addToList(getSymbol(), "Es geht Runter", Color.white, Color.red );
if(!Strategy.isShort()) {
Strategy.doShort("Abwaerts!", Strategy.MARKET, Strategy.THISBAR);
}
}
if(Strategy.isLong()) {
setBarBgColor(Color.green);
} else if(Strategy.isShort()) {
// setBarBgColor(Color.red);
}
return v;
}
(Buy Put , Buy Call) at this time there is Call , Call , Call, Call , Put or so...
please help
Comment