Нужен советник на основе индикатора

MQL4 전문가 다른

작업 종료됨

실행 시간 20 시간
고객의 피드백
Быстро и качественно.
피고용인의 피드백
Отличный заказчик!

명시

property indicator_chart_window

#property indicator_buffers 3

#property indicator_color1 Yellow

#property indicator_color2 Green

#property indicator_color3 Red

#property indicator_width1 2

#property indicator_width2 2

#property indicator_width3 2


//---- input parameters

extern int period=16;

extern int method=3; // MODE_SMA

extern int price=0; // PRICE_CLOSE

extern int sdvig=0;


extern bool bPlaySound=true; // Включение звука при смене цвета

extern bool bAllert=true; // Включение звука при смене цвета

extern string SoundName="alert.wav"; // Звуковой файл

extern int CheckBar=1;

//---- buffers


double Uptrend[];

double Dntrend[];

double ExtMapBuffer[];


double vect[];


static bool bs=false,ba=false;

static int bTime=0;

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

//| Custom indicator initialization function |

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

int init()

{

IndicatorBuffers(4);

SetIndexBuffer(0,ExtMapBuffer);

SetIndexBuffer(1,Uptrend);

SetIndexBuffer(2,Dntrend);

SetIndexBuffer(3,vect);


SetIndexStyle(0,DRAW_LINE);

SetIndexStyle(1,DRAW_LINE);

SetIndexStyle(2,DRAW_LINE);


SetIndexDrawBegin(0,1*period);

SetIndexDrawBegin(1,2*period);

SetIndexDrawBegin(2,3*period);


IndicatorShortName("Signal Line("+period+")");

SetIndexLabel(1,"UP");

SetIndexLabel(2,"DN");


bs=false;

ba=false;

bTime=0;


return(0);

}


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

//| Custor indicator deinitialization function |

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

int deinit() { return(0); }


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

//| ?????????? ??????? |

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

double WMA(int x,int p) { return(iMA(NULL,0,p,0,method,price,x+sdvig)); }

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

//| Custom indicator iteration function |

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

int start()

{

int p=MathSqrt(period);


int i,limit0,limit1,limit2;

int counted_bars = IndicatorCounted();

if(counted_bars < 0) return(-1);

if(counted_bars > 0) counted_bars--;

limit2 = Bars - counted_bars;

if(counted_bars==0) limit2--;

limit1=limit2;

limit0=limit1;


if(counted_bars==0)

{

limit1-=(period);

limit2-=(2*period);

}


for(i = limit0; i >= 0; i--) vect[i] = 2*WMA(i, period/2) - WMA(i, period);

for(i = limit1; i >= 0; i--) ExtMapBuffer[i] = iMAOnArray(vect, 0, p, 0, method, i);

for(i=limit2; i>=0; i--)

{

Uptrend[i] = EMPTY_VALUE; if(ExtMapBuffer[i]> ExtMapBuffer[i+1]) {Uptrend[i+1] = ExtMapBuffer[i+1]; Uptrend[i] = ExtMapBuffer[i]; }

Dntrend[i] = EMPTY_VALUE; if(ExtMapBuffer[i]< ExtMapBuffer[i+1]) {Dntrend[i+1] = ExtMapBuffer[i+1]; Dntrend[i] = ExtMapBuffer[i]; }

}

if(bTime!=Time[0])

{

bTime=Time[0];

bs=false;

ba=false;

}

if((ExtMapBuffer[CheckBar+2]-ExtMapBuffer[CheckBar+1])*(ExtMapBuffer[CheckBar+1]-ExtMapBuffer[CheckBar])<0)

{

if(bPlaySound && !bs) PlaySound(SoundName);

bs=true;

if(bAllert && !ba)

{

string mes="";

if(ExtMapBuffer[CheckBar]-ExtMapBuffer[CheckBar+1]>0) mes="Смена тренда, восходящий";

if(ExtMapBuffer[CheckBar]-ExtMapBuffer[CheckBar+1]<0) mes="Смена тренда, нисходящий";

if(mes!="") Alert(mes+": "+Symbol()+"; "+Period_toStr()+"; "+DoubleToStr(Bid,Digits));

}

ba=true;

}

return(0);

}

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



응답함

1
개발자 1
등급
(106)
프로젝트
189
46%
중재
34
24% / 41%
기한 초과
58
31%
무료
2
개발자 2
등급
(241)
프로젝트
387
51%
중재
14
14% / 14%
기한 초과
43
11%
무료
3
개발자 3
등급
(551)
프로젝트
1334
59%
중재
28
82% / 0%
기한 초과
10
1%
무료
4
개발자 4
등급
(280)
프로젝트
650
28%
중재
111
19% / 61%
기한 초과
319
49%
무료
5
개발자 5
등급
(1100)
프로젝트
1456
46%
중재
49
73% / 12%
기한 초과
36
2%
무료
6
개발자 6
등급
(351)
프로젝트
679
56%
중재
33
15% / 39%
기한 초과
63
9%
무료
7
개발자 7
등급
(254)
프로젝트
573
36%
중재
64
20% / 58%
기한 초과
147
26%
무료
8
개발자 8
등급
(10)
프로젝트
17
24%
중재
7
14% / 86%
기한 초과
2
12%
무료
9
개발자 9
등급
(560)
프로젝트
771
46%
중재
23
39% / 13%
기한 초과
63
8%
작업중
10
개발자 10
등급
(30)
프로젝트
45
16%
중재
2
0% / 100%
기한 초과
4
9%
무료
11
개발자 11
등급
(4)
프로젝트
12
0%
중재
0
기한 초과
3
25%
무료
12
개발자 12
등급
(229)
프로젝트
339
49%
중재
21
5% / 33%
기한 초과
24
7%
무료
13
개발자 13
등급
(14)
프로젝트
22
59%
중재
2
0% / 50%
기한 초과
2
9%
무료
14
개발자 14
등급
(356)
프로젝트
632
26%
중재
89
73% / 13%
기한 초과
12
2%
무료
15
개발자 15
등급
(142)
프로젝트
280
42%
중재
18
61% / 6%
기한 초과
29
10%
무료
16
개발자 16
등급
(586)
프로젝트
1048
49%
중재
39
28% / 41%
기한 초과
49
5%
무료
17
개발자 17
등급
(66)
프로젝트
143
34%
중재
10
10% / 60%
기한 초과
26
18%
무료
18
개발자 18
등급
프로젝트
0
0%
중재
0
기한 초과
0
무료
19
개발자 19
등급
(1097)
프로젝트
1778
61%
중재
14
64% / 7%
기한 초과
84
5%
무료
20
개발자 20
등급
(45)
프로젝트
59
42%
중재
5
0% / 60%
기한 초과
12
20%
무료

프로젝트 정보

예산
30 - 40 USD
개발자에게
27 - 36 USD
기한
에서 3  7 일