초보자의 질문 MQL5 MT5 MetaTrader 5 - 페이지 909

 
Vladimir Karputov :

코드를 올바르게 붙여넣으십시오 . 이미 한 번 수정하고 코드를 올바르게 삽입했는데 읽을 수 없는 bukoff 시트를 다시 삽입하는 이유는 무엇입니까?

스타일러를 거쳐

 
TYRBO :

안녕하세요 블라디미르님 자세히 알려주세요 수익률을 백분율로 계산하는 기능을 하고 있는데 거래량을 계산하고 싶은데 잘 안되네요 잘못된것 같아요 제가 이해한대로 필요합니다 아웃 방향으로 주문을 식별하고 그로부터 볼륨을 계산합니다.

그건 그렇고, 얼마나 많이 거래되었는지 알아보기 위해 닫힌 위치의 수에도 문제가 있습니다.

네 번째로 코드를 올바르게 삽입했습니다. 저녁은 나른하지 않습니다!

 
TYRBO :

스타일러를 거쳐

왜 영장이 필요합니까? 거래와 함께 일하십시오.

 
Vladimir Karputov :

왜 영장이 필요합니까? 거래와 함께 일하십시오.

내 두뇌가 어떻게 이미 끓고 있는지 설명하십시오

 
TYRBO :

내 두뇌가 어떻게 이미 끓고 있는지 설명하십시오

코드는 from_date 부터 to_date 까지의 시간 간격으로 거래를 선택합니다.

 //+------------------------------------------------------------------+
//|                                         HistoryDealGetTicket.mq5 |
//|                         Copyright © 2016-2017, Vladimir Karputov |
//|                                           http://wmua.ru/slesar/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2016-2017, Vladimir Karputov"
#property link        "http://wmua.ru/slesar/"
#property version    "1.004"
#property script_show_inputs
//---
input datetime from_date= D'2017.02.07 11:11:00' ;
input datetime to_date= D'2019.09.20 11:40:00' ;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart ()
  {
   ulong     deal_ticket;             // ticket deal 
   ulong     order_ticket;           // deal order number
   datetime deal_transaction_time;   // deal time  
   long      deal_type;               // deal type
   long      deal_entry;             // deal entry - entry in, entry out, reverse
   long      deal_position_ID;       // identifier of a position, in the opening, modification or closing of which this deal took part
   string    deal_description;       // string to form description 
   double    deal_volume;             // deal volume 
   double    deal_commission;         // deal commission
   double    deal_swap;               // cumulative swap on close
   double    deal_profit;             // deal profit
   string    deal_symbol;             // deal symbol
//--- request trade history 
   HistorySelect (from_date,to_date);
//--- number of deal in history
   int deals= HistoryDealsTotal ();
//--- for all deals 
   for ( int i= 0 ;i<deals;i++)
     {
      deal_ticket          = HistoryDealGetTicket (i);
      deal_volume          = HistoryDealGetDouble (deal_ticket, DEAL_VOLUME );
      deal_commission      = HistoryDealGetDouble (deal_ticket, DEAL_COMMISSION );
      deal_swap            = HistoryDealGetDouble (deal_ticket, DEAL_SWAP );
      deal_profit          = HistoryDealGetDouble (deal_ticket, DEAL_PROFIT );
      deal_transaction_time= ( datetime ) HistoryDealGetInteger (deal_ticket, DEAL_TIME );
      order_ticket         = HistoryDealGetInteger (deal_ticket, DEAL_ORDER );
      deal_type            = HistoryDealGetInteger (deal_ticket, DEAL_TYPE );
      deal_entry           = HistoryDealGetInteger (deal_ticket, DEAL_ENTRY );
      deal_symbol          = HistoryDealGetString (deal_ticket, DEAL_SYMBOL );
      deal_position_ID     = HistoryDealGetInteger (deal_ticket, DEAL_POSITION_ID );
      deal_description=GetDealDescription(deal_entry,deal_type,deal_volume,deal_commission,
                                          deal_swap,deal_profit,deal_symbol,order_ticket,deal_position_ID);
       //--- make beautiful formatting for number of the deal
       string print_index= StringFormat ( "% 3d" ,i);
       //--- output information on the deal
       Print (print_index+ ": deal #" ,deal_ticket, " at " ,deal_transaction_time, " " ,deal_description);
     }
  }
//+------------------------------------------------------------------+ 
//| Returns the line description of operation                        | 
//+------------------------------------------------------------------+ 
string GetDealDescription( const long entry, const long type, const double volume, const double commission,
                           const double swap, const double profit, const string symbol, const long ticket, const long pos_ID)
  {
   string descr;                           // description
//---
   switch (( int )entry)
     {
       case DEAL_ENTRY_IN :     descr= "Entry in, " ; break ;
       case DEAL_ENTRY_OUT :    descr= "Entry out, " ; break ;
       case DEAL_ENTRY_INOUT :  descr= "Reverse, " ; break ;
       case DEAL_ENTRY_OUT_BY : descr= "Сlose a position by an opposite one, " ; break ;
     }
//--- 
   switch (( int )type)
     {
       case DEAL_TYPE_BALANCE :                  descr+= "\"balance\"" ; break ;
       case DEAL_TYPE_CREDIT :                   descr+= "\"credit\"" ; break ;
       case DEAL_TYPE_CHARGE :                   descr+= "\"charge\"" ; break ;
       case DEAL_TYPE_CORRECTION :               descr+= "\"correction\"" ; break ;
       case DEAL_TYPE_BUY :                      descr+= "buy" ; break ;
       case DEAL_TYPE_SELL :                     descr+= "sell" ; break ;
       case DEAL_TYPE_BONUS :                    descr+= "\"bonus\"" ; break ;
       case DEAL_TYPE_COMMISSION :               descr+= "\"additional commission\"" ; break ;
       case DEAL_TYPE_COMMISSION_DAILY :         descr+= "\"daily commission\"" ; break ;
       case DEAL_TYPE_COMMISSION_MONTHLY :       descr+= "\"monthly commission\"" ; break ;
       case DEAL_TYPE_COMMISSION_AGENT_DAILY :   descr+= "\"daily agent commission\"" ; break ;
       case DEAL_TYPE_COMMISSION_AGENT_MONTHLY : descr+= "\"monthly agent commission\"" ; break ;
       case DEAL_TYPE_INTEREST :                 descr+= "\"interest rate\"" ; break ;
       case DEAL_TYPE_BUY_CANCELED :             descr+= "cancelled buy deal\"" ; break ;
       case DEAL_TYPE_SELL_CANCELED :            descr+= "cancelled sell deal\"" ; break ;
     }
   descr= StringFormat ( "%s vol: %G comm: %G swap: %G profit: %G %s (order #%d, position ID %d)" ,
                      descr,     // description
                      volume,     // deal volume  
                      commission, // deal commission
                      swap,       // cumulative swap on close
                      profit,     // deal profit
                      symbol,     // deal symbol
                      ticket,     // deal order number
                      pos_ID     // identifier of a position, in the opening, modification or closing of which this deal took part
                      );
   return (descr);
//--- 
  }
//+------------------------------------------------------------------+

각 거래에 대한 정보를 수신합니다.

      deal_ticket          = HistoryDealGetTicket (i);
      deal_volume          = HistoryDealGetDouble (deal_ticket, DEAL_VOLUME );
      deal_commission      = HistoryDealGetDouble (deal_ticket, DEAL_COMMISSION );
      deal_swap            = HistoryDealGetDouble (deal_ticket, DEAL_SWAP );
      deal_profit          = HistoryDealGetDouble (deal_ticket, DEAL_PROFIT );
      deal_transaction_time= ( datetime ) HistoryDealGetInteger (deal_ticket, DEAL_TIME );
      order_ticket         = HistoryDealGetInteger (deal_ticket, DEAL_ORDER );
      deal_type            = HistoryDealGetInteger (deal_ticket, DEAL_TYPE );
      deal_entry           = HistoryDealGetInteger (deal_ticket, DEAL_ENTRY );
      deal_symbol          = HistoryDealGetString (deal_ticket, DEAL_SYMBOL );
      deal_position_ID     = HistoryDealGetInteger (deal_ticket, DEAL_POSITION_ID );

그런 다음 전체를 인쇄합니다.


질문이있을 것입니다-월요일에 물어보십시오. 이제 나는 자려고합니다 ...

파일:
 

좋은 저녁이에요!

상황을 명확히 해주세요.

나는 역사 테스터가 있는데, 어느 시점에서 다음과 같은 일이 일어납니다.

포지션이 있는데 수량 * 가격을 곱하면 3900과는 거리가 멉니다! 내가 올바르게 이해하지 못하는 것은 무엇입니까?

 

여기에 또 다른 혼란이 있습니다.

뭐가 잘못됐는지 정말 이해가 안 가요?

 
어깨가 없습니다.
 

좋은 아침 포럼 사용자 !!!

나는 내 질문에 도움을 요청합니다. 머리는 이미 운전 중입니다. 어디에서 무언가를 따라 잡고 있지 않습니까?

 

오랫동안 아무것도 최적화하지 않았습니다

결과 열이 무엇을 의미하는지 알려주실 수 있습니까? 나는 생각할 수 없다

10,000을 사용한 테스트는


사유: