Price Data Components
Indicators Used
0
Views
0
Downloads
0
Favorites
info_Table_v0Satop_en
//////////////////////////////////////////////////////////////////////
//
// signalTable.mq4
//
//////////////////////////////////////////////////////////////////////
#property copyright ""
#property link ""
#property indicator_chart_window
extern string ____1____ = "MA settings";
extern int period_MA1 = 5;
extern int ma_method_MA1 = 0;
extern int applied_price_MA1 = 0;
extern int period_MA2 = 12;
extern int ma_method_MA2 = 0;
extern int applied_price_MA2 = 0;
extern string ____2____ = "RSI settings";
extern int period_rsi =21;
extern int applied_price_rsi =0;
extern string ____3____ = "CCI settings";
extern int period_CCI =14;
extern int applied_price_CCI =0;
extern string ____4____ = "Arrow codes";
extern int symbolCodeBuy=221,
symbolCodeSell=222,
symbolCodeNoSignal=175;
extern string ____5____ = "color settings";
extern color noSignalColor=MediumPurple,
BayColor = Lime,
SellColor = Red,
textColor=Gold;
extern string ___6___ = "position on the chart";
extern int scaleX=20,
scaleY=20,
offsetX=35,
offsetY=20,
fontSize=20,
corner=1;
int period[]={1,5,15,30,60,240,1440,10080,43200};
string periodString[]={"M1","M5","M15","M30","H1","H4","D1","W1","MN"},
// ñîçäàåì åùå îäèí ìàññèâ ñ íàçâàíèÿìè èíäèêàòîðîâ
signalNameString[]={"2MA","RSI","CCI","Bar","Gap"};
//////////////////////////////////////////////////////////////////////
//
// init()
//
//////////////////////////////////////////////////////////////////////
int init()
{
// òàáëèöà ñèãíàëîâ
for(int x=0;x<9;x++)
for(int y=0;y<5;y++)
{
ObjectCreate("signal"+x+y,OBJ_LABEL,0,0,0,0,0);
// èçìåíÿåì óãîë ïðèâÿçêè
ObjectSet("signal"+x+y,OBJPROP_CORNER,corner);
ObjectSet("signal"+x+y,OBJPROP_XDISTANCE,x*scaleX+offsetX);
ObjectSet("signal"+x+y,OBJPROP_YDISTANCE,y*scaleY+20);
ObjectSetText("signal"+x+y,CharToStr(symbolCodeNoSignal),
fontSize,"Wingdings",noSignalColor);
}
// íàçâàíèÿ òàéìôðåéìîâ
for(x=0;x<9;x++)
{
ObjectCreate("textPeriod"+x,OBJ_LABEL,0,0,0,0,0);
// èçìåíÿåì óãîë ïðèâÿçêè
ObjectSet("textPeriod"+x,OBJPROP_CORNER,corner);
ObjectSet("textPeriod"+x,OBJPROP_XDISTANCE,x*scaleX+offsetX);
ObjectSet("textPeriod"+x,OBJPROP_YDISTANCE,offsetY-10);
ObjectSetText("textPeriod"+x,periodString[x],8,"Tahoma",textColor);
}
// íàçâàíèÿ èíäèêàòîðîâ
for(y=0;y<5;y++)
{
ObjectCreate("textSignal"+y,OBJ_LABEL,0,0,0,0,0);
// èçìåíÿåì óãîë ïðèâÿçêè
ObjectSet("textSignal"+y,OBJPROP_CORNER,corner);
ObjectSet("textSignal"+y,OBJPROP_XDISTANCE,offsetX-25);
ObjectSet("textSignal"+y,OBJPROP_YDISTANCE,y*(scaleY)+offsetY+8);
ObjectSetText("textSignal"+y,signalNameString[y],8,"Tahoma",textColor);
}
return(0);
}
//
// deinit()
//
//////////////////////////////////////////////////////////////////////
int deinit()
{
// ïðè óäàëåíèè íàøåãî èíäèêàòîðà íóæíî óäàëèòü âñå îáúåêòû,
// êîòîðûå ìû óæå ñîçäàëè
for(int x=0;x<9;x++)
for(int y=0;y<9;y++)
{
// ObjectsDeleteAll();
ObjectDelete("signal"+x+y);
ObjectDelete("textPeriod"+x);
ObjectDelete("textSignal"+y);
ObjectDelete("signal"+x+"0");
ObjectDelete("signal"+x+"1");
ObjectDelete("signal"+x+"2");
ObjectDelete("signal"+x+"3");
ObjectDelete("signal"+x+"4");
}
return(0);
}
///
int start()
{
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--MA--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
for(int x=0;x<9;x++)
{
double MA1 = iMA(Symbol(),period[x],period_MA1,0,ma_method_MA1,applied_price_MA1,0);
double MA2 = iMA(Symbol(),period[x],period_MA2,0,ma_method_MA2,applied_price_MA2,0);
if(MA1>MA2)
ObjectSetText("signal"+x+"0",CharToStr(symbolCodeBuy),fontSize,"Wingdings",BayColor);
// ñèãíàë íà ïðîäàæó
else if(MA1<MA2)
ObjectSetText("signal"+x+"0",CharToStr(symbolCodeSell),fontSize,"Wingdings",SellColor);
}
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--RSI--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
for(x=0;x<9;x++)
{
double rsi = iRSI(Symbol(),period[x],period_rsi,applied_price_rsi,0);
double rsi_1 = iRSI(Symbol(),period[x],period_rsi,applied_price_rsi,1);
double del = rsi-rsi_1;
// ñèãíàë
if(rsi>50&&del>0)
ObjectSetText("signal"+x+"1",CharToStr(symbolCodeBuy),fontSize,"Wingdings",BayColor);
if(rsi>50&&del<0)
ObjectSetText("signal"+x+"1",CharToStr(symbolCodeSell),fontSize,"Wingdings",BayColor);
// ñèãíàë íà ïðîäàæó
else if(rsi<50&&del<0)
ObjectSetText("signal"+x+"1",CharToStr(symbolCodeSell),fontSize,"Wingdings",SellColor);
else if(rsi<50&&del>0)
ObjectSetText("signal"+x+"1",CharToStr(symbolCodeBuy),fontSize,"Wingdings",SellColor);
}
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--CCI--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
for(x=0;x<9;x++)
{
double CCI =iCCI(Symbol(),period[x],period_CCI,applied_price_CCI,0);
double CCI_1 =iCCI(Symbol(),period[x],period_CCI,applied_price_CCI,1);
double der =CCI-CCI_1;
if(CCI>100&&der>0)
ObjectSetText("signal"+x+"2",CharToStr(symbolCodeBuy),fontSize,"Wingdings",BayColor);
if(CCI>100&&der<0)
ObjectSetText("signal"+x+"2",CharToStr(symbolCodeSell),fontSize,"Wingdings",BayColor);
if(CCI<100&&CCI>-100&&der>0)
ObjectSetText("signal"+x+"2",CharToStr(symbolCodeBuy),fontSize,"Wingdings",noSignalColor);
if(CCI<100&&CCI>-100&&der<0)
ObjectSetText("signal"+x+"2",CharToStr(symbolCodeSell),fontSize,"Wingdings",noSignalColor);
// ñèãíàë íà ïðîäàæó
else if(CCI<-100&&der<0)
ObjectSetText("signal"+x+"2",CharToStr(symbolCodeSell),fontSize,"Wingdings",SellColor);
else if(CCI<-100&&der>0)
ObjectSetText("signal"+x+"2",CharToStr(symbolCodeBuy),fontSize,"Wingdings",SellColor);
}
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--Bar--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
for(x=0;x<9;x++)
{
double x00 =iOpen(Symbol(),period[x],0)-iClose(Symbol(),period[x],0);
// ñèãíàë
if(x00<0)
ObjectSetText("signal"+x+"3",CharToStr(symbolCodeBuy),fontSize,"Wingdings",BayColor);
// ñèãíàë íà ïðîäàæó
else if(x00>0)
ObjectSetText("signal"+x+"3",CharToStr(symbolCodeSell),fontSize,"Wingdings",SellColor);
}
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--Gep--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
for(x=0;x<9;x++)
{
double x0 =iOpen(Symbol(),period[x],0)-iClose(Symbol(),period[x],1);
// ñèãíàë íà ïîêóïêó
if(x0>0)
ObjectSetText("signal"+x+"4",CharToStr(symbolCodeBuy),fontSize,"Wingdings",BayColor);
if(x0<0)
ObjectSetText("signal"+x+"4",CharToStr(symbolCodeSell),fontSize,"Wingdings",SellColor);
if(x0==0)
ObjectSetText("signal"+x+"4",CharToStr(symbolCodeNoSignal),fontSize,"Wingdings",noSignalColor);
}
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
return(0);
}
//////////////////////////////////////////////////////////////////////
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---