[MT4指标]JJN-Bee趋势箭头指标
主图指标
mt4指标类型:趋势指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------+
//| JJN-Bee.mq4 |
//| Copyright ? 2012, JJ Newark |
//| http:/jjnewark.atw.hu |
//| [email protected] |
//+------------------------------------------------------------------+
#property copyright "Copyright ? 2012, JJ Newark"
#property link "http:/jjnewark.atw.hu"
//---- indicator settings
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 YellowGreen
#property indicator_color2 OrangeRed
#property indicator_color3 YellowGreen
#property indicator_color4 OrangeRed
#property indicator_width1 1
#property indicator_width2 1
#property indicator_width3 1
#property indicator_width4 1
//---- indicator parameters
extern string __Copyright__ = "http://jjnewark.atw.hu";
extern int AtrPeriod = 8;
extern bool Show_TP_SL = true;
extern bool Show_Levels = true;
extern color BuyColor = YellowGreen;
extern color SellColor = OrangeRed;
extern color FontColor = Black;
extern int DisplayDecimals = 4;
extern int PosX = 25;
extern int PosY = 25;
extern bool SoundAlert = false;
//---- indicator buffers
double ExtMapBuffer1;
double ExtMapBuffer2;
double ExtMapBuffer3;
double ExtMapBuffer4;
double Atr;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- drawing settings
IndicatorBuffers(4);
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,233);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,234);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_ARROW);
SetIndexArrow(2,167);//119
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexStyle(3,DRAW_ARROW);
SetIndexArrow(3,167);//119
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexLabel(0,"BUY");
SetIndexLabel(1,"SELL");
SetIndexLabel(2,"TakeProfit");
SetIndexLabel(3,"StopLoss");
//----
IndicatorShortName("JJN-Bee");
ObjectCreate("JJNBeeIndName",OBJ_LABEL,0,0,0,0,0);
ObjectSet("JJNBeeIndName",OBJPROP_CORNER,0);
ObjectSet("JJNBeeIndName",OBJPROP_XDISTANCE,PosX+20);
ObjectSet("JJNBeeIndName",OBJPROP_YDISTANCE,PosY);
ObjectSetText("JJNBeeIndName","JJN-Bee",8,"Lucida Sans Unicode",FontColor);
ObjectCreate("JJNBeeLine0",OBJ_LABEL,0,0,0,0,0);
ObjectSet("JJNBeeLine0",OBJPROP_CORNER,0);
ObjectSet("JJNBeeLine0",OBJPROP_XDISTANCE,PosX+5);
ObjectSet("JJNBeeLine0",OBJPROP_YDISTANCE,PosY+8);
ObjectSetText("JJNBeeLine0","------------------",8,"Tahoma",FontColor);
ObjectCreate("JJNBeeLine1",OBJ_LABEL,0,0,0,0,0);
ObjectSet("JJNBeeLine1",OBJPROP_CORNER,0);
ObjectSet("JJNBeeLine1",OBJPROP_XDISTANCE,PosX+5);
ObjectSet("JJNBeeLine1",OBJPROP_YDISTANCE,PosY+10);
ObjectSetText("JJNBeeLine1","------------------",8,"Tahoma",FontColor);
ObjectCreate("JJNBeeDirection",OBJ_LABEL,0,0,0,0,0);
ObjectSet("JJNBeeDirection",OBJPROP_CORNER,0);
ObjectSet("JJNBeeDirection",OBJPROP_XDISTANCE,PosX);
ObjectSet("JJNBeeDirection",OBJPROP_YDISTANCE,PosY+12);
ObjectSetText("JJNBeeDirection","Wait",20,"Lucida Sans Unicode",FontColor);
ObjectCreate("JJNBeeLevel",OBJ_LABEL,0,0,0,0,0);
ObjectSet("JJNBeeLevel",OBJPROP_CORNER,0);
ObjectSet("JJNBeeLevel",OBJPROP_XDISTANCE,PosX);
ObjectSet("JJNBeeLevel",OBJPROP_YDISTANCE,PosY+50);
ObjectSetText("JJNBeeLevel","",9,"Lucida Sans Unicode",FontColor);
//---- initialization done
return(0);
}
int deinit()
{
//----
ObjectDelete("JJNBeeLine0");
ObjectDelete("JJNBeeLine1");
ObjectDelete("JJNBeeIndName");
ObjectDelete("JJNBeeDirection");
ObjectDelete("JJNBeeLevel");
ObjectDelete("JJNBeeEntryLevel");
ObjectDelete("JJNBeeTPLevel");
ObjectDelete("JJNBeeSLLevel");
//----
return(0);
}
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//----
for(int i=0; iOpen[i+1] && Close[i+1]Open[i+1])
{
ExtMapBuffer1=EMPTY_VALUE;
ExtMapBuffer2=High;
if(Show_TP_SL) ExtMapBuffer3=Open[i+1]-Atr;
if(Show_TP_SL) ExtMapBuffer4=Open[i+1]+Atr;
}
else
{
ExtMapBuffer1=EMPTY_VALUE;
ExtMapBuffer2=EMPTY_VALUE;
ExtMapBuffer3=EMPTY_VALUE;
ExtMapBuffer4=EMPTY_VALUE;
}
}
if(Close[0]>Open[1] && Close[1]Open[1]) // SELL
{
ObjectSet("JJNBeeDirection",OBJPROP_XDISTANCE,PosX+2);
ObjectSetText("JJNBeeDirection","SELL",28,"Lucida Sans Unicode",SellColor);
ObjectSetText("JJNBeeLevel","under "+DoubleToStr(Open[1],DisplayDecimals),9,"Lucida Sans Unicode",SellColor);
if(Show_Levels)
{
ObjectCreate("JJNBeeEntryLevel",OBJ_TREND,0,Time[1],Open[1],Time[0],Open[1]);
ObjectSet("JJNBeeEntryLevel",OBJPROP_RAY,True);
ObjectSet("JJNBeeEntryLevel",OBJPROP_BACK,True); // obj in the background
ObjectSet("JJNBeeEntryLevel",OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("JJNBeeEntryLevel",OBJPROP_WIDTH,1);
ObjectSet("JJNBeeEntryLevel",OBJPROP_COLOR,FontColor);
ObjectCreate("JJNBeeTPLevel",OBJ_TREND,0,Time[1],Open[1]-Atr,Time[0],Open[1]-Atr);
ObjectSet("JJNBeeTPLevel",OBJPROP_RAY,True);
ObjectSet("JJNBeeTPLevel",OBJPROP_BACK,True); // obj in the background
ObjectSet("JJNBeeTPLevel",OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("JJNBeeTPLevel",OBJPROP_WIDTH,1);
ObjectSet("JJNBeeTPLevel",OBJPROP_COLOR,BuyColor);
ObjectCreate("JJNBeeSLLevel",OBJ_TREND,0,Time[1],Open[1]+Atr,Time[0],Open[1]+Atr);
ObjectSet("JJNBeeSLLevel",OBJPROP_RAY,True);
ObjectSet("JJNBeeSLLevel",OBJPROP_BACK,True); // obj in the background
ObjectSet("JJNBeeSLLevel",OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("JJNBeeSLLevel",OBJPROP_WIDTH,1);
ObjectSet("JJNBeeSLLevel",OBJPROP_COLOR,SellColor);
}
if(SoundAlert) PlaySound("alert.wav");
}
else
{
ObjectSet("JJNBeeDirection",OBJPROP_XDISTANCE,PosX+8);
ObjectSetText("JJNBeeDirection","WAIT",20,"Lucida Sans Unicode",FontColor);
ObjectSetText("JJNBeeLevel","",9,"Lucida Sans Unicode",FontColor);
ObjectDelete("JJNBeeEntryLevel");
ObjectDelete("JJNBeeTPLevel");
ObjectDelete("JJNBeeSLLevel");
}
//Comment("");
//---- done
return(0);
}
//+------------------------------------------------------------------+
JJN-Bee.jpg

发表于:2017-08-11 09:30只看该作者
2楼
阅尽天下指标
发表于:2018-06-01 04:31只看该作者
5楼
4小时再次上演前日的连续的区间来回,昨日第三次冲击1306承压回落,有句话叫,一鼓作气再而衰三而竭,多次上攻不突破,再攻破更难了。今日亚欧盘看1298-1295下方破位情况,破位则会走弱。不破继续区间内震荡。
韬客社区www.talkfx.co