请帮忙把MT4指标LSMA改成博易指标,谢谢 [博易POBO]
咨询内容:
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
extern int period=50;
extern int CountBars=10000; // 暑腓麇耱忸 铗钺疣驵屐 徉痤?
double buffer[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void init()
{
SetIndexStyle(0,DRAW_LINE,0,2);
SetIndexBuffer(0,buffer);
SetIndexLabel(0,"Value");
SetIndexDrawBegin(0,0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
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<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>=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);
}
//+------------------------------------------------------------------+
请帮忙把MT4指标LSMA改成博易指标,谢谢
#property link "mandorr@gmail.com"#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
extern int period=50;
extern int CountBars=10000; // 暑腓麇耱忸 铗钺疣驵屐 徉痤?
double buffer[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void init()
{
SetIndexStyle(0,DRAW_LINE,0,2);
SetIndexBuffer(0,buffer);
SetIndexLabel(0,"Value");
SetIndexDrawBegin(0,0);
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
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<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>=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);
}
//+------------------------------------------------------------------+
来源:程序化99网( WWW.CXH99.COM )
博易技术人员: 就是程序中的LSMA函数,能改成博易函数实现吗? 您好,无法修改。 来源 程序化久久网
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信号:cxh99cxh99 进行 有偿收费 编写!
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容