請幫忙把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.tumamayizhan.com )
博易技術人員: 就是程序中的LSMA函數,能改成博易函數實現嗎? 您好,無法修改。 來源 程序化久久網
有思路,想編寫各種指標公式,交易模型,選股公式,還原公式的朋友
可聯系技術人員 QQ: 262069696 或微信號:cxh99cxh99 進行 有償收費 編寫!
(注:由于人數限制,QQ或微信請選擇方便的一個聯系我們就行,加好友時請簡單備注下您的需求,否則無法通過。謝謝您!)
相關文章
-
沒有相關內容