Can anyone tell me why this code may not be working. It works fine without the "high() > highest(3,high())" portion.
if(getBarState()==BARSTATE_NEWBAR){
if(!Strategy.isLong() && vMA1.getValue(MAStudy.MA,-1) > vMA2.getValue(MAStudy.MA,-1) &&
high() > highest (3, high())){
Strategy.doLong("Long",Strategy.CLOSE,Strategy.THI SBAR);
Alert.playSound("ding.wav");
nStopPrice = close()-(2*atr(14));
}
Any help would be greatly appreciated.
Thanks
if(getBarState()==BARSTATE_NEWBAR){
if(!Strategy.isLong() && vMA1.getValue(MAStudy.MA,-1) > vMA2.getValue(MAStudy.MA,-1) &&
high() > highest (3, high())){
Strategy.doLong("Long",Strategy.CLOSE,Strategy.THI SBAR);
Alert.playSound("ding.wav");
nStopPrice = close()-(2*atr(14));
}
Any help would be greatly appreciated.
Thanks
Comment