Lsma Indicator For MT4
Lsma Indicator For MT4的Lsma Indicator For MT4主要用于在价格图表中找到趋势反转的迹象。您会发现红色的粗体移动平均线。当价格在红线上方交易时,您会注意到价格强劲反弹。相反,当价格在红线以下交易时,您需要寻找空头交易信号。尝试在较长时期内使用此工具,以便您不必应对市场中的微小趋势变化。
安装Lsma Indicator For MT4
通过上面的表格下载指标后,您需要解压缩zip文件。然后,您需要将文件lsma.mq4复制到MT4安装的文件夹MQL4Indicators中。之后,请重启MT4,然后您将能够在指标列表中看到该指标。
Lsma Indicator For MT4参数
Lsma Indicator For MT4具有要配置的2 参数。
extern int period=50;
extern int CountBars=10000; // Êîëè÷åñòâî îòîáðàæàåìûõ áàðîâ
Lsma Indicator For MT4缓冲区
Lsma Indicator For MT4提供1 缓冲区。
SetIndexBuffer(0,buffer);
守则主要部分
void start()
{
int counted_bars=IndicatorCounted();
int limit=Bars-counted_bars;
if(counted_bars==0)
{
limit-=(period+1);
limit=MathMin(CountBars,limit);
}
for(int i=0; i lt limit; i++)
{
buffer[i]=LSMA(period,i);
}
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
double LSMA(int ma_period,int shift)
{
double lengthvar;
double tmp;
double sum=0;
for(int i=ma_period; i gt =1; i--)
{
lengthvar=(ma_period+1)/3;
tmp=(i-lengthvar)*Close[ma_period-i+shift];
sum+=tmp;
}
double value=sum*6/(ma_period*(ma_period+1));
return(value);
}
//+------------------------------------------------------------------+