[MT4指标]sma+ema双趋势指标
附图指标,
mt4指标类型:趋势指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------+
//| i-GentorLSMA&EMA_v.1.0.mq4 |
//| FX Sniper, KimIV |
//| 2005.08.20 KimIV v.0.0 |
//| 杨邃桧桦 ? LSMA ? EMA |
//| 2005.08.20 KimIV v.0.2 |
//| 谚眭痤龛玷痤忄? 眢戾疣鲨? 忮瘃栝 ? i-GentorCCIM_v.0.2.mq4 |
//| 2005.08.21 KimIV v.1.0 |
//| 蔓礤? 忸 忭屮龛? 镟疣戾蝠 疣耨蝾?龛? 铗 眢?? 潆? 盘? ? LSMA |
//+------------------------------------------------------------------+
#property copyright "FX Sniper, KimIV"
#property link "http://www.kimiv.ru"
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 Yellow
#property indicator_color2 Blue
#property indicator_color3 Red
#property indicator_color4 Lime
//------- 马屮龛? 镟疣戾蝠? ------------------------------------------
extern int EMAPeriod = 34; // 襄痂钿 盘?
extern int LSMAPeriod = 25; // 襄痂钿 LSMA
extern int FromZero = 3; // 朽耨蝾?龛? 铗 眢脲忸泐 箴钼??
//------- 馏翦瘥 桧滂赅蝾疣 ------------------------------------------
double LineHighEMA;
double LineLowEMA;
double LSMABuffer1;
double LSMABuffer2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
void init() {
IndicatorDigits(2);
SetIndexBuffer(0, LineHighEMA);
SetIndexLabel (0, "EMA 恹 鲥睇");
SetIndexStyle (0, DRAW_LINE, STYLE_SOLID, 3);
SetIndexBuffer(1, LineLowEMA);
SetIndexLabel (1, "EMA 龛驽 鲥睇");
SetIndexStyle (1, DRAW_LINE, STYLE_SOLID, 3);
SetIndexBuffer(2, LSMABuffer1);
SetIndexLabel (2, "LSMA 恹 鲥睇");
SetIndexStyle (2, DRAW_LINE, STYLE_SOLID, 3);
SetIndexBuffer(3, LSMABuffer2);
SetIndexLabel (3, "LSMA 龛驽 鲥睇");
SetIndexStyle (3, DRAW_LINE, STYLE_SOLID, 3);
Comment("");
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start() {
double sum, lengthvar, tmp, wt;
int i, shift, counted_bars = IndicatorCounted();
int Draw4HowLong, loopbegin;
if (counted_bars<0) return;
if (counted_bars>0) counted_bars--;
counted_bars = Bars - counted_bars;
for (shift=0; shiftEmaValue) LineHighEMA[shift] = EMPTY_VALUE;
if (Close[shift]=0; shift--) {
sum = 0;
for (i=LSMAPeriod; i>=1; i--) {
lengthvar = LSMAPeriod + 1;
lengthvar /= 3;
tmp = 0;
tmp = (i - lengthvar) * Close[LSMAPeriod-i+shift];
sum+=tmp;
}
wt = sum * 6 / (LSMAPeriod * (LSMAPeriod + 1));
LSMABuffer1[shift] = FromZero;
LSMABuffer2[shift] = FromZero;
if (wt>Close[shift]) LSMABuffer2[shift] = EMPTY_VALUE;
if (wti-GentorLSMA&EMA_v%5B1%5D2.1.0.jpg
发表于:2017-08-11 09:55只看该作者
2楼
阅尽天下指标
韬客社区www.talkfx.co
发表于:2018-04-04 05:52只看该作者
3楼
会重绘吗?
韬客社区www.talkfx.co