ty//ALMA
_SECTION_BEGIN("ALMA");
p = ParamField("Price Field");
windowSize = Param("Window Size", 9, 5, 201, 2);
sigma = Param("Sigma", 6, 1, 20);
Offset = Param("Offset", 0.85, 0.05, 1.0, 0.05);
m = floor(Offset * (windowSize - 1));
s = windowSize / sigma;
w = 0;
wSum = 0;
for(i = 1; i < windowSize; i++)
{
w[i] = exp(-((i-m)*(i-m))/(2*s*s));
wSum += w[i];
}
for(i = 1; i < windowSize; i++)
{
w[i] = w[i] / wSum;
}
alma = Null;
for(j = 1; j < BarCount; j++)
{
alSum = 0;
if(j < windowSize)
{
alma[j] = Null;
}
else
{
for(i = 1; i < windowSize; i++)
{
alSum += p[j - (windowSize - 1 - i)] * w[i];
}
alma[j] = alSum;
}
}
_SECTION_END();
//Moving Average
MA10 = MA(C, 10);
MA20 = MA(C, 20);
MA50 = MA(C, 50);
MA100 = MA(C, 100);
//Volume
Highvolume = (Volume * Avg) > 5000000;
//Risk Management
SetOption("InitialEquity", 100000);
SetPositionSize(1, spsPercentOfEquity);
ApplyStop(stopTypeLoss, stopModePercent, Optimize( "max. loss stop level", 10, 5, 15, 1 ), True );
//Execution
Buy = C > alma AND highvolume;
Sell = C < alma;
Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);
// PLOT SIZE
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
Plot( Close, "Price", colorBlack, styleCandle );
PlotShapes( shappe or paste code here
It shows alert like these .