거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
라이브러리

HistoryPositionInfo - MetaTrader 5용 라이브러리

조회수:
3734
평가:
(22)
게시됨:
2017.03.22 16:09
\MQL5\Include\HistorySelect_\
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

The CHistoryPositionInfo class is designed for getting the profit of a position in points based on the trading history.

Class Description

The CHistoryPositionInfo class allows getting the profit of a position in points based on the trading history.

Declaration

class CHistoryPositionInfo : public CArrayObj

Title

#include <HistorySelect_\HistoryPositionInfo.mqh>

Class Methods by Groups

Initialization
InitInitialization using a position ID
Access to the calculation result  
GetProfitInPointsGetting the profit of a position in points
Setting parameters 
LogErrorsEnable/disable logging of errors
PrintDeals(const bool value) Enable/disable deal print mode
Printing deals 
PrintDeals(void)Printing the deals that formed the position

An example of using CHistoryPositionInfo:

//+------------------------------------------------------------------+
//|                                      TestHistoryPositionInfo.mq5 |
//|                              Copyright © 2017, Vladimir Karputov |
//|                                           http://wmua.ru/slesar/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2017, Vladimir Karputov"
#property link      "http://wmua.ru/slesar/"
#property version   "1.003"
#property script_show_inputs
//---
input long position_id=0;                    // position identifier - POSITION_IDENTIFIER 
input bool log_errors=true;                  // logging errors
input bool print_deals=true;                 // print deals
#include <HistorySelect_\HistoryPositionInfo.mqh>
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   Print("\nSearch deals with POSITION_IDENTIFIER ",IntegerToString(position_id));
   CHistoryPositionInfo HistoryPositionInfo;
//--- init position identifier
   HistoryPositionInfo.Init(position_id);
//--- los errors
   HistoryPositionInfo.LogErrors(log_errors);
//--- print deals
   HistoryPositionInfo.PrintDeals(print_deals);
//---
   double profit_in_points=0.0;
   if(HistoryPositionInfo.GetProfitInPoints(profit_in_points))
      Print("Profit in points ",DoubleToString(profit_in_points,1));
   else
      Print("GetProfitInPoints=false");
  }
//+------------------------------------------------------------------+

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/17622

TypePendingOrderTriggered TypePendingOrderTriggered

An example of determining the moment when a pending order has triggered.

XCCXCandleKeltner XCCXCandleKeltner

Keltner Channel built relative to the average value of the XCCX oscillator as a sequence of candlesticks

CDir (MT5) - a class for getting directory contents CDir (MT5) - a class for getting directory contents

The CDir class allows getting information about files and folders outside the MQL5 sandbox similar to the MS-DOS Dir command. Call of system DLL is used, therefore you should allow their use.

XRSXCandleKeltnerPluse XRSXCandleKeltnerPluse

The XRSXCandleKeltner indicator with the breakout indication option