Hi, friends,
Please, I need help to modifie this formula, because times in times I need to reload it.
Is there some way to have no need to reload it?
Please, I need help to modifie this formula, because times in times I need to reload it.
Is there some way to have no need to reload it?
PHP Code:
function preMain() {
setPriceStudy(true);
setStudyTitle("Break2NX");
setColorPriceBars(true);
setDefaultPriceBarColor(Color.yellow);
}
function main() {
var vHL = high() - low();
var vVar = vHL * 0.35;
var vAddVar = vVar * 0.50;
if(close() > high(-1) && !Strategy.isLong()){
Strategy.doLong("Long", Strategy.MARKET, Strategy.NEXTBAR);
drawShapeRelative(0, low() - vVar, Shape.UPARROW, "", Color.blue, null, "buyShp" + getValue("time"));
}
if(close() < low(-1) && !Strategy.isShort()){
Strategy.doShort("Short", Strategy.MARKET, Strategy.NEXTBAR);
drawShapeRelative(0, high() + vVar, Shape.DOWNARROW, "", Color.yellow, null, "sellShp" + getValue("time"));
}
if(Strategy.isLong())
setPriceBarColor(Color.navy);
if(Strategy.isShort())
setPriceBarColor(Color.red);
return;
}
Comment