WMA crossover with Displaced WMA

I ma trying to create a Crossover of WMA (13) with WMA (13) displaced by 3...but even after showing in chart...its not giving buy sell signals...any expert please help in correction of this AFL

_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN("Bollinger Bands");
P = ParamField("Price field",-1);
Periods = Param("Periods", 20, 2, 100, 1 );
Width = Param("Width", 1, 0, 10, 0.05 );
Color = ParamColor("Color", colorLightGrey );
Style = ParamStyle("Style", styleLine | styleNoLabel ) | styleNoLabel;
Plot( bbt = BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), Color, Style );
Plot( bbb = BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), Color, Style );
PlotOHLC( bbt, bbt, bbb, bbb, "", ColorBlend( Color, GetChartBkColor(), 0.8 ), styleNoLabel | styleCloud | styleNoRescale, Null, Null, Null, -1 );
_SECTION_END();

_SECTION_BEGIN("MWMA");
Periods = 13;
Displace=0;
Plot( MWMA=WMA( C, 13), "MWMA",colorRed, styleLine,Displace);
_SECTION_END();

_SECTION_BEGIN("MDWMA");
P=C;
Periods = 13;
Displace = Param("Shift",3,1,25,1);
Plot( MDWMA=WMA( C, 13), "MDWMA", colorDarkYellow, styleLine, styleThick, styleDashed, Displace);

_SECTION_END();

Buy=Cross(MDWMA, MWMA);
Sell = Cross(MWMA,MDWMA);

image

Use the Ref() function instead:

MWMA=WMA( C, 13);
MDWMA=Ref(WMA( C, 13), -3);

I think you also have your arguments to the Cross() function reversed. Don't you want to Buy when the MA(13) crosses above the MA(13) value from three days prior? Currently you are Selling when this event occurs.