[C++] 纯文本查看 复制代码//+------------------------------------------------------------------+
//| sideway or trend.mq4 |
//| reza rahmad |
//| reiz_gamer@yahoo.co.id |
//+------------------------------------------------------------------+
#property copyright "reza rahmad"
#property link "reiz_gamer@yahoo.co.id"
#property indicator_chart_window
extern int period_adx = 14;
extern int 位置=1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
ObjectCreate("side",OBJ_LABEL,0,0,0,0,0);
ObjectSet("side",OBJPROP_XDISTANCE,40);
ObjectSet("side",OBJPROP_YDISTANCE,40);
ObjectCreate("side1",OBJ_LABEL,0,0,0,0,0);
ObjectSet("side1",OBJPROP_XDISTANCE,80);
ObjectSet("side1",OBJPROP_YDISTANCE,60);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
ObjectDelete("side");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//----
if(iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MAIN,0)>iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_PLUSDI,0) && iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MAIN,0)>iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MINUSDI,0)&& iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_PLUSDI,0) >iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MINUSDI,0))
{
ObjectSet("side",OBJPROP_CORNER,位置);
ObjectSet("side1",OBJPROP_CORNER,位置);
ObjectSetText("side","SIDEWAY BUY 震荡 看多",15,"TAHOMA",Magenta);
ObjectSetText("side1",CharToStr(75),30,"Wingdings",Magenta);
}
if(iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MAIN,0)>iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_PLUSDI,0) && iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MAIN,0)>iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MINUSDI,0)&& iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_PLUSDI,0) iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MINUSDI,0 && iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MAIN,0) < 20) )
{
ObjectSet("side",OBJPROP_CORNER,位置);
ObjectSet("side1",OBJPROP_CORNER,位置);
ObjectSetText("side","SIDEWAY BUY 震荡 看多",15,"TAHOMA",Magenta);
ObjectSetText("side1",CharToStr(75),30,"Wingdings",Magenta);
}
if(iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_PLUSDI,0) < iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MINUSDI,0 && iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MAIN,0) < 20) )
{ ObjectSet("side",OBJPROP_CORNER,位置);
ObjectSet("side1",OBJPROP_CORNER,位置);
ObjectSetText("side","SIDEWAY SELL 震荡 看空",15,"TAHOMA",Magenta);
ObjectSetText("side1",CharToStr(75),30,"Wingdings",Magenta);
}
if(iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MAIN,0)iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MINUSDI,0))
{
ObjectSet("side",OBJPROP_CORNER,位置);
ObjectSet("side1",OBJPROP_CORNER,位置);
ObjectSetText("side","TREND BUY 趋势 看多",15,"TAHOMA",Green);
ObjectSetText("side1",CharToStr(221),30,"Wingdings",Green);
}
if(iADX(NULL,0,period_adx,PRICE_CLOSE,MODE_MAIN,0) |