Hi,
The code here give an alert when the market is open but it the alert continue to pop on each tick.
Any suggestion that let the alert trigger only one time would be very much apprecaited.
Thank you,
Safa
function preMain(){
setPriceStudy(true);
setStudyTitle("marketisopen");
setShowCursorLabel(false);
}
function main(){
if (getBarState() == BARSTATE_NEWBAR) {
BarHr = getHour();
BarMin = getMinute();
cBarTimeInt =BarHr*100+BarMin*1;
if( cBarTimeInt ==830 ) {
Alert.addToList(getSymbol(), "Market is now open!", Color.lime, Color.black );
}
return null
}
}
The code here give an alert when the market is open but it the alert continue to pop on each tick.
Any suggestion that let the alert trigger only one time would be very much apprecaited.
Thank you,
Safa
function preMain(){
setPriceStudy(true);
setStudyTitle("marketisopen");
setShowCursorLabel(false);
}
function main(){
if (getBarState() == BARSTATE_NEWBAR) {
BarHr = getHour();
BarMin = getMinute();
cBarTimeInt =BarHr*100+BarMin*1;
if( cBarTimeInt ==830 ) {
Alert.addToList(getSymbol(), "Market is now open!", Color.lime, Color.black );
}
return null
}
}
Comment