MQL4、MQL5に関する初心者からの質問、アルゴリズムやコードに関するヘルプ、ディスカッションなど。 - ページ 1491

 
Alexey Viktorov:

あからさまな嘘をつくのは見苦しい。自分の投稿を削除して、自分の無教養を他人のせいにするんですね。嘘つけ。

どんなメッセージ?
最初からprev_calculatedとrates_totalしか書いていないのですが。

それに対して、あなたから返信がありました。

なんでそんな未熟なプログラマーを馬鹿にする必要があるんだ?

履歴の取りこぼしがあり、差が1以上ある場合はどうするのか?でも、そんなことより、1小節飛ばそうよ......ほら、もう1回、もう1回。そして、説明もなしに、なぜコードを与えなければならないのか?最終的に何が得られるか、見てみましょう。

だからお前は嘘つきなんだ)

1

 
Taras Slobodyanik:

はい、配列の方向を変更するか、1ではなくrates_total-2の インデックスを取る必要があります。


追加した後。

ArraySetAsSeries(open,true);
ArraySetAsSeries(high,true);
ArraySetAsSeries(low,true);
ArraySetAsSeries(close,true);
ArraySetAsSeries(time,true);   

正しく定義しています。

2021.06.02 18:33:09.480 Test (Volatility 10 Index,M1)   Up
2021.06.02 18:34:09.479 Test (Volatility 10 Index,M1)   Dn

フルコードです。

//+------------------------------------------------------------------+
//|                                                    test.mq5 |
//|                                  Copyright 2021, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Ltd."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property indicator_chart_window

#property indicator_buffers 2
#property indicator_plots   2

#property indicator_label1  "Signal UP"
#property indicator_type1   DRAW_ARROW
#property indicator_color1  clrLime
#property indicator_style1  STYLE_SOLID
#property indicator_width1  2

#property indicator_label2  "Signal DN"
#property indicator_type2   DRAW_ARROW
#property indicator_color2  clrRed
#property indicator_style2  STYLE_SOLID
#property indicator_width2  2

double up[];
double dn[];

datetime fin=0, last=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
    IndicatorSetString(INDICATOR_SHORTNAME, "Prototype");
    
   SetIndexBuffer(0,up,INDICATOR_DATA);
   PlotIndexSetInteger(0,PLOT_ARROW,233);
    
   SetIndexBuffer(1,dn,INDICATOR_DATA);
   PlotIndexSetInteger(1,PLOT_ARROW,234);
   
   
  
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
   {
   
   ArraySetAsSeries(open,true);
   ArraySetAsSeries(high,true);
   ArraySetAsSeries(low,true);
   ArraySetAsSeries(close,true);
   ArraySetAsSeries(time,true);   
 
   fin=iTime(Symbol(), PERIOD_M1 ,0);
   if(last==fin) return(rates_total);
   last=fin;
   
   if(rates_total - prev_calculated == 1)
      {
         if(open[1] > close[1])
         {
           Print("Dn");
         }
    else if(open[1] < close[1])
         {
           Print("Up");
         }
     }

return(rates_total);
}
 
Taras Slobodyanik:

what message?
最初からprev_calculatedとrates_totalしか書いてませんでした。

それに対して、あなたから返信がありました。

だからお前は嘘つきなんだ)


ええ、削除したわけではなく、その投稿をすぐに見つけられなかっただけです。

トレーディング、自動売買システム、トレーディング戦略のテストに関するフォーラム。

MQL4、MQL5に関する初心者からの質問、アルゴリズムやコードに関するヘルプ、ディスカッションなど。

タラス・スロボジャニク, 2021.06.02 16:47

括弧がないからです。

if(rates_total - prev_calculated == 1)
   {
   //Print("Новый бар");
   if(open[1] > close[1])
        {
        Print("Dn");
        }
   else if(open[1] < close[1])
        {
        Print("Up");
        }
   }

しかし!まだ言葉を引っ込めるのか......お前は誰だ?
 
そして、その結果、
   ArraySetAsSeries(open,true);
   ArraySetAsSeries(high,true);
   ArraySetAsSeries(low,true);
   ArraySetAsSeries(close,true);
   ArraySetAsSeries(time,true);   
 

   if(rates_total - prev_calculated == 1)
      {
         if(open[1] > close[1])
         {
           Print("Dn");
         }
    else if(open[1] < close[1])
         {
           Print("Up");
         }
     }
 
ご協力ありがとうございました :)
 
Alexey Viktorov:

ええ、削除したわけではなく、すぐに見つけられなかっただけです。

しかし、まだ私の言葉を撤回するあなたは誰ですか?
Alexey Viktorov:

あからさまに嘘をつくのは失礼だ。自分の投稿を削除して、自分の無教養を他人のせいにするんですね。嘘つけ。

ということは、私は自分の投稿を削除して自分の無教養を他人のせいに しなかったので 、嘘つきなんですね、オリジナル)))


何度でも言う。

Taras Slobodyanik:

左のバークロージャーを読めとは言わない、それは私のコードではない)

吾唯足知

if(rates_total - prev_calculated == 1)
 
m-r LSV:
ご協力ありがとうございました :)

下さい)

 
もっとシェアしてください。ただし、二人ともGoProを使うことが条件です。
 
Artyom Trishkin:
もっとシェアしてください。ただし、二人ともGoProを使うことが条件です。

これは一部の "頭のいい人 "の戦略で、相手の目に埃を吹きかけ、失敗したらあらゆる罪を責め立て、自分の無教養と無能を隠し、相手に自分が馬鹿ではないことを正当化させるのである。

 
Taras Slobodyanik:

これは一部の「頭のいい人」の戦略で、相手の目に埃を吹きかけ、失敗したら自分の無教養と無能を隠すために相手のあらゆる罪を非難し、相手に自分は愚かではないことを正当化させるのである。

タラシク、ションベン・・・アホか。ヒントの後に生成されたコードを見てください...これは「やってはいけないことを教える」ということであり、理解できない人は自己責任です。

理由: