- //+------------------------------------------------------------------+
- //| Japan.mq4 |
- //| Yuriy Tokman |
- //| yuriytokman@gmail.com |
- //+------------------------------------------------------------------+
- #property copyright "Yuriy Tokman"
- #property link "yuriytokman@gmail.com"
- #property indicator_chart_window
- //---- input parameters
- extern int barsToProcess=1000;
- //+------------------------------------------------------------------+
- //| Custom indicator initialization function |
- //+------------------------------------------------------------------+
- int init()
- {
- //---- indicators
- //----
- return(0);
- }
- //+------------------------------------------------------------------+
- //| Custom indicator deinitialization function |
- //+------------------------------------------------------------------+
- int deinit()
- {
- //----
- int i;
-
-
-
- for (i=0;i<Bars;i++)
- {
- ObjectDelete("项忮眄 桦?祛腩?"+DoubleToStr(i,0));
- ObjectDelete("猁鼽?镱汶铢屙桢 "+DoubleToStr(i,0));
- ObjectDelete("戾溻彐 镱汶铢屙桢 "+DoubleToStr(i,0));
- ObjectDelete("玎忮襦 桤 蝈祉 钺豚觐?"+DoubleToStr(i,0));
- ObjectDelete("镳铖忮??钺豚赅?"+DoubleToStr(i,0));
- ObjectDelete("漕滏 "+DoubleToStr(i,0));
- }
- //----
- return(0);
- }
- //+------------------------------------------------------------------+
- //| Custom indicator iteration function |
- //+------------------------------------------------------------------+
- int start()
- {
- int counted_bars=IndicatorCounted(),
- //----
- limit,
- i=0;
- if(counted_bars>0)
- counted_bars--;
-
- limit=Bars-counted_bars;
-
- if(limit>barsToProcess)
- limit=barsToProcess;
- while (i<limit)
- {
- //项忮眄 桦?祛腩?
- double k = (High[i]-Low[i])/3;
- if ((Open[i]>(Low[i]+2*k))&&(Close[i]>(Low[i]+2*k)))
- {
- ObjectCreate("项忮眄 桦?祛腩?"+DoubleToStr(i,0),OBJ_ARROW,0,Time[i],High[i]+10*Point);
- ObjectSet("项忮眄 桦?祛腩?"+DoubleToStr(i,0),OBJPROP_ARROWCODE,108);
- ObjectSet("项忮眄 桦?祛腩?"+DoubleToStr(i,0),OBJPROP_COLOR,DimGray);
- }
- //猁鼽?镱汶铢屙桢
- if((Open[i+1]>Close[i+1])&&(Close[i+1]>Open[i])&&(Close[i]>Open[i+1]))
- {
- ObjectCreate("猁鼽?镱汶铢屙桢 "+DoubleToStr(i,0),OBJ_ARROW,0,Time[i],Low[i]-15*Point);
- ObjectSet("猁鼽?镱汶铢屙桢 "+DoubleToStr(i,0),OBJPROP_ARROWCODE,110);
- }
- //戾溻彐 镱汶铢屙桢
- if((Close[i+1]>Open[i+1])&&(Open[i]>Close[i+1])&&(Open[i+1]>Close[i]))
- {
- ObjectCreate("戾溻彐 镱汶铢屙桢 "+DoubleToStr(i,0),OBJ_ARROW,0,Time[i],High[i]+15*Point);
- ObjectSet("戾溻彐 镱汶铢屙桢 "+DoubleToStr(i,0),OBJPROP_ARROWCODE,110);
- ObjectSet("戾溻彐 镱汶铢屙桢 "+DoubleToStr(i,0),OBJPROP_COLOR,Lime);
- }
- //玎忮襦 桤 蝈祉 钺豚觐?
- if((Open[i+1]<Close[i+1])&&(Open[i]>High[i+1])&&(Close[i]<(Open[i+1]+(Close[i+1]-Open[i+1])/2)))
- {
- ObjectCreate("玎忮襦 桤 蝈祉 钺豚觐?"+DoubleToStr(i,0),OBJ_ARROW,0,Time[i],High[i]+25*Point);
- ObjectSet("玎忮襦 桤 蝈祉 钺豚觐?"+DoubleToStr(i,0),OBJPROP_ARROWCODE,116);
- ObjectSet("玎忮襦 桤 蝈祉 钺豚觐?"+DoubleToStr(i,0),OBJPROP_COLOR,Lime);
- }
- //镳铖忮??钺豚赅?
- if((Open[i+1]>Close[i+1])&&(Low[i+1]>Open[i])&&(Close[i]>(Close[i+1]+(Open[i+1]-Close[i+1])/2)))
- {
- ObjectCreate("镳铖忮??钺豚赅?"+DoubleToStr(i,0),OBJ_ARROW,0,Time[i],Low[i]-25*Point);
- ObjectSet("镳铖忮??钺豚赅?"+DoubleToStr(i,0),OBJPROP_ARROWCODE,116);
- }
- //漕滏
- if(Open[i]==Close[i])
- {
- ObjectCreate("漕滏 "+DoubleToStr(i,0),OBJ_ARROW,0,Time[i],High[i]+30*Point);
- ObjectSet("漕滏 "+DoubleToStr(i,0),OBJPROP_ARROWCODE,174);
- ObjectSet("漕滏 "+DoubleToStr(i,0),OBJPROP_COLOR,Indigo);
- }
- i++;
- }
- //----
- return(0);
- }
复制代码
japan-indicator.mq4
|