MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Source code library - Expert Advisors, Indicators and Scripts

Screenshot
USDJPY, M1
Demo
William Blau's Indicators and Trading Systems in MQL5. Part 1: Indicators William Blau's Indicators and Trading Systems in MQL5. Part... MTF Average True RangeMTF Average True Range Try product
MTF Average True Range
Author: VincentX
Subscribe to signal
Teletrade Signals
21.21%, 31 500.37 USD
Dual_Trix_Upgrade2 Indicator
Dual_Trix_Upgrade2
Author: q_import
To post a new code, please log in or register

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal

2012.08.12 16:44
ResultRetcodeDescription

ResultRetcodeDescription [ru]

GODZILLA

Downloads:
101
Views:
503
Rating:
votes: 7
Files:


Real Author:

MetaQuotes

Description:

This simple function returns a string of decrypted code of the trade operation result from MqlTradeCheckResult after executing the OrderCheck() function:

   MqlTradeCheckResult check;

//---- Checking for correctness of trade request
   if(!OrderCheck(request,check))
     {
      Print(__FUNCTION__,"(): OrderCheck(): ",ResultRetcodeDescription(check.retcode));
      return(false);
     }

Alternatively, it can return a string from MqlTradeResult after executing the OrderSend() function: 

  MqlTradeCheckResult check;

  word=__FUNCTION__+"(): OrderSend(): ";

//---- Open a BUY position and check the trade request result
   if(!OrderSend(request,result) || result.retcode!=TRADE_RETCODE_DONE) Print(ResultRetcodeDescription(result.retcode));
   else if(result.retcode==TRADE_RETCODE_DONE) Print("Buy position for ",Symbol()," is open!");
   else Print("Failed to open a Buy position for ",Symbol(),"!!!");

 The function uses the library ResultRetcodeDescription.mqh (to be copied into the terminal_data_directory\MQL5\Include) the contents of which should be included in the developed code using the #include directive prior to using the function at the global level:

 

#include <ResultRetcodeDescription.mqh>

Translated from Russian by MetaQuotes Software Corp.
Original code: http://www.mql5.com/ru/code/960