I want an Alert for High Volume Bar.
This alert keeps repeating for every bar. I want it only for High Volume Bar. Please help. Thanks
Code:
_SECTION_BEGIN("HighVol");
//Peaking Volumes
HiVolume = IIf(V > (2 * EMA(V,10)), True, False);
LoVolume = IIf(V < (2 * EMA(V,10)), True, False);
HiVolume = ExRem(HiVolume,LoVolume);
LoVolume = ExRem(LoVolume,HiVolume);
IIf(HiVolume, Say (" High Volume be alert"),Null);
PlotShapes(shapeSmallCircle * HiVolume, IIf(C > O, colorBlack, colorWhite), 0, (O+C)/2, 0);
_SECTION_END();
Let me know if this is what you are looking for.
C-like:
function SayOnCond( Text, SecondSpan )
{
elapsed = GetPerformanceCounter() / 1000;
LastElapsed = Nz( StaticVarGet( "#lastsaytime" + Name(), False ) );
if( ( StaticVarGet( "#Say" + Name(), False ) ) AND ( elapsed - LastElapsed > SecondSpan ) )
{
StaticVarSet( "#lastsaytime" + Name(), elapsed, False );
Say( Text, True );
}
}
_SECTION_BEGIN("HighVol");
//Peaking Volumes
HiVolume = IIf(V > (2 * EMA(V,10)), True, False);
LoVolume = IIf(V < (2 * EMA(V,10)), True, False);
HiVolume = ExRem(HiVolume,LoVolume);
LoVolume = ExRem(LoVolume,HiVolume);
if( LastValue( HiVolume ) )
{
StaticVarSet( "#Say" + Name(), 1, False );
SayOnCond( "High Volume be alert", 60 );
}
else
{
StaticVarSet( "#Say" + Name(), 0, False );
}
Plot( C, "", colorDefault, styleCandle );
PlotShapes(shapeSmallCircle * HiVolume, IIf(C > O, colorBlack, colorWhite), 0, (O+C)/2, 0);
_SECTION_END();
Last edited: