
Вы упускаете торговые возможности:
- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Регистрация
Вход
Вы принимаете политику сайта и условия использования
Если у вас нет учетной записи, зарегистрируйтесь
Здравствуйте! Попробовал написать индикатор(Три экрана Элдера) Вроде работает, но не могу вписать стрелки для истории индикатора! Нужно проставить одновременно с срабатыванием алерта! Прошу помочь! Ссылка файла : https://cloud.mail.ru/public/8vTp/vhyab3bso // СПАСИБО !!!
Шо тупите?
Vinin
Зачем сообщение удаляешь?
:))))))))))))
https://www.mql5.com/ru/code/14173
Всем привет, уважаемые трейдеры программисты, помогите сделать стрелочный индикатор, как то начал по своему по чужим кодам, вот сигнал выдает а вот стрелку не могу сделать, пока еще не догнал!
//+------------------------------------------------------------------+
//| xpPivotAlerts.mq4 |
//| Developed by Coders Guru |
//| http://www.xpworx.com |
//+------------------------------------------------------------------+
#property link "http://www.xpworx.com"
//Stamp_Version = "Last Modified: 2010.10.15 19:30";
#property indicator_chart_window
#property indicator_buffers 7
double R = 0;
double p = 0;
double r4 = 0;
double r3 = 0;
double r2 = 0;
double r1 = 0;
double s1 = 0;
double s2 = 0;
double s3 = 0;
double s4 = 0;
extern bool AlertsOn = true;
extern bool PivotLineCrossAlert = true;
extern bool R1LineCrossAlert = true;
extern bool R2LineCrossAlert = true;
extern bool R3LineCrossAlert = true;
extern bool R4LineCrossAlert = true;
extern bool S1LineCrossAlert = true;
extern bool S2LineCrossAlert = true;
extern bool S3LineCrossAlert = true;
extern bool S4LineCrossAlert = true;
extern color PivotColor = Blue;
extern color R1Color = Lime;
extern color R2Color = DeepPink;
extern color R3Color = OrangeRed;
extern color R4Color = Magenta;
extern color S1Color = Lime;
extern color S2Color = DeepPink;
extern color S3Color = OrangeRed;
extern color S4Color = Magenta;
extern int PivotWidth = 1;
extern int R1Width = 1;
extern int R2Width = 1;
extern int R3Width = 1;
extern int R4Width = 1;
extern int S1Width = 1;
extern int S2Width = 1;
extern int S3Width = 1;
extern int S4Width = 1;
double buf0[] , buf1[], buf2[], buf3[], buf4[], buf5[], buf6[], buf7[], buf8[];
int init()
{
SetIndexBuffer(0,buf0);
SetIndexBuffer(1,buf1);
SetIndexBuffer(2,buf2);
SetIndexBuffer(3,buf3);
SetIndexBuffer(4,buf4);
SetIndexBuffer(5,buf5);
SetIndexBuffer(6,buf6);
SetIndexBuffer(7,buf7);
SetIndexBuffer(8,buf8);
SetIndexLabel(0, "Pivot");
SetIndexLabel(1, "Resistance 1");
SetIndexLabel(2, "Resistance 2");
SetIndexLabel(3, "Resistance 3");
SetIndexLabel(4, "Resistance 4");
SetIndexLabel(5, "Support 1");
SetIndexLabel(6, "Support 2");
SetIndexLabel(7, "Support 3");
SetIndexLabel(8, "Support 4");
return(0);
}
int deinit()
{
ObjectsDeleteAll();
return(0);
}
void start()
{
Draw_Pivots();
if (AlertsOn) AlertCrosses();
return(0);
}
void Draw_Pivots()
{
double rates[1][6],yesterday_close,yesterday_high,yesterday_low;
ArrayCopyRates(rates, Symbol(), PERIOD_D1);
if(DayOfWeek() == 1)
{
if(TimeDayOfWeek(iTime(Symbol(),PERIOD_D1,1)) == 5)
{
yesterday_close = rates[1][4];
yesterday_high = rates[1][3];
yesterday_low = rates[1][2];
}
else
{
for(int d = 5;d>=0;d--)
{
if(TimeDayOfWeek(iTime(Symbol(),PERIOD_D1,d)) == 5)
{
yesterday_close = rates[d][4];
yesterday_high = rates[d][3];
yesterday_low = rates[d][2];
}
}
}
}
else
{
yesterday_close = rates[1][4];
yesterday_high = rates[1][3];
yesterday_low = rates[1][2];
}
//---- Calculate Pivots
R = yesterday_high - yesterday_low;//range
p = (yesterday_high + yesterday_low + yesterday_close)/3;// Standard Pivot
r4 = yesterday_high + 2 * (p - yesterday_low);
r3 = p + (R * 1.000);
r2 = p + (R * 0.618);
r1 = p + (R * 0.382);
s1 = p - (R * 0.382);
s2 = p - (R * 0.618);
s3 = p - (R * 1.000);
s4 = yesterday_low - 2 * (yesterday_high - p);
drawLine(r4,"R4", R4Color,0,R4Width);
drawLabel("R 4",r4,R4Color);
drawLine(r3,"R3", R3Color,0,R3Width);
drawLabel("R 3",r3,R3Color);
drawLine(r2,"R2", R2Color,0,R2Width);
drawLabel("R 2",r2,R2Color);
drawLine(r1,"R1", R1Color,0,R1Width);
drawLabel("R 1",r1,R1Color);
drawLine(p,"PIVIOT",PivotColor,1,PivotWidth);
drawLabel("P L",p,PivotColor);
drawLine(s1,"S1",S1Color,0,S1Width);
drawLabel("S 1",s1,S1Color);
drawLine(s2,"S2",S2Color,0,S2Width);
drawLabel("S 2",s2,S2Color);
drawLine(s3,"S3",S3Color,0,S3Width);
drawLabel("S 3",s3,S3Color);
drawLine(s4,"S4",S4Color,0,S4Width);
drawLabel("S 4",s4,S4Color);
WindowRedraw();
for (int i = 0; i < 100; i++)
{
buf0[i] = p;
buf1[i] = r1;
buf2[i] = r2;
buf3[i] = r3;
buf4[i] = r4;
buf5[i] = s1;
buf6[i] = s2;
buf7[i] = s3;
buf8[i] = s4;
}
}
void drawLabel(string name,double lvl,color Color)
{
if(ObjectFind(name) != 0)
{
ObjectCreate(name, OBJ_TEXT, 0, Time[10], lvl);
ObjectSetText(name, name, 8, "Arial", EMPTY);
ObjectSet(name, OBJPROP_COLOR, Color);
}
else
{
ObjectMove(name, 0, Time[10], lvl);
}
}
void drawLine(double lvl,string name, color Col,int type,int width)
{
if(ObjectFind(name) == -1)
{
ObjectCreate(name, OBJ_HLINE, 0, Time[0], lvl,Time[0],lvl);
if(type == 1)
ObjectSet(name, OBJPROP_STYLE, STYLE_SOLID);
else
ObjectSet(name, OBJPROP_STYLE, STYLE_DOT);
ObjectSet(name, OBJPROP_COLOR, Col);
ObjectSet(name,OBJPROP_WIDTH,width);
}
else
{
ObjectDelete(name);
ObjectCreate(name, OBJ_HLINE, 0, Time[0], lvl,Time[0],lvl);
if(type == 1)
ObjectSet(name, OBJPROP_STYLE, STYLE_SOLID);
else
ObjectSet(name, OBJPROP_STYLE, STYLE_DOT);
ObjectSet(name, OBJPROP_COLOR, Col);
ObjectSet(name,OBJPROP_WIDTH,width);
}
WindowRedraw();
}
bool AlertOnce(string alert_msg, int ref)
{
static int LastAlert[10];
if( LastAlert[ref] == 0 || LastAlert[ref] < Bars)
{
Alert(alert_msg);
LastAlert[ref] = Bars;
return (true);
}
return(false);
}
void AlertCrosses()
{
/*
extern bool PivotLineCrossAlert = true;
extern bool R1LineCrossAlert = true;
extern bool R2LineCrossAlert = true;
extern bool R3LineCrossAlert = true;
extern bool S1LineCrossAlert = true;
extern bool S2LineCrossAlert = true;
extern bool S3LineCrossAlert = true;
buf0[i] = p;
buf1[i] = r1;
buf2[i] = r2;
buf3[i] = r3;
buf4[i] = s1;
buf5[i] = s2;
buf6[i] = s3;
*/
if(PivotLineCrossAlert && Low[0] < p && High[0] > p)
AlertOnce("Pivot Tocuh - Price has tocuhed the Pivot line @ "+Symbol()+"-"+PeriodToText(),0);
if(R1LineCrossAlert && Low[0] < r1 && High[0] > r1)
AlertOnce("R1 Tocuh - Price has tocuhed the R1 line @ "+Symbol()+"-"+PeriodToText(),1);
if(R2LineCrossAlert && Low[0] < r2 && High[0] > r2)
AlertOnce("R2 Tocuh - Price has tocuhed the R2 line @ "+Symbol()+"-"+PeriodToText(),2);
if(R3LineCrossAlert && Low[0] < r3 && High[0] > r3)
AlertOnce("R3 Tocuh - Price has tocuhed the R3 line @ "+Symbol()+"-"+PeriodToText(),3);
if(R4LineCrossAlert && Low[0] < r4 && High[0] > r4)
AlertOnce("R4 Tocuh - Price has tocuhed the R4 line @ "+Symbol()+"-"+PeriodToText(),4);
if(S1LineCrossAlert && Low[0] < s1 && High[0] > s1)
AlertOnce("S1 Tocuh - Price has tocuhed the S1 line @ "+Symbol()+"-"+PeriodToText(),5);
if(S2LineCrossAlert && Low[0] < s2 && High[0] > s2)
AlertOnce("S2 Tocuh - Price has tocuhed the S2 line @ "+Symbol()+"-"+PeriodToText(),6);
if(S3LineCrossAlert && Low[0] < s3 && High[0] > s3)
AlertOnce("S3 Tocuh - Price has tocuhed the S3 line @ "+Symbol()+"-"+PeriodToText(),7);
if(S4LineCrossAlert && Low[0] < s4 && High[0] > s4)
AlertOnce("S4 Tocuh - Price has tocuhed the S4 line @ "+Symbol()+"-"+PeriodToText(),8);
}
string PeriodToText()
{
switch (Period())
{
case 1:
return("M1");
break;
case 5:
return("M5");
break;
case 15:
return("M15");
break;
case 30:
return("M30");
break;
case 60:
return("H1");
break;
case 240:
return("H4");
break;
case 1440:
return("D1");
break;
case 10080:
return("W1");
break;
case 43200:
return("MN1");
break;
}
}
Всем привет, уважаемые трейдеры программисты, помогите сделать стрелочный индикатор, как то начал по своему по чужим кодам, вот сигнал выдает а вот стрелку не могу сделать, пока еще не догнал!
как сделать что бы стрелки не перерисовывались ? например стрелка показала вниз, а цена уходит выше , то стрелка пропадает и рисуется на свече которая выше ( вот как сделать что бы все стрелки оставались и не пропадали ? )))
//+------------------------------------------------------------------+