初心者の方からの質問 MQL5 MT5 MetaTrader 5 - ページ 1387

 
私はAtamurat Abdukayimovです。昨年、mt5アプリをインストールしたら、+998339667671という番号から、今は廃止されている私の古い番号+998975221951に電話がかかってきました。彼女と通信できますか?
 

午後

標準のMACDをやり直しています。

//+------------------------------------------------------------------+
//|                                                         MACD.mq5 |
//|                   Copyright 2009-2020, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright   "2009-2020, MetaQuotes Software Corp."
#property link        "http://www.mql5.com"
#property description "Moving Average Convergence/Divergence"
#include <MovingAverages.mqh>
//--- indicator settings
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_plots   2
#property indicator_type1   DRAW_HISTOGRAM
#property indicator_type2   DRAW_LINE
#property indicator_color1  Silver
#property indicator_color2  Red
#property indicator_width1  2
#property indicator_width2  1
#property indicator_label1  "MACD"
#property indicator_label2  "Signal"
//--- input parameters
input int                InpFastEMA=12;               // Fast EMA period
input int                InpSlowEMA=26;               // Slow EMA period
input int                InpSignalSMA=9;              // Signal SMA period
input ENUM_APPLIED_PRICE InpAppliedPrice=PRICE_CLOSE; // Applied price
//--- indicator buffers
double ExtMacdBuffer[];
double ExtSignalBuffer[];
double ExtFastMaBuffer[];
double ExtSlowMaBuffer[];

int    ExtFastMaHandle;
int    ExtSlowMaHandle;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,ExtMacdBuffer,INDICATOR_DATA);
   SetIndexBuffer(1,ExtSignalBuffer,INDICATOR_DATA);
   SetIndexBuffer(2,ExtFastMaBuffer,INDICATOR_CALCULATIONS);
   SetIndexBuffer(3,ExtSlowMaBuffer,INDICATOR_CALCULATIONS);
//--- sets first bar from what index will be drawn
   PlotIndexSetInteger(1,PLOT_DRAW_BEGIN,InpSignalSMA-1);
//--- name for indicator subwindow label
   string short_name=StringFormat("MACD(%d,%d,%d)",InpFastEMA,InpSlowEMA,InpSignalSMA);
   IndicatorSetString(INDICATOR_SHORTNAME,short_name);
//--- get MA handles
   ExtFastMaHandle=iMA(NULL,0,InpFastEMA,0,MODE_EMA,InpAppliedPrice);
   ExtSlowMaHandle=iMA(NULL,0,InpSlowEMA,0,MODE_EMA,InpAppliedPrice);
  }
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence                           |
//+------------------------------------------------------------------+
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[])
  {
   if(rates_total<InpSignalSMA)
      return(0);
//--- not all data may be calculated
   int calculated=BarsCalculated(ExtFastMaHandle);
   if(calculated<rates_total)
     {
      Print("Not all data of ExtFastMaHandle is calculated (",calculated," bars). Error ",GetLastError());
      return(0);
     }
   calculated=BarsCalculated(ExtSlowMaHandle);
   if(calculated<rates_total)
     {
      Print("Not all data of ExtSlowMaHandle is calculated (",calculated," bars). Error ",GetLastError());
      return(0);
     }
//--- we can copy not all data
   int to_copy;
   if(prev_calculated>rates_total || prev_calculated<0)
      to_copy=rates_total;
   else
     {
      to_copy=rates_total-prev_calculated;
      if(prev_calculated>0)
         to_copy++;
     }
//--- get Fast EMA buffer
   if(IsStopped()) // checking for stop flag
      return(0);
   if(CopyBuffer(ExtFastMaHandle,0,0,to_copy,ExtFastMaBuffer)<=0)
     {
      Print("Getting fast EMA is failed! Error ",GetLastError());
      return(0);
     }
//--- get SlowSMA buffer
   if(IsStopped()) // checking for stop flag
      return(0);
   if(CopyBuffer(ExtSlowMaHandle,0,0,to_copy,ExtSlowMaBuffer)<=0)
     {
      Print("Getting slow SMA is failed! Error ",GetLastError());
      return(0);
     }
//---
   int start;
   if(prev_calculated==0)
      start=0;
   else
      start=prev_calculated-1;
//--- calculate MACD
   for(int i=start; i<rates_total && !IsStopped(); i++)
      ExtMacdBuffer[i]=ExtFastMaBuffer[i]-ExtSlowMaBuffer[i];
//--- calculate Signal
   SimpleMAOnBuffer(rates_total,prev_calculated,0,InpSignalSMA,ExtMacdBuffer,ExtSignalBuffer);
//--- OnCalculate done. Return new prev_calculated.
   return(rates_total);
  }
//+------------------------------------------------------------------+

シンボル変数を追加する。

Symbol1

変更

   ExtFastMaHandle=iMA(NULL,0,InpFastEMA,0,MODE_EMA,InpAppliedPrice);
   ExtSlowMaHandle=iMA(NULL,0,InpSlowEMA,0,MODE_EMA,InpAppliedPrice);

へ。

   ExtFastMaHandle=iMA(Symbol1,0,InpFastEMA,0,MODE_EMA,InpAppliedPrice);
   ExtSlowMaHandle=iMA(Symbol1,0,InpSlowEMA,0,MODE_EMA,InpAppliedPrice);

その結果、ログに「ExtFastMaHandleのすべてのデータが計算されていません(20057バー)」というエラーが表示されます。エラー 4806

そして、インジケータをレンダリングしない。コードからcheckとreturn(0)を削除してみました。

   if(calculated<rates_total)
     {
      Print("Not all data of ExtFastMaHandle is calculated (",calculated," bars). Error ",GetLastError());
      return(0);
     }

и

   if(calculated<rates_total)
     {
      Print("Not all data of ExtSlowMaHandle is calculated (",calculated," bars). Error ",GetLastError());
      return(0);
     }

過去ログに入り込む。

高速EMAの取得は失敗!エラー 4807

付属のインジケータとimaがデータを取得するチャートのバー数が異なるためでしょうか?

どのように最適なコードを変更するには、MACDは、それがチャートに接続されているシンボルのためではなく、選択したシンボルのために計算されますか?

 
Sergey #:

こんにちは。

標準のMACDをやり直しています。

シンボル変数を追加する。

変更

へ。

その結果、ログに「ExtFastMaHandleのすべてのデータが計算されていません(20057バー)」というエラーが表示されます。エラー 4806

そして、インジケータをレンダリングしない。コードからcheckとreturn(0)を削除してみました。

и

過去ログに入り込む。

高速EMAの取得は失敗!エラー 4807

付属のインジケータとimaがデータを取得するチャートのバー数が異なるためでしょうか?

MACDのコードを、チャートに添付されたシンボルではなく、選択されたシンボルのMACDを計算するように変更するにはどうすればよいですか?

使用ヘルプ例:iMACD

 
Vladimir Karputov #:

参考例:iMACDを 使用する

ありがとうございました。

 

皆さんこんにちは!

FXCMで口座を開設したのですが、MT5には通貨ペアのシンボルもチャートもありません。リンクhttps://www.metatrader5.com/ru/news/1372 には、MT5はFXCMのクォートでカスタマイズされていると書いてあります

. どこから始めればいいのか、どの証券会社がFXCMクォートを使っているのか教えてください。


FXCMで取引したい場合、パンフレットをダウンロードして、ここのように作る必要があります。



ご回答をよろしくお願いします...

 

WinAPI関数 'GetLastError' からコードを取得する方法は?WinAPI関数DeleteFileWで、存在しないファイルを削除したい。

DeleteFileWの ヘルプによると、もし

... приложение пытается удалить несуществующий файл, функция DeleteFile завершается с ошибкой ERROR_FILE_NOT_FOUND. Если файл доступен только для чтения, функция завершается с ошибкой ERROR_ACCESS_DENIED

コード説明 'ERROR_FILE_NOT_FOUND

error_file_not_found

2 (0x2)

指定されたファイルはシステムで見つけることができません。


つまり、存在しないファイルを削除しようとすると「2」が表示されるはずなのですが、「0」が表示されるのです。


私のスクリプトコード

//+------------------------------------------------------------------+
//|                                                   DeleteFile.mq5 |
//|                              Copyright © 2022, Vladimir Karputov |
//|                      https://www.mql5.com/en/users/barabashkakvn |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2022, Vladimir Karputov"
#property link      "https://www.mql5.com/en/users/barabashkakvn"
#property version   "1.00"
#property script_show_inputs
#include <WinAPI\errhandlingapi.mqh>
#include <WinAPI\fileapi.mqh>
//--- input parameters
input string   InpFileName="C:\\123.txt";
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   ResetLastError();
   int result=DeleteFileW(InpFileName);
   uint res=GetLastError();
   if(result==0)
      PrintFormat("DeleteFile failed (%d)",res);
   else
      PrintFormat("DeleteFile OK (%d)",res);
  }
//+------------------------------------------------------------------+

実行結果です。

DeleteFile failed (0)
ファイル:
 
良い午後は、詐欺師のトリックに巻き込まれた私にMT5で彼らの方向で登録を渡さアカウントは***で登録されたお金を堆積させ、少し稼ぎを与えた、私は登録を渡さなかったが、サポートに手紙を書いた、私は何をすべきか、彼らのお金を撤回する方法をアドバイスしてくださいブローカーのサイト
 
val511 #:
こんにちは、アドバイス、私は詐欺師のトリックに落ちてしまった。 私は彼らが指示したようにMT5で登録しましたが、私は***で口座を登録し、私はいくつかのお金を作った、今私はお金を撤回することはできません。 私はブローカーのウェブサイトに登録していない、私はサポートにメールを送った、私は何をすべきか、私のお金を引き出す方法私に助言してください。

MQL5.comは、ブローカーとは一切関係ありません。MQL5.comのサポートは、お客様がこのウェブサイトのMQL5アカウント(val511 )に入金した場合のみ回答できます。

 
なるほど、何かアドバイスをいただけるかもしれませんね。 ぜひお願いします。
 
val511 #:
なるほど、そんな私に何かアドバイスがあれば、とてもありがたいです。

警察への供述書を書く。

理由: