Download MetaTrader 5
To add comments, please log in or register
Having troubles understanding the code? Articles can help you!
Thousand
10
Thousand 2014.03.20 19:46 

hi guys,

Is there any way to select and check total profit / loss of last 3 opened orders ?

thanx for your help.

qjol
3243
qjol 2014.03.20 19:54  
of course
Thousand
10
Thousand 2014.03.20 20:44  
qjol:
of course

is thats how you made 2160 posts ?
qjol
3243
qjol 2014.03.20 21:15  
qjol
3243
qjol 2014.03.21 11:30  

no one ?

//+------------------------------------------------------------------+
//|                                         last 3 orders profit.mq4 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"

//---
#define READURL_BUFFER_SIZE   100

#import  "Wininet.dll"
   int InternetOpenW(string, int, string, string, int);
   int InternetConnectW(int, string, int, string, string, int, int, int); 
   int HttpOpenRequestW(int, string, string, int, string, int, string, int); 
   int InternetOpenUrlW(int, string, string, int, int, int);
   int InternetReadFile(int, uchar & arr[], int, int& OneInt[]);
   int InternetCloseHandle(int); 
#import
#import "shell32.dll"
   int ShellExecuteW(int hWnd, string Verb, string File, string Parameter, string Path, int ShowCommand);
#import
//---
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   int HttpOpen = InternetOpenW(" ", 0, " ", " ", 0); 
   int HttpConnect = InternetConnectW(HttpOpen, "", 80, "", "", 3, 0, 1); 
   int HttpRequest = InternetOpenUrlW(HttpOpen, "https://www.google.com/search?q=last+3+orders+profit+site%3Amql4.com", NULL, 0, 0, 0);
   
   int read[1];
   uchar  Buffer[];
   ArrayResize(Buffer, READURL_BUFFER_SIZE + 1);
   string page = "";
   while (true)
      {
      InternetReadFile(HttpRequest, Buffer, READURL_BUFFER_SIZE, read);
      string strThisRead = CharArrayToString(Buffer, 0, read[0], CP_UTF8);
      if (read[0] > 0)
         page = page + strThisRead;
      else
      break;
      }
   
   if (HttpRequest > 0) InternetCloseHandle(HttpRequest); 
   if (HttpConnect > 0) InternetCloseHandle(HttpConnect); 
   if (HttpOpen > 0) InternetCloseHandle(HttpOpen);  
   int filehandle=FileOpen("searchgoog.html",FILE_WRITE|FILE_READ|FILE_ANSI|FILE_REWRITE|FILE_SHARE_READ|FILE_SHARE_WRITE);
   FileWrite(filehandle,page);
   FileClose(filehandle);
   string file_src_path = TerminalPath()+"\mql4\\files\\searchgoog.html";
   ShellExecuteW(0, "Open",file_src_path, 0 , "", 0);
   
  }
//---

whroeder1
13627
whroeder1 2014.03.21 13:08  
TThousand: Is there any way to select and check total profit / loss of last 3 opened orders ?
Could EA Really Live By Order_History Alone? - MQL4 forum
/
To add comments, please log in or register