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

 
Aleksandr Egorov:

もう読んじゃえよ )

私も今調べました。2011年の記事ですが...なによりも、「全ティック」モードでのティックの生成方法についての解説があります。そして、「本物のティックをベースにした」ということが、それを物語っています。そこが違うんです。

 
テスターについて質問です。

ビジュアライゼーションモードでは、プリントは表示されません。これは想定内のことなのか、それとも私が何か間違ったことをしているのか?
 
みなさん、こんにちは!!!そして、明けましておめでとうございます!! プログラミングカーブは授業で取得しました。私は、#include/ChartObjectフォルダにクラスファイルを持っています。ChartObjectsLinesは、トレンドラインのクラスだけでなく、ラインとこれらのすべてのクラスのための他のクラスとコンストラクタを含んでいます。 そしてここで質問があります、その答えは私が見つけていない、それは一つのクラスで多くのクラスとこれらのクラスのためのコンストラクタになることが判明していますか?
 
そしてもう一つの質問)) グラフウィンドウのX / Y座標から価格と日付を得るにはどうしたらいいのでしょうか?
 
Kira27:
そしてもう一つの質問))) グラフウィンドウのX / Y座標から価格と日付を取得するにはどうすればいいのでしょうか?

https://www.mql5.com/ru/docs/chart_operations/charttimepricetoxy

https://www.mql5.com/ru/docs/chart_operations/chartxytotimeprice

Документация по MQL5: Операции с графиками / ChartTimePriceToXY
Документация по MQL5: Операции с графиками / ChartTimePriceToXY
  • www.mql5.com
ChartTimePriceToXY - Операции с графиками - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
私は別の質問を持っている))ただ、マニュアルを読むために私を送信しないでください、私はそれを複数回読んだが、私はまだクラスのすべてを理解していない)TrailingParabolicSAR.mqhというフォルダExpertTrailingGenにあるパラボリックSAR用のクラスタイリングストップがあります それが困難ではない場合は、それを操作する方法を教えてください。例題を通してよりよく理解することができました))) 回答してくださった方、ありがとうございました))
//+------------------------------------------------------------------+
//|                                         TrailingParabolicSAR.mqh |
//|                   Copyright 2009-2013, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#include <Expert\ExpertTrailing.mqh>
// wizard description start
//+------------------------------------------------------------------+
//| Description of the class                                         |
//| Title=Trailing Stop based on Parabolic SAR                       |
//| Type=Trailing                                                    |
//| Name=ParabolicSAR                                                |
//| Class=CTrailingPSAR                                              |
//| Page=                                                            |
//| Parameter=Step,double,0.02,Speed increment                       |
//| Parameter=Maximum,double,0.2,Maximum rate                        |
//+------------------------------------------------------------------+
// wizard description end
//+------------------------------------------------------------------+
//| Class CTrailingPSAR.                                             |
//| Appointment: Class traling stops with Parabolic SAR.             |
//| Derives from class CExpertTrailing.                              |
//+------------------------------------------------------------------+
class CTrailingPSAR : public CExpertTrailing
  {
protected:
   CiSAR             m_sar;            // object-indicator
   //--- adjusted parameters
   double            m_step;           // the "speed increment" parameter of the indicator
   double            m_maximum;        // the "maximum rate" parameter of the indicator

public:
                     CTrailingPSAR(void);
                    ~CTrailingPSAR(void);
   //--- methods of setting adjustable parameters
   void              Step(double step)       { m_step=step;       }
   void              Maximum(double maximum) { m_maximum=maximum; }
   //--- method of creating the indicator and timeseries
   virtual bool      InitIndicators(CIndicators *indicators);
   //---
   virtual bool      CheckTrailingStopLong(CPositionInfo *position,double &sl,double &tp);
   virtual bool      CheckTrailingStopShort(CPositionInfo *position,double &sl,double &tp);
  };
//+------------------------------------------------------------------+
//| Constructor                                                      |
//+------------------------------------------------------------------+
void CTrailingPSAR::CTrailingPSAR(void) : m_step(0.02),
                                          m_maximum(0.2)

  {
  }
//+------------------------------------------------------------------+
//| Destructor                                                       |
//+------------------------------------------------------------------+
void CTrailingPSAR::~CTrailingPSAR(void)
  {
  }
//+------------------------------------------------------------------+
//| Create indicators.                                               |
//+------------------------------------------------------------------+
bool CTrailingPSAR::InitIndicators(CIndicators *indicators)
  {
//--- check pointer
   if(indicators==NULL)
      return(false);
//--- add object to collection
   if(!indicators.Add(GetPointer(m_sar)))
     {
      printf(__FUNCTION__+": error adding object");
      return(false);
     }
//--- initialize object
   if(!m_sar.Create(m_symbol.Name(),m_period,m_step,m_maximum))
     {
      printf(__FUNCTION__+": error initializing object");
      return(false);
     }
//--- ok
   return(true);
  }
//+------------------------------------------------------------------+
//| Checking trailing stop and/or profit for long position.          |
//+------------------------------------------------------------------+
bool CTrailingPSAR::CheckTrailingStopLong(CPositionInfo *position,double &sl,double &tp)
  {
//--- check
   if(position==NULL)
      return(false);
//---
   double level =NormalizeDouble(m_symbol.Bid()-m_symbol.StopsLevel()*m_symbol.Point(),m_symbol.Digits());
   double new_sl=NormalizeDouble(m_sar.Main(1),m_symbol.Digits());
   double pos_sl=position.StopLoss();
   double base  =(pos_sl==0.0) ? position.PriceOpen() : pos_sl;
//---
   sl=EMPTY_VALUE;
   tp=EMPTY_VALUE;
   if(new_sl>base && new_sl<level)
      sl=new_sl;
//---
   return(sl!=EMPTY_VALUE);
  }
//+------------------------------------------------------------------+
//| Checking trailing stop and/or profit for short position.         |
//+------------------------------------------------------------------+
bool CTrailingPSAR::CheckTrailingStopShort(CPositionInfo *position,double &sl,double &tp)
  {
//--- check
   if(position==NULL)
      return(false);
//---
   double level =NormalizeDouble(m_symbol.Ask()+m_symbol.StopsLevel()*m_symbol.Point(),m_symbol.Digits());
   double new_sl=NormalizeDouble(m_sar.Main(1)+m_symbol.Spread()*m_symbol.Point(),m_symbol.Digits());
   double pos_sl=position.StopLoss();
   double base  =(pos_sl==0.0) ? position.PriceOpen() : pos_sl;
//---
   sl=EMPTY_VALUE;
   tp=EMPTY_VALUE;
   if(new_sl<base && new_sl>level)
      sl=new_sl;
//---
   return(sl!=EMPTY_VALUE);
  }
//+------------------------------------------------------------------+
 
Kira27:
I have another question)) Please don't send me to read instructions, I have read it many times, I still don't understand all classes) There is Trailing Stop for Parabolic SAR class, located in ExpertTrailing フォルダ and named TrailingParabolicSAR.mqh please tell me how to use it.例題を通してよりよく理解することができました))) 回答してくださった方、ありがとうございました))

使用例として、[dta folder]\MQL5-Experts-Advisors-ExpertMAPSAR.mq5 があります。

 
Vladimir Karputov:

使用例として、[dta folder]\MQL5-Experts-Advisors-ExpertMAPSAR.mq5 があります。

ありがとうございます!!!

 
User_mt5:
テスターについて質問です。ビジュアライゼーションモードでは、プリントは表示されません。これは想定内のことなのか、それとも私が何か間違ったことをしているのか?

誰も知らないと思います。
理由: