MT4的MACD、KD、RSI怎样弄到文华财经上?
创始人
2024-10-09 08:35:48
0

MACD

有没有大神能把MT4上的单线MACD指标改成通达信,或者文华财经能用的,万分感谢下面是指标源码:

//+------------------------------------------------------------------+

//|                                                  Custom MACD.mq4 |

//|                   Copyright 2005-2014, MetaQuotes Software Corp. |

//|                                               |

//+------------------------------------------------------------------+

#property copyright   2005-2014, MetaQuotes Software Corp.

#property link        

#property description Moving Averages Convergence/Divergence

#property strict

#include

//--- indicator settings

#property  indicator_separate_window

#property  indicator_buffers 2

#property  indicator_color1  Silver

#property  indicator_color2  Red

#property  indicator_width1  2

//--- indicator parameters

input int InpFastEMA=12;   // Fast EMA Period

input int InpSlowEMA=26;   // Slow EMA Period

input int InpSignalSMA=9;  // Signal SMA Period

//--- indicator buffers

double    ExtMacdBuffer[];

double    ExtSignalBuffer[];

//--- right input parameters flag

bool      ExtParameters=false;

//+------------------------------------------------------------------+

//| Custom indicator initialization function                         |

//+------------------------------------------------------------------+

int OnInit(void)

{

IndicatorDigits(Digits+1);

//--- drawing settings

SetIndexStyle(0,DRAW_HISTOGRAM);

SetIndexStyle(1,DRAW_LINE);

SetIndexDrawBegin(1,InpSignalSMA);

//--- indicator buffers mapping

SetIndexBuffer(0,ExtMacdBuffer);

SetIndexBuffer(1,ExtSignalBuffer);

//--- name for DataWindow and indicator subwindow label

IndicatorShortName(MACD(+IntegerToString(InpFastEMA)+,+IntegerToString(InpSlowEMA)+,+IntegerToString(InpSignalSMA)+));

SetIndexLabel(0,MACD);

SetIndexLabel(1,Signal);

//--- check for input parameters

if(InpFastEMA<=1 || InpSlowEMA<=1 || InpSignalSMA<=1 || InpFastEMA>=InpSlowEMA)

{

Print(Wrong input parameters);

ExtParameters=false;

return(INIT_FAILED);

}

else

ExtParameters=true;

//--- initialization done

return(INIT_SUCCEEDED);

}

//+------------------------------------------------------------------+

//| Moving Averages Convergence/Divergence                           |

//+------------------------------------------------------------------+

int OnCalculate (const int rates_total,

const int prev_calculated,

const datetime& time[],

const double& open[],

const double& high[],

const double& low[],

const double& close[],

const long& tick_volume[],

const long& volume[],

const int& spread[])

{

int i,limit;

//---

if(rates_total<=InpSignalSMA || !ExtParameters)

return(0);

//--- last counted bar will be recounted

limit=rates_total-prev_calculated;

if(prev_calculated>0)

limit++;

//--- macd counted in the 1-st buffer

for(i=0; i

ExtMacdBuffer=iMA(NULL,0,InpFastEMA,0,MODE_EMA,PRICE_CLOSE,i)-

iMA(NULL,0,InpSlowEMA,0,MODE_EMA,PRICE_CLOSE,i);

//--- signal line counted in the 2-nd buffer

SimpleMAOnBuffer(rates_total,prev_calculated,0,InpSignalSMA,ExtMacdBuffer,ExtSignalBuffer);

//--- done

return(rates_total);

}

//+------------------------------------------------------------------+

DIFF : EMA(CLOSE,12) - EMA(CLOSE,26), COLORSTICK;

DEA  : EMA(DIFF,9);

送你  都能用应该

相关内容

热门资讯

星火成炬|打开世界的方式   同样的夜晚灯火,有人看到璀璨街景,有人感怀思念故乡;同样的树叶飘落,有人伤感时间流逝,有人想到生...
权威数读丨金融支持实体经济:效...   2025年中国金融总量较快增长、社会综合融资成本进一步降低、金融结构不断优化、金融市场平稳运行,...
视频丨日本民众集会反对政府推进...   14日,部分日本民众在首相官邸前举行集会,要求日本首相高市早苗立即撤回错误言论,强烈抗议日本政府...
【中国那些事儿】外资持续加码彰...   中国日报网1月15日电 新年伊始,外资企业纷纷加码中国市场,多家企业宣布增加投资或启动新设施规划...
新华社评论员:切实把党中央重大...   新华社北京1月14日电 题:切实把党中央重大决策部署贯彻落实好——二论学习贯彻习近平总书记在二十...
“十五五”开好局起好步丨冰面上...   今年是“十五五”开局之年,我国将出台智能网联新能源汽车产业发展规划,以此推动新能源汽车产业高质量...
“十五五”电网投资4万亿元,创...   国家电网公司全面贯彻习近平新时代中国特色社会主义思想,深入贯彻党的二十大和二十届历次全会精神,坚...
著名电影表演艺术家陶玉玲逝世 ...   总台记者获悉,著名电影表演艺术家陶玉玲于今天(1月15日)下午在北京去世,享年92岁。其代表作有...
人民论坛网评 | 县域经济向“...   中央经济工作会议提出,统筹推进以县城为重要载体的城镇化建设和乡村全面振兴,推动县域经济高质量发展...
保险不只是合同,更是承诺 人们对保险的误解,往往从“花钱买纸”开始。很多人以为,交保费就是为了换一份合同,要是没出险,这笔钱就...