I have a visual and audio alert that goes off when a certain condition is met. However, when the criteria are met it goes off evey tick. I only need this to go off once when the criteria is met. Below is what I attempted to do in order to accoplish this. This did not work, any suggestions would be appreciated.
var LastRawtime;
nVol1 = volume(0);
nVol2 = volume(-1);
nDif = ( nVol1-nVol2 ) / nVol2;
if(getValue("rawtime",0)!=LastRawtime){
if ( nDif >= nPct ) {
setDefaultBarFgColor( fColor1, 0 );
Alert.playSound("laser2.wav");
Alert.addToList(getSymbol(), "BLUE VOLUME BAR - LOOK FOR TRADE !!",Color.black, Color.RGB(0,0,255));
LastRawtime = getValue ("rawtime",0);
-Nick
var LastRawtime;
nVol1 = volume(0);
nVol2 = volume(-1);
nDif = ( nVol1-nVol2 ) / nVol2;
if(getValue("rawtime",0)!=LastRawtime){
if ( nDif >= nPct ) {
setDefaultBarFgColor( fColor1, 0 );
Alert.playSound("laser2.wav");
Alert.addToList(getSymbol(), "BLUE VOLUME BAR - LOOK FOR TRADE !!",Color.black, Color.RGB(0,0,255));
LastRawtime = getValue ("rawtime",0);
-Nick
Comment