任何菜鸟问题,为了不给论坛添乱。专业人士,不要路过。没有你就无处可去 - 6. - 页 928

 
TarasBY:
if (iBarShift (_Symbol, PERIOD_D1, OrderOpenTime()) == 0) continue;

我很震惊!!。一条线!!!。谢谢你!!!!。我已经开始把时间分解成小时、分钟、秒,以获得从一天开始的秒数,并比较...

我自己也不会想到这一点。

 
abeiks:
你好!
我怎样才能在专家顾问(MQL4)中获得其他货币对的每一个刻度?
那么你能告诉我如何从其他货币对中获得每10ms一次的ticks信息吗?
 
OnTimer() 将帮助你。
 
AlexeyVik:
OnTimer() 是对你的帮助。
谢谢你!
 
AlexeyVik:
OnTimer() 将帮助你。
这里使用EventSetTimer( int seconds )的指定周期。这是否意味着我可以每隔1秒就能得到关于蜱虫的信息?我需要更快的速度 - 10-20ms。
 

该指标需要在较小的时间框架上,通过日线的开盘时间获得指数。

它只在零条上正确工作。有什么问题吗?

#property indicator_separate_window
#property indicator_buffers 1
#property  indicator_color1 Magenta
//--- input parameters
//--- buffers
double I[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorBuffers(1);
   SetIndexBuffer(0,I);
   IndicatorDigits(Digits+1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
    int counted_bars=IndicatorCounted(),limit, i,index;
    datetime DAY;
    bool exact=true;
   if(counted_bars>0)
      counted_bars--;  
   limit=Bars-counted_bars-1;
   for(i=limit;i>=0;i--)
   {
      DAY=iTime(NULL,PERIOD_D1,i);
      index=iBarShift(NULL,PERIOD_CURRENT,DAY);
      I[i]=index;
   }
   return(0);
  }
//+------------------------------------------------------------------+
 
abeiks:
这里使用EventSetTimer( int seconds )的指定周期。这是否意味着我可以每隔1秒就获得蜱虫信息?我需要更快的速度 - 10-20ms。
不仅是EventSetTimer( int seconds ),还有EventSetMillisecondTimer,为什么你这么不注意?旁边写着。
 
AlexeyVik:
不仅是EventSetTimer( int seconds ),还有EventSetMillisecondTimer,为什么你这么不注意?旁边写着。
谢谢你! 我在参考书《OnTimer》中看到,它只提到了EventSetTimer。
 
你能告诉我如何写一个这样的简单EA吗?它在一天中的某个时间开出一个订单,然后如果该订单以止损价收盘,它就在相反的方向开出相同的订单。第二天,一切都在重复。我想测试一下这种EA,看看它的利润是否会很稳定。请帮助我写好它。
 

请帮助我,如何写"如果价格来自于某个范围"?

图片中的例子:要打开交易,价格应该来自某个范围1.1100,1.1100应该来自某个范围1.1200。

带有iHighest和iLowest的变体不适合,因为这个条件不受时间的影响。