白开水 发表于 2015-6-12 22:57:53

求大神帮忙看下这个指标显示不了什么问题?谢谢

#property indicator_chart_window
#define PREFIX "T3S"

#property indicator_buffers 2               
#property indicator_color1 Lime
#property indicator_color2 White

extern int    Snake_HalfCycle = 14;
extern int    T3Period      = 21;
extern int    T3Price         = PRICE_CLOSE;
extern double b               = 0.518;
extern string TimeFrame       = "current time frame";
extern bool   Indi_Lines      = true;
extern bool   Real            = true;
extern int    Arr_otstup      = 0;
extern int    Arr_width       = 2;
extern bool   AlertsMessage      = true;
extern bool   AlertsSound      = false;
extern bool   AlertsEmail      = false;
extern bool   AlertsNotification = false;
extern int    SignalBar          = 0;

int sig_alert=0;

double Sn[],T3[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
    SetIndexBuffer(0,Sn);
    SetIndexLabel (0,"Sn");
   
    SetIndexBuffer(1,T3);
    SetIndexLabel (1,"T3");
if(Indi_Lines){   
    SetIndexStyle (0,DRAW_LINE);
    SetIndexStyle (1,DRAW_LINE);   
   }else{
    SetIndexStyle (0,DRAW_NONE);
    SetIndexStyle (1,DRAW_NONE);}   
   
    IndicatorShortName("T-S");
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                     |
//+------------------------------------------------------------------+
int deinit()
{
   for(int i = ObjectsTotal()-1; i >= 0; i--)   
   if (StringSubstr(ObjectName(i), 0,
       StringLen(PREFIX)) == PREFIX)
       ObjectDelete(ObjectName(i));
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
   int i;
   int counted_bars=IndicatorCounted();
   int limit=Bars-counted_bars;
   
   if(Real)int snk=0; else snk=Snake_HalfCycle;

   for(i=0; i<limit+snk; i++)
   {
    Sn = iCustom(Symbol(),0,"Snake",Snake_HalfCycle,0,i);
    T3 = iCustom(Symbol(),0,"T3_clean",T3Period,T3Price,b,TimeFrame,0,i);
   }
//+------------------------------------------------------------------+
for(i=0; i<limit+snk; i++)
{   
if(Sn<T3 && Sn>T3)
    arrows_wind(i,"T3+Snake_Up",Arr_otstup ,233,Lime,Arr_width,false);
    else ObjectDelete(PREFIX+"T3+Snake_Up"+TimeToStr(Time,TIME_DATE|TIME_SECONDS));

if(Sn>T3 && Sn<T3)
    arrows_wind(i,"T3+Snake_Dn",Arr_otstup ,234,Red,Arr_width,true);
    else ObjectDelete(PREFIX + "T3+Snake_Dn" + TimeToStr(Time,TIME_DATE|TIME_SECONDS));
//-----------------------------------------------------------------------+
if(AlertsMessage || AlertsEmail || AlertsNotification || AlertsSound)
{
   string message1 = ("T3+Snake - "+Symbol()+" TF("+Period()+") - Signal for BUY");
   string message2 = ("T3+Snake - "+Symbol()+" TF("+Period()+") - Signal for SELL");
      
    if(sig_alert!=1 && Sn<T3 && Sn>T3)
   {
      if (AlertsMessage) Alert(message1);
      if (AlertsEmail)   SendMail(Symbol()+" T3+Snake ",message1);
      if (AlertsNotification) SendNotification(message1);
      if (AlertsSound)   PlaySound("alert2.wav");
      sig_alert=1;
   }
    if(sig_alert!=2 && Sn>T3 && Sn<T3)
   {
      if (AlertsMessage) Alert(message2);
      if (AlertsEmail)   SendMail(Symbol()+" T3+Snake ",message2);
      if (AlertsNotification) SendNotification(message2);
      if (AlertsSound)   PlaySound("alert2.wav");
      sig_alert=2;
    }
   }
}
//+------------------------------------------------------------------+
      return(0);
}
//====================================================================
void arrows_wind(int k, string N,int ots,int Code,color clr, int ArrowSize,bool up)               
{         
   string objName = PREFIX+N+TimeToStr(Time,TIME_DATE|TIME_SECONDS);
   double gap= (3.0*iATR(NULL,0,20,k)/4.0)+ots*Point;
   
   ObjectCreate(objName, OBJ_ARROW,0,Time,0);
   ObjectSet   (objName, OBJPROP_COLOR, clr);
   ObjectSet   (objName, OBJPROP_ARROWCODE,Code);
   ObjectSet   (objName, OBJPROP_WIDTH,ArrowSize);
if (up)
      ObjectSet(objName,OBJPROP_PRICE1,High+gap);
   else
      ObjectSet(objName,OBJPROP_PRICE1,Low-gap);
}
//====================================================================   

白开水 发表于 2015-6-13 16:52:08

1

白开水 发表于 2015-6-13 16:52:14

2

白开水 发表于 2015-6-13 22:41:07

3

g3dfxpro 发表于 2015-6-13 23:12:54

snk沒有宣告

play9f 发表于 2015-8-29 21:14:02

顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶

姐就是这么靓 发表于 2020-7-9 12:25:19

学习了,不错

此生有你足够 发表于 2020-7-15 13:58:09

学习了,不错

fxsin2546260613 发表于 2020-7-22 19:47:57

帮你顶下哈!!

ofhht 发表于 2020-7-28 10:00:35

帮你顶下哈!!
页: [1] 2
查看完整版本: 求大神帮忙看下这个指标显示不了什么问题?谢谢