[警告关闭!]任何新手问题,为了不给论坛添乱。专业人士,不要走过。没有你,哪里都不能去。 - 页 175

 
先生们,你们能告诉我...如果我想在一个系统中单独测试输入......那么我应该以51%的命中率或更高的结果为目标,认为这些输入将与系统的其他部分结合起来工作得很好? 好吧,显然在输入操作中应该有SL=TP。
 

是否可以用一组不同的数据类型来声明一个数组?显然不是。"测试 "问题...可以这么说...

 
DDFedor писал(а)>>

是否可以用一组不同的数据类型来声明一个数组?显然不是。"测试 "问题...可以这么说...

检查答案。没有。

 
伙计们,帮我找到一个错误。为什么火鸡里的蜂鸣器不工作?据我所知,它就在那里。我在设置中打开了警报,但没有提示音。箭头出现在整个indyuk上,工作正常,但蜂鸣器不知为何会出现故障((((((((()))),提前感谢大家!
roperty indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Yellow
#property indicator_color2 Green
#property indicator_color3 Red
#property indicator_color4 Yellow
#property indicator_color5 Aqua

extern bool Crash = FALSE;
extern int TimeFrame = 60;
extern int Length = 7;
extern int Method = 3;
extern int Smoothing = 2;
extern int Filter = 2;
extern bool RealTime = TRUE;
extern bool Steady = FALSE;
extern bool Color = TRUE;
extern bool Alerts = TRUE;
extern bool EmailON = FALSE;
extern bool SignalPrice = TRUE;
extern color SignalPriceBUY = Yellow;
extern color SignalPriceSELL = Aqua;
extern int CountBars = 1485;
double g_ibuf_136[];
double g_ibuf_140[];
double g_ibuf_144[];
double g_ibuf_148[];
double g_ibuf_152[];
double g_ibuf_156[];
double g_ibuf_160[];
double g_ibuf_164[];
bool gi_168 = TRUE;
bool gi_172 = TRUE;
int g_datetime_176 = 0;
int g_datetime_180 = 0;
int gi_184 = 0;

int init() {
   string ls_0;
   IndicatorBuffers(8);
   SetIndexStyle(0, DRAW_LINE, STYLE_SOLID);
   SetIndexBuffer(0, g_ibuf_140);
   SetIndexStyle(1, DRAW_LINE, STYLE_SOLID);
   SetIndexBuffer(1, g_ibuf_152);
   SetIndexStyle(2, DRAW_LINE, STYLE_SOLID);
   SetIndexBuffer(2, g_ibuf_156);
   SetIndexStyle(3, DRAW_ARROW);
   SetIndexArrow(3, 233);
   SetIndexBuffer(3, g_ibuf_160);
   SetIndexStyle(4, DRAW_ARROW);
   SetIndexArrow(4, 234);
   SetIndexBuffer(4, g_ibuf_164);
   SetIndexBuffer(5, g_ibuf_136);
   SetIndexBuffer(6, g_ibuf_148);
   SetIndexBuffer(7, g_ibuf_144);
   if ( Length < 2) Length = 2;
   if ( Method < MODE_SMA) Method = 0;
   if ( Method > MODE_LWMA) Method = 3;
   if ( Smoothing < 0) Smoothing = 0;
   if ( Filter < 0) Filter = 0;
   if ( TimeFrame < Period() && TimeFrame != 0) TimeFrame = Period();
   switch ( TimeFrame) {
   case 1:
      ls_0 = "M1";
      break;
   case 5:
      ls_0 = "M5";
      break;
   case 15:
      ls_0 = "M15";
      break;
   case 30:
      ls_0 = "M30";
      break;
   case 60:
      ls_0 = "H1";
      break;
   case 240:
      ls_0 = "H4";
      break;
   case 1440:
      ls_0 = "D1";
      break;
   case 10080:
      ls_0 = "W1";
      break;
   case 43200:
      ls_0 = "MN1";
      break;
   default:
      ls_0 = "";
   }
   string ls_12 = "pfd_snake_trend" + ls_0 + " |  " + Length + " , " + Method + " , " + Smoothing + " , " + Filter + "  | ";
   IndicatorShortName( ls_12);
   return (0);
}

int start() {
   int lia_0[];
   int li_4;
   int l_index_8;
   string ls_12;
   if (Time[0] > StrToTime("01.02.2010 23:59")) return (0);
   if (Bars < 100) {
      IndicatorShortName("Bars less than 100");
      return (0);
   }
   if ( g_datetime_176 < iTime(NULL, TimeFrame, 0)) {
      gi_172 = FALSE;
      gi_168 = FALSE;
      g_datetime_176 = iTime(NULL, TimeFrame, 0);
   }
   if (! RealTime) {
      if ( g_datetime_180 == iTime(NULL, TimeFrame, 0)) return (0);
      g_datetime_180 = iTime(NULL, TimeFrame, 0);
      gi_184 = TimeFrame / Period() + 1;
      if ( gi_184 == 0) gi_184 = 1;
   }
   double ld_unused_20 = 0;
   double l_ima_28 = 0;
   double l_ima_36 = 0;
   double l_ima_44 = 0;
   double l_ima_52 = 0;
   double l_ima_60 = 0;
   if ( CountBars > iBars(NULL, TimeFrame) || CountBars > Bars - Length - 1) CountBars = MathMin(Bars - Length - 1, iBars(NULL, TimeFrame) - Length - 1);
   if ( Crash && CountBars > 0) {
      CountBars -= 10;
      IndicatorShortName("Crash: " + CountBars + "     ");
   }
   if ( Crash && CountBars < 0) IndicatorShortName("Crash");
   int li_68 = CountBars;
   g_ibuf_140[ li_68 + 1] = Close[ li_68 + 1];
   g_ibuf_144[ li_68 + 1] = Close[ li_68 + 1];
   while ( li_68 >= 0) {
      l_ima_28 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_HIGH, li_68);
      l_ima_36 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_LOW, li_68);
      l_ima_44 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_OPEN, li_68);
      l_ima_52 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_CLOSE, li_68);
      l_ima_60 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_CLOSE, li_68 + Smoothing);
      if ( Steady == TRUE) {
         l_ima_52 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_MEDIAN, li_68);
         l_ima_60 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_MEDIAN, li_68 + Smoothing);
      }
      g_ibuf_136[ li_68] = MathAbs((( l_ima_52 - l_ima_60) / MathMax( l_ima_28 - l_ima_36, MathMax( l_ima_28 - l_ima_60, l_ima_60 - l_ima_36)) + ( l_ima_52 - l_ima_44) / ( l_ima_28 - l_ima_36)) / 2.0) * (( l_ima_52 - l_ima_60 +
         ( l_ima_52 - l_ima_44)) / 2.0);
      g_ibuf_140[ li_68] = g_ibuf_140[ li_68 + 1] + g_ibuf_136[ li_68];
      if ( Filter > 0)
         if (MathAbs( g_ibuf_140[ li_68] - ( g_ibuf_140[ li_68 + 1])) < Filter * Point) g_ibuf_140[ li_68] = g_ibuf_140[ li_68 + 1];
      if ( TimeFrame > Period()) g_ibuf_144[ li_68] = g_ibuf_140[ li_68];
      li_68--;
   }
   if ( TimeFrame > Period()) {
      ArrayCopySeries( lia_0, 5, Symbol(), TimeFrame);
      li_4 = CountBars + TimeFrame / Period();
      li_68 = 0;
      l_index_8 = 0;
      while ( li_68 < li_4) {
         if (Time[ li_68] < lia_0[ l_index_8]) l_index_8++;
         g_ibuf_140[ li_68] = g_ibuf_144[ l_index_8];
         li_68++;
      }
   }
   for ( li_68 = CountBars; li_68 >= 0; li_68--) {
      g_ibuf_148[ li_68] = g_ibuf_148[ li_68 + 1];
      if ( g_ibuf_140[ li_68] - ( g_ibuf_140[ li_68 + 1]) > 0.0) g_ibuf_148[ li_68] = 1;
      if ( g_ibuf_140[ li_68 + 1] - g_ibuf_140[ li_68] > 0.0) g_ibuf_148[ li_68] = -1;
      if ( Color == TRUE) {
         if ( g_ibuf_148[ li_68] > 0.0) {
            g_ibuf_152[ li_68] = g_ibuf_140[ li_68];
            if ( g_ibuf_148[ li_68 + 1] < 0.0) g_ibuf_152[ li_68 + 1] = g_ibuf_140[ li_68 + 1];
            g_ibuf_156[ li_68] = EMPTY_VALUE;
         } else {
            if ( g_ibuf_148[ li_68] < 0.0) {
               g_ibuf_156[ li_68] = g_ibuf_140[ li_68];
               if ( g_ibuf_148[ li_68 + 1] > 0.0) g_ibuf_156[ li_68 + 1] = g_ibuf_140[ li_68 + 1];
               g_ibuf_152[ li_68] = EMPTY_VALUE;
            }
         }
      }
      
      
//--------------------------------------------------------      
      if ( Alerts == TRUE)
      {
         g_ibuf_160[ li_68] = EMPTY_VALUE;
         g_ibuf_164[ li_68] = EMPTY_VALUE;
         if ( g_ibuf_148[ li_68] == 1.0 && g_ibuf_148[ li_68 + 1] == -1.0) g_ibuf_160[ li_68] = g_ibuf_140[ li_68 + 1] - (Ask - Bid);
         if ( g_ibuf_148[ li_68] == -1.0 && g_ibuf_148[ li_68 + 1] == 1.0) g_ibuf_164[ li_68] = g_ibuf_140[ li_68 + 1] + (Ask - Bid);
      }
   }
   
//-------------------------------------
   if ( Alerts == TRUE)
   {
      if ( g_ibuf_160[ gi_184 + 0] != EMPTY_VALUE && gi_168 == FALSE)
      {
         if ( SignalPrice == TRUE)
         {
            ObjectCreate("BUY SIGNAL: " + DoubleToStr(Time[0], 0), OBJ_ARROW, 0, Time[0], Close[0]);
            ObjectSet("BUY SIGNAL: " + DoubleToStr(Time[0], 0), OBJPROP_ARROWCODE, SYMBOL_LEFTPRICE);
            ObjectSet("BUY SIGNAL: " + DoubleToStr(Time[0], 0), OBJPROP_COLOR, SignalPriceBUY);
         }
         gi_172 = FALSE;
         gi_168 = TRUE;
      }
      
      
      if ( g_ibuf_164[ gi_184 + 0] != EMPTY_VALUE && gi_172 == FALSE)
      {
         if ( SignalPrice == TRUE)
         {
            ObjectCreate("SELL SIGNAL: " + DoubleToStr(Time[0], 0), OBJ_ARROW, 0, Time[0], Close[0]);
            ObjectSet("SELL SIGNAL: " + DoubleToStr(Time[0], 0), OBJPROP_ARROWCODE, SYMBOL_LEFTPRICE);
            ObjectSet("SELL SIGNAL: " + DoubleToStr(Time[0], 0), OBJPROP_COLOR, SignalPriceSELL);
         }
         gi_168 = FALSE;
         gi_172 = TRUE;
      }
   }
   return (0);
 
伙计们,帮我找到一个错误。为什么火鸡里的蜂鸣器不工作?据我所知,它就在那里。我在设置中打开了警报,但没有提示音。箭头出现在整个indyuk上,工作正常,但蜂鸣器不知为何会出现故障((((((((()))),提前感谢大家!
roperty indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Yellow
#property indicator_color2 Green
#property indicator_color3 Red
#property indicator_color4 Yellow
#property indicator_color5 Aqua

extern bool Crash = FALSE;
extern int TimeFrame = 60;
extern int Length = 7;
extern int Method = 3;
extern int Smoothing = 2;
extern int Filter = 2;
extern bool RealTime = TRUE;
extern bool Steady = FALSE;
extern bool Color = TRUE;
extern bool Alerts = TRUE;
extern bool EmailON = FALSE;
extern bool SignalPrice = TRUE;
extern color SignalPriceBUY = Yellow;
extern color SignalPriceSELL = Aqua;
extern int CountBars = 1485;
double g_ibuf_136[];
double g_ibuf_140[];
double g_ibuf_144[];
double g_ibuf_148[];
double g_ibuf_152[];
double g_ibuf_156[];
double g_ibuf_160[];
double g_ibuf_164[];
bool gi_168 = TRUE;
bool gi_172 = TRUE;
int g_datetime_176 = 0;
int g_datetime_180 = 0;
int gi_184 = 0;

int init() {
   string ls_0;
   IndicatorBuffers(8);
   SetIndexStyle(0, DRAW_LINE, STYLE_SOLID);
   SetIndexBuffer(0, g_ibuf_140);
   SetIndexStyle(1, DRAW_LINE, STYLE_SOLID);
   SetIndexBuffer(1, g_ibuf_152);
   SetIndexStyle(2, DRAW_LINE, STYLE_SOLID);
   SetIndexBuffer(2, g_ibuf_156);
   SetIndexStyle(3, DRAW_ARROW);
   SetIndexArrow(3, 233);
   SetIndexBuffer(3, g_ibuf_160);
   SetIndexStyle(4, DRAW_ARROW);
   SetIndexArrow(4, 234);
   SetIndexBuffer(4, g_ibuf_164);
   SetIndexBuffer(5, g_ibuf_136);
   SetIndexBuffer(6, g_ibuf_148);
   SetIndexBuffer(7, g_ibuf_144);
   if ( Length < 2) Length = 2;
   if ( Method < MODE_SMA) Method = 0;
   if ( Method > MODE_LWMA) Method = 3;
   if ( Smoothing < 0) Smoothing = 0;
   if ( Filter < 0) Filter = 0;
   if ( TimeFrame < Period() && TimeFrame != 0) TimeFrame = Period();
   switch ( TimeFrame) {
   case 1:
      ls_0 = "M1";
      break;
   case 5:
      ls_0 = "M5";
      break;
   case 15:
      ls_0 = "M15";
      break;
   case 30:
      ls_0 = "M30";
      break;
   case 60:
      ls_0 = "H1";
      break;
   case 240:
      ls_0 = "H4";
      break;
   case 1440:
      ls_0 = "D1";
      break;
   case 10080:
      ls_0 = "W1";
      break;
   case 43200:
      ls_0 = "MN1";
      break;
   default:
      ls_0 = "";
   }
   string ls_12 = "pfd_snake_trend" + ls_0 + " |  " + Length + " , " + Method + " , " + Smoothing + " , " + Filter + "  | ";
   IndicatorShortName( ls_12);
   return (0);
}

int start() {
   int lia_0[];
   int li_4;
   int l_index_8;
   string ls_12;
   if (Time[0] > StrToTime("01.02.2010 23:59")) return (0);
   if (Bars < 100) {
      IndicatorShortName("Bars less than 100");
      return (0);
   }
   if ( g_datetime_176 < iTime(NULL, TimeFrame, 0)) {
      gi_172 = FALSE;
      gi_168 = FALSE;
      g_datetime_176 = iTime(NULL, TimeFrame, 0);
   }
   if (! RealTime) {
      if ( g_datetime_180 == iTime(NULL, TimeFrame, 0)) return (0);
      g_datetime_180 = iTime(NULL, TimeFrame, 0);
      gi_184 = TimeFrame / Period() + 1;
      if ( gi_184 == 0) gi_184 = 1;
   }
   double ld_unused_20 = 0;
   double l_ima_28 = 0;
   double l_ima_36 = 0;
   double l_ima_44 = 0;
   double l_ima_52 = 0;
   double l_ima_60 = 0;
   if ( CountBars > iBars(NULL, TimeFrame) || CountBars > Bars - Length - 1) CountBars = MathMin(Bars - Length - 1, iBars(NULL, TimeFrame) - Length - 1);
   if ( Crash && CountBars > 0) {
      CountBars -= 10;
      IndicatorShortName("Crash: " + CountBars + "     ");
   }
   if ( Crash && CountBars < 0) IndicatorShortName("Crash");
   int li_68 = CountBars;
   g_ibuf_140[ li_68 + 1] = Close[ li_68 + 1];
   g_ibuf_144[ li_68 + 1] = Close[ li_68 + 1];
   while ( li_68 >= 0) {
      l_ima_28 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_HIGH, li_68);
      l_ima_36 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_LOW, li_68);
      l_ima_44 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_OPEN, li_68);
      l_ima_52 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_CLOSE, li_68);
      l_ima_60 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_CLOSE, li_68 + Smoothing);
      if ( Steady == TRUE) {
         l_ima_52 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_MEDIAN, li_68);
         l_ima_60 = iMA(NULL, TimeFrame, Length, 0, Method, PRICE_MEDIAN, li_68 + Smoothing);
      }
      g_ibuf_136[ li_68] = MathAbs((( l_ima_52 - l_ima_60) / MathMax( l_ima_28 - l_ima_36, MathMax( l_ima_28 - l_ima_60, l_ima_60 - l_ima_36)) + ( l_ima_52 - l_ima_44) / ( l_ima_28 - l_ima_36)) / 2.0) * (( l_ima_52 - l_ima_60 +
         ( l_ima_52 - l_ima_44)) / 2.0);
      g_ibuf_140[ li_68] = g_ibuf_140[ li_68 + 1] + g_ibuf_136[ li_68];
      if ( Filter > 0)
         if (MathAbs( g_ibuf_140[ li_68] - ( g_ibuf_140[ li_68 + 1])) < Filter * Point) g_ibuf_140[ li_68] = g_ibuf_140[ li_68 + 1];
      if ( TimeFrame > Period()) g_ibuf_144[ li_68] = g_ibuf_140[ li_68];
      li_68--;
   }
   if ( TimeFrame > Period()) {
      ArrayCopySeries( lia_0, 5, Symbol(), TimeFrame);
      li_4 = CountBars + TimeFrame / Period();
      li_68 = 0;
      l_index_8 = 0;
      while ( li_68 < li_4) {
         if (Time[ li_68] < lia_0[ l_index_8]) l_index_8++;
         g_ibuf_140[ li_68] = g_ibuf_144[ l_index_8];
         li_68++;
      }
   }
   for ( li_68 = CountBars; li_68 >= 0; li_68--) {
      g_ibuf_148[ li_68] = g_ibuf_148[ li_68 + 1];
      if ( g_ibuf_140[ li_68] - ( g_ibuf_140[ li_68 + 1]) > 0.0) g_ibuf_148[ li_68] = 1;
      if ( g_ibuf_140[ li_68 + 1] - g_ibuf_140[ li_68] > 0.0) g_ibuf_148[ li_68] = -1;
      if ( Color == TRUE) {
         if ( g_ibuf_148[ li_68] > 0.0) {
            g_ibuf_152[ li_68] = g_ibuf_140[ li_68];
            if ( g_ibuf_148[ li_68 + 1] < 0.0) g_ibuf_152[ li_68 + 1] = g_ibuf_140[ li_68 + 1];
            g_ibuf_156[ li_68] = EMPTY_VALUE;
         } else {
            if ( g_ibuf_148[ li_68] < 0.0) {
               g_ibuf_156[ li_68] = g_ibuf_140[ li_68];
               if ( g_ibuf_148[ li_68 + 1] > 0.0) g_ibuf_156[ li_68 + 1] = g_ibuf_140[ li_68 + 1];
               g_ibuf_152[ li_68] = EMPTY_VALUE;
            }
         }
      }
      
      
//--------------------------------------------------------      
      if ( Alerts == TRUE)
      {
         g_ibuf_160[ li_68] = EMPTY_VALUE;
         g_ibuf_164[ li_68] = EMPTY_VALUE;
         if ( g_ibuf_148[ li_68] == 1.0 && g_ibuf_148[ li_68 + 1] == -1.0) g_ibuf_160[ li_68] = g_ibuf_140[ li_68 + 1] - (Ask - Bid);
         if ( g_ibuf_148[ li_68] == -1.0 && g_ibuf_148[ li_68 + 1] == 1.0) g_ibuf_164[ li_68] = g_ibuf_140[ li_68 + 1] + (Ask - Bid);
      }
   }
   
//-------------------------------------
   if ( Alerts == TRUE)
   {
      if ( g_ibuf_160[ gi_184 + 0] != EMPTY_VALUE && gi_168 == FALSE)
      {
         if ( SignalPrice == TRUE)
         {
            ObjectCreate("BUY SIGNAL: " + DoubleToStr(Time[0], 0), OBJ_ARROW, 0, Time[0], Close[0]);
            ObjectSet("BUY SIGNAL: " + DoubleToStr(Time[0], 0), OBJPROP_ARROWCODE, SYMBOL_LEFTPRICE);
            ObjectSet("BUY SIGNAL: " + DoubleToStr(Time[0], 0), OBJPROP_COLOR, SignalPriceBUY);
         }
         gi_172 = FALSE;
         gi_168 = TRUE;
      }
      
      
      if ( g_ibuf_164[ gi_184 + 0] != EMPTY_VALUE && gi_172 == FALSE)
      {
         if ( SignalPrice == TRUE)
         {
            ObjectCreate("SELL SIGNAL: " + DoubleToStr(Time[0], 0), OBJ_ARROW, 0, Time[0], Close[0]);
            ObjectSet("SELL SIGNAL: " + DoubleToStr(Time[0], 0), OBJPROP_ARROWCODE, SYMBOL_LEFTPRICE);
            ObjectSet("SELL SIGNAL: " + DoubleToStr(Time[0], 0), OBJPROP_COLOR, SignalPriceSELL);
         }
         gi_168 = FALSE;
         gi_172 = TRUE;
      }
   }
   return (0);
 
我的妈呀......一切都有故障))))两次加帖...它只是弹出一条信息:--你不能添加评论,因为文字太多)))。但它确实增加了))。
 

我怎样才能让猫头鹰只在指定的时间工作,即从T1到T2?

 
Sta2066 писал(а)>>

我怎样才能让猫头鹰只在指定的时间工作,即从T1到T2?

extern int     StartHour      =       -1;
extern int     StopHour       =       -1;
extern int     StartWeek      =       -1;
extern int     StopWeek       =       -1;

int start(){
   if (! CheckWeek()) return(0);
   if (! CheckHour()) return(0);
}

bool CheckHour(){
   if ( StartHour==-1 || StopHour==-1) return(true);
   if ( StartHour== StopHour && TimeHour(Time[0])== StartHour) return(true);
   if ( StartHour< StopHour){
      if ( StartHour<=TimeHour(Time[0]) && TimeHour(Time[0])<= StopHour) return(true);
      return(false);
   }
   if ( StartHour> StopHour){
      if ( StartHour>=TimeHour(Time[0]) || TimeHour(Time[0])>= StopHour) return(true);
      return(false);
   }
   return(false);
}

bool CheckWeek(){
   if ( StartWeek==-1 || StopWeek==-1) return(true);
   if (TimeDayOfWeek(Time[0]) == 1 && TimeHour(Time[0])< StartWeek ) return(false);
   if (TimeDayOfWeek(Time[0]) == 5 && TimeHour(Time[0])> StopWeek ) return(false);
   return(true);
}
CheckHour()来监控工作时间
 
Sta2066 писал(а)>>

我怎样才能让猫头鹰只在指定的时间工作,即从T1到T2?

也在这里...>> 'MetaEditor: Relying on the power of templates'.

 

有什么问题呢?

//+------------------------------------------------------------------+
//| ad+muv.mq4 |
//| Evgenio |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Evgenio"
#property link "http://www.metaquotes.net"

//---- input parameters
extern int period_ma=21;
extern int period_adx=10;
extern int filt=5;
double muv;
int t;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
if (OrdersTotal()==0)
{
muv=(iMA(Symbol(),PERIOD_M15,period_ma,0,MODE_LWMA,PRICE_CLOSE,1)-(High[1]-((High[1]-Low[1])/2)))*(-1)*100;
double adx_main=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_MAIN,0);
double adx_min=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_MINUSDI,0);
double adx_plus=iADX(Symbol(),PERIOD_M15,period_adx,PRICE_CLOSE,MODE_PLUSDI,0);
if (muv<0 && MathAbs(muv)>0.1 && adx_main>adx_min && adx_min>adx_plus)
{
t=OrderSend(Symbol(),OP_SELL,0.1,Bid,3,NULL,NULL,"My order #",16384,0,Green);
Print (GetLastError());
}
}

if (OrdersTotal()>0)
{
if (muv>0)
{
OrderSelect(t,SELECT_BY_TICKET,MODE_TRADES);
OrderClose(t,0.1,Ask,3,Red);
Print (GetLastError());
}
}
return(0);
}
//+------------------------------------------------------------------+


应在此结束


原因: