Thought that you wanted someone to backtest and "rate" the code as good or bad.
Thanks for the detail this time! So, if I am correct you want to Buy when Price (assuming as Close) crosses its WMA of 400 period and Sell otherwise, is that right?
For e.g.:
//https://forum.amibroker.com/t/afl-signals-buy/12805/4
_SECTION_BEGIN( "Signals using WMA" );
SetChartOptions( 0, chartShowDates );
Price = ParamField( "Price Field", 3 );
per = Param( "WMA Period", 400, 1, 1000, 1 );
ClrWMA = ParamColor( "WMA Color", ColorRGB( 70, 160, 255 ) );
WMAc = WMA( Price, per );
Buy = Cross( C, WMAc );
Sell = Cross( WMAc, C );
Buy = Cover = ExRem( Buy, Sell );
Sell = Short = ExRem( Sell, Buy );
Plot( C, "Price Candle", colorDefault, styleCandle );
Plot( WMAc, "WMA", ClrWMA, styleThick );
PlotShapes( IIf( Buy, shapeUpArrow, shapeNone ), colorBrightGreen, 0, L, -15 );
PlotShapes( IIf( Sell, shapeDownArrow, shapeNone ), colorRed, 0, H, -15 );
Title =
"{{DATE}}" +
"\nO " + NumToStr( O, 1.2 ) + " H " + NumToStr( H, 1.2 ) + " L " + NumToStr( L, 1.2 ) + " C " + NumToStr( C, 1.2 );
_SECTION_END();
Not a problem at all, you can always use free Google translator (Persian to English). Like I know nothing of Persia or Persian but still can Copy/Paste to convey a message (thanks to Google).
دفعه بعد که یک کد را کپی کنید
لطفا منبعی را که از آن کپی کرده اید ذکر کنید
لطفا در هنگام ارسال درخواست خود از برچسب کد استفاده کنید
لطفا این را بخوانید
آخر هفته خوبی داشته باشی
P.S. The primary language of this forum is English. What I copy/pasted in Persian was just to show an example to help OP overcome language barrier while posting here.