警告を数秒遅らせる

 
皆さん、こんにちは。
この コードを 修正して、アラートが ローソクの 開始 時に表示さ れるのではなく 後に 条件を 検出 するようにしたいと 思います

マッシモ さん いつもありがとう ございます


int start(){
if (BarStart !=Time[0]) 
{
  BarStart = Time[0]; 

  //Indicator Buffer 1
     
       if ( iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 0+1) > 70
      
      
      )
        {
         Buffer1[0] = Low[0] - iATR(NULL, PERIOD_CURRENT, 14, 0); //Set indicator value at Candlestick Low - Average True Range
        }
      else
        {
         Buffer1[0] = 0;
        }
      //Indicator Buffer 2
    
      && iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 0) < 30
     
      )
        {
         Buffer2[0] = High[0] + iATR(NULL, PERIOD_CURRENT, 14, 0); //Set indicator value at Candlestick High + Average True Range
        }
      else
        {
         Buffer2[0] = 0;
        }
     }
   return(0);
  }
 
omissamf: この コードを 修正したい
  1. コーディングの 勉強を するか、誰かにお金を 払うか。私たちは、あなたのためにコードを書くつもりはありません。私たちは、あなたが試したことSRCを 使用)とあなたの 問題の性質を投稿していただければ、喜んでお手伝いします。
  2. 次のようなことを試されましたか?
      BarStart = Time[0]; 
      Sleep(3000); RefreshRates();

 
WHRoederさん、ご返事ありがとうございます。私の行動については謝罪しますが、誰かを不快にしたり、無礼にしたりする意図はありませんでした。私はこれを達成するためにコードを変更するには、一日中試してみましたが、私は成功しませんでした。彼らは、研究MQL4の始まりです。私は再び謝罪の管理者をお願いします。挨拶、マッシモ
 

こんにちはWHRoeder、私は試してみましたが、動作 しません!!私はすべての方法で試してみましたが、私は間違っている場所を理解していない!!!。

とにかく、Massimoさん、いろいろとありがとうございました。

 
コードにアラートが表示されていません。
 
こんにちはGunRai 私はあなたに 完全なコードを 送信 するので、 私は説明します 私は それが 今やっているように 燭台の 開口 部の条件の 確認を 遅らせる ことが できなかったが、3 、さらに WHRoederの 提案 私は どこに間違って いる 理解 することはできません!!!

マックス さん ありがとう ございます


//+------------------------------------------------------------------+
//|                                                    RSI 70-30.mq4 |
//|                                                          Massimo |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Massimo"
#property link      "https://www.mql5.com"
#property version   "1.00"
#include <stdlib.mqh>
#include <stderror.mqh>

//--- indicator settings
#property indicator_chart_window
#property indicator_buffers 2

#property  indicator_type1 DRAW_ARROW
#property  indicator_width1 1
#property  indicator_color1 0xFFAA00
#property  indicator_label1 "Buy"

#property  indicator_type2 DRAW_ARROW
#property  indicator_width2 1
#property  indicator_color2 0x0000FF
#property  indicator_label2 "Sell"
static datetime BarStart=0;

//--- indicator buffers
double Buffer1[];
double Buffer2[];

datetime time_alert; //used when sending alert
extern bool Audible_Alerts = true;
double myPoint; //initialized in OnInit

void myAlert(string type, string message)
  {
   if(type == "print")
      Print(message);
   else if(type == "error")
     {
      Print(type+" | RSI 30-70 @ "+Symbol()+","+Period()+" | "+message);
     }
   else if(type == "order")
     {
     }
   else if(type == "modify")
     {
     }
   else if(type == "indicator")
     {
      if(Audible_Alerts) Alert(type+" | RSI 30-70 @ "+Symbol()+","+Period()+" | "+message);
     }
  }
  
  //+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {   
   IndicatorBuffers(2);
   SetIndexBuffer(0, Buffer1);
   SetIndexEmptyValue(0, 0);
   SetIndexArrow(0, 241);
   SetIndexBuffer(1, Buffer2);
   SetIndexEmptyValue(1, 0);
   SetIndexArrow(1, 242);
   //initialize myPoint
   myPoint = Point();
   if(Digits() == 5 || Digits() == 3)
     {
      myPoint *= 10;
     }
   return(INIT_SUCCEEDED);
  }
//_____________________________________________
//_____________________________________________


int start(){
if (BarStart !=Time[0]) 
{
  BarStart = Time[0]; 
   Sleep(3000); RefreshRates(); //this code don't work

//
     
      //Indicator Buffer 1
      if(iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 0) < 30
      
      )
        {
         Buffer1[0] = Low[0] - iATR(NULL, PERIOD_CURRENT, 14, 0); //Set indicator value at Candlestick Low - Average True Range
         if(0 == 0 && Time[0] != time_alert) { myAlert("indicator", "Buy"); time_alert = Time[0]; } //Instant alert, only once per bar
        }
      else
        {
         Buffer1[0] = 0;
        }
      //Indicator Buffer 2
      if(iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 0) > 70
     
      )
        {
         Buffer2[0] = High[0] + iATR(NULL, PERIOD_CURRENT, 14, 0); //Set indicator value at Candlestick High + Average True Range
         if(0 == 0 && Time[0] != time_alert) { myAlert("indicator", "Sell"); time_alert = Time[0]; } //Instant alert, only once per bar
        }
      else
        {
         Buffer2[0] = 0;
        }
     }
   return(0);
  }
//+------------------------------------------------------------------+
 
正しく、インジケータを実行しています。
int start(){
if (BarStart !=Time[0]) 
{
  BarStart = Time[0]; 
   Sleep(3000); RefreshRates(); //this code don't work
これを試してみてください。
#define   MAX_DATETIME   D'3000.12.31 23:59:59'  // 32,535,215,999
#define   MIN_DATETIME   D'1970.01.01 00:00:00'  // Zero.

int start(){
static datetime alertTime = MAX_DATETIME;
if(TimeCurrent() > alertTime){ alertTime = MAX_DATETIME; Alert(...); }
if (BarStart !=Time[0]) 
{
  BarStart = Time[0]; 
  :
  if(condition) alertTime = TimeCurrent() + 3; // Delay
 
WHRoeder:
正しく、インジケータを実行しています。
これを試してみてください。

ありがとう ございます 私は あなたが 私に 投稿 したコードを 勉強 し、 その後あなたを教えて ください
とりあえず Massimo さん ありがとう ございました
 
WHRoeder:
正しくは、インジケーターを動かしているのです。
Y THI

WHRoeder こんにちは 私はあなたの 指示で コードを変更 しようと しました 私は 様々な 方法を試して みましたがそれはあなたが 送信する ものはあなたが エラーを持って いないですが、 矢印は ろうそくの 正確な 開口部を 表示し続けながら約5 秒の 遅延は 唯一の sull'alert 音が あることです。

こんにちは 、そして ありがとうございます Massimo さん

#define   MAX_DATETIME   D'3000.12.31 23:59:59'  // 32,535,215,999
#define   MIN_DATETIME   D'1970.01.01 00:00:00'  // Zero.


int start(){
static datetime alertTime = MAX_DATETIME;
if (TimeCurrent() > alertTime)
{ alertTime = MAX_DATETIME;
 Alert(“ ATTENTION!!!!); }

if (BarStart !=Time[0]) 
{
  BarStart = Time[0]; 
  
//
     
      //Indicator Buffer 1
      if(iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 0) < 30
      
      )
        {
         alertTime = TimeCurrent() + 3;
         Buffer1[0] = Low[0] - iATR(NULL, PERIOD_CURRENT, 14, 0);        }
      else
        {
         Buffer1[0] = 0;
        }
      //Indicator Buffer 2
      if(iRSI(NULL, PERIOD_CURRENT, 2, PRICE_CLOSE, 0) > 70
     
      )
        {
                     alertTime = TimeCurrent() + 3;
         Buffer2[0] = High[0] + iATR(NULL, PERIOD_CURRENT, 14, 0);                }
      else
        {
         Buffer2[0] = 0;
        }
     }
   return(0);
  }
//+------------------------------------------------------------------+





 
omissamf: sull'alertの 音しか 出ない
  1. 意味不明です。
  2. Alert( ATTENTION!!!!); }
    コンパイル できるコードを試してみてください。
 
WHRoeder:
  1. 意味不明です。
  2. コンパイル できるコードを試す/投稿してください。
サウンド / ビジュアルアラートで 表示さ れるものなのでATTENTION!!!入れましたが アローの 発症を 数秒 遅らせる ために、皆さんの助けを借りて試している ところです この場合 アテンション!!! 矢印は ちょうど ろうそくを開いて 表示さ れますがそれは 5 後に 表示されます
マッシモ すべてのためにありがとう ございます
理由: