[存档!]任何菜鸟问题,为了不给论坛添乱。专业人士,不要与它擦肩而过。没有你,哪里都不能去 - 2. - 页 221

 

这是由专家顾问实现的功能之一。当然, 可以写一个EA,其中 包含一个跟踪止损(当然,这样的EA已经被大量地写出来了)。

在MT终端中,有一个标准的追踪止损,不与任何专家顾问相关。

 
alsu:


MT终端有内部拖尾,与任何专家顾问无关。

谢谢你。这正是我所问的。那么还有一个问题。了解MQL4需要多长时间?我并不是说要成为一个专家,写出一个彻底令人敬畏的专家顾问。我并不是说要成为一个专业人员来写一个从A到Z的很酷的EA,但至少要知道在写一个已经存在的EA时应该怎么调整。为了更清楚地说明自己:在这个阶段,我正在掌握运营商。从我开始学习它们到现在已经有两个星期了。你认为机会有多大。我重复一遍。老师不在身边,无法问人。

谢谢你的回答。

 

伙计们,这是最糟糕的!()()()。

我想选择一家国外的经纪公司,在海外开户......我在评论中找不到....,感觉是个骗局,是个 "鲨鱼的办公室"....(

帮助大家使用MT4....,我将非常感激!!!!!

 
比如,新的匹诺曹正在寻找一个可靠的神奇领域。别傻了)。
 

单线指示器。

#property indicator_separate_window    
#property indicator_buffers 1        
#property indicator_color1 Aqua      

  int index;
  double TickPrice[1000];
//--------------------------------------------------------------------
int init()                          
  {
   SetIndexBuffer(0,TickPrice);          
   SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,1); 
   return;                          
  }
//--------------------------------------------------------------------
int start()                         
  {
  
      TickPrice[index] = Bid;
      index++;

   return;                         
  }
//--------------------------------------------------------------------

问题。

为什么 从右到左画一条线

 

这个怎么样?

#property indicator_separate_window    
#property indicator_buffers 1        
#property indicator_color1 Aqua      

  int index=1000;
  double TickPrice[1000];
//--------------------------------------------------------------------
int init()                          
  {
   SetIndexBuffer(0,TickPrice);          
   SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,1); 
   return;                          
  }
//--------------------------------------------------------------------
int start()                         
  {
  
      TickPrice[index] = Bid;
      index--;

   return;                         
  }
//--------------------------------------------------------------------
 

你好,请告诉我在哪里可以找到一个重新绘制日线的指标,使其在不同的时间开始。

例如:终端时间为00:00。在指标的输入参数 中,我们把:+4。现在每天的条形图在4点开始。

预先感谢你。

 
DhP:

如果你这样做呢?


是的,这就好了。开始向正确的方向画。但如果index--,那么有一天就会变成index==0,一切都会被关闭。

你如何使运动继续下去?

 
artmedia70:
我在哪里可以增加阵列的大小?我在哪里写这个值?(ArrayResize() 函数)


通过Oreder和位置类型对数组进行排序的工作。

int OrderStatus() {
   int z1=1, z2=1, z3=1, z4=1;
   if (B>0) {ArrayResize(TicketB,B);}
   if (S>0) {ArrayResize(TicketS,S);}
   if (BS>0) {ArrayResize(TicketBS,BS);}
   if (SS>0) {ArrayResize(TicketSS,SS);}
   int i, k=OrdersTotal();
      for (i=1; i<=k; i++) {
         if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
            if (OrderType()==OP_BUYSTOP && OrderSymbol()==Symbol() && OrderMagicNumber()==MG) {
            TicketBS[z1]=OrderTicket();
            z1++;
            }
            if (OrderType()==OP_SELLSTOP && OrderSymbol()==Symbol() && OrderMagicNumber()==MG) {
            TicketSS[z2]=OrderTicket();
            z2++;
            }
            if (OrderType()==OP_BUY && OrderSymbol()==Symbol() && OrderMagicNumber()==MG) {
            TicketB[z3]=OrderTicket();
            z3++;
            }
            if (OrderType()==OP_SELL && OrderSymbol()==Symbol() && OrderMagicNumber()==MG) {
            TicketS[z4]=OrderTicket();
            z4++;
            }
         }
      }
}

但我无法按照买入和卖出头寸的盈利能力进一步排序:它插入了零。

int OrderVBezubitok() {
   int k1=0, k2=0;
   ArrayResize(TicketBez,B+S);
   ArrayResize(TicketTral,B+S);
   int i;
   if (ArraySize(TicketB)>0) {
      for (i=1; i<ArraySize(TicketB)+1; i++) {
            OrderSelect(TicketB[i], SELECT_BY_TICKET, MODE_TRADES);
            if (OrderProfit()>0) {k1++; TicketTral[k1]=TicketB[i];} 
            else {k2++; TicketBez[k2]=TicketB[i];}
                       
         
      }
   }
   if (ArraySize(TicketS)>0) {
      for (i=1; i<ArraySize(TicketS)+1; i++) {
            OrderSelect(TicketS[i], SELECT_BY_TICKET, MODE_TRADES);
            if (OrderProfit()>0) {k1++; TicketTral[k1]=TicketB[i];} 
            else {k2++; TicketBez[k2]=TicketB[i];}
                       
         
      }
   }      
}

为什么,我不明白

 

朋友们好!

我不知道我是否在正确的地方,这是我在论坛上的第一个帖子。

我在请求帮助。

也许有人遇到过类似的情况。

问题是这样的。我在写一个指标,用来寻找一个时期的最高和最低价格。我想用最大值除以最小值,并在独立窗口中显示。

但窗口是空的。

当加、减、乘等。最大值和最小值的指示灯显示正常。

以下是代码。这根本不算什么。

#property indicator_separate_window
#property indicator_buffers 3

#property indicator_color1 MediumSpringGreen
#property indicator_color2 Crimson
#property indicator_color3 LightGray

#property indicator_width1 1
#property indicator_width2 1
#property indicator_width3 1

extern int Buy_bars = 20;           //Количество баров для открытия позиции
extern int Sell_bars = 23;          //Количество баров для закрытия позиции  

double   buf_0[],                   //индикаторныЙ массив максимумов 
         buf_1[],                   //индикаторныЙ массив минимумов 
         buf_sr[] ;                 //индикаторныЙ массив средних значений
//extern int Shift = 0;

int init()
  {
   SetIndexBuffer (0, buf_0);
   SetIndexStyle (0, DRAW_LINE);
   SetIndexLabel (0, "Maximum");
   SetIndexShift (0, 0);
   
   SetIndexBuffer (1, buf_1);
   SetIndexStyle (1, DRAW_LINE);
   SetIndexLabel (1, "Minimum");
   SetIndexShift (1, 0);
   
   SetIndexBuffer (2, buf_sr);
   SetIndexStyle (2, DRAW_LINE);
   SetIndexLabel (2, "Srednyaya");
   SetIndexShift (2, 0);
   
   return;
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int i, k ,t;
   int    counted_bars=IndicatorCounted();
//----
   i = Bars - counted_bars - 1;
   while (i >= 0)
   {
      double max = 0;
      double min = 999999999999.99;
   
   for (k=i ; k<=i+Buy_bars-1; k++)
      {
      if (High[k] > max) max = High[k];
      }
   for (t=i; t<=i+Sell_bars-1; t++)  
      {
      if (Low[t] < min) min = Low[t];
      }
        
   i--;
   

   buf_sr[i] = (max/min);
   }
   return;
  }
//+------------------------------------------------------------------+

指出错误。

预先感谢你。