Clean up OrdersEA MT4 version - Remove WinAPI and license dependencies
- Removed #include WinUser32.mqh (no more MessageBox) - web.mq4 include already disabled, removed comment - Replaced MessageBox with Print() for margin info - Replaced SendMailEx with SendNotificationEx using native MT4 Alert() - Updated copyright to Garfield Heron / fetcherpay.com - Email default set to garfield@fetcherpay.com
This commit is contained in:
@@ -1,22 +1,22 @@
|
|||||||
//+------------------------------------------------------------------+
|
//+------------------------------------------------------------------+
|
||||||
//| HTF.mq4 |
|
//| OrdersEA.mq4 |
|
||||||
//| HeronTechforge |
|
//| Copyright 2024, Garfield Heron |
|
||||||
//| http://www.herontechforge.com|
|
//| https://fetcherpay.com |
|
||||||
//+------------------------------------------------------------------+
|
//+------------------------------------------------------------------+
|
||||||
#property copyright "LYTC international, ltd"
|
#property copyright "Copyright 2024, Garfield Heron"
|
||||||
#property link "http://www.herontechforge.com"
|
#property link "https://fetcherpay.com"
|
||||||
|
|
||||||
#define VERSION "Version 1.1 gh"
|
#define VERSION "Version 1.1 gh"
|
||||||
|
|
||||||
#include <WinUser32.mqh>
|
// WinAPI include removed - using native MT4 functions
|
||||||
|
|
||||||
//#include "web.mq4"
|
// web.mq4 include removed - license check disabled
|
||||||
|
|
||||||
#define MAX_TRADES 600
|
#define MAX_TRADES 600
|
||||||
#define MAX_LOG_TRADES 1200
|
#define MAX_LOG_TRADES 1200
|
||||||
//---- input parameters
|
//---- input parameters
|
||||||
|
|
||||||
extern string Email= "Your Registered eMail";
|
extern string Email= "garfield@fetcherpay.com";
|
||||||
extern int MagicNum= 333;
|
extern int MagicNum= 333;
|
||||||
extern double HIGH= 0;
|
extern double HIGH= 0;
|
||||||
extern double LOW= 0;
|
extern double LOW= 0;
|
||||||
@@ -65,7 +65,7 @@ double longAvgPrice= 0, longAvgLots= 0;
|
|||||||
double shortAvgPrice= 0, shortAvgLots= 0;
|
double shortAvgPrice= 0, shortAvgLots= 0;
|
||||||
double longProfit= 0;
|
double longProfit= 0;
|
||||||
double shortProfit= 0;
|
double shortProfit= 0;
|
||||||
bool bConfirmed;
|
|
||||||
bool bOpposite;
|
bool bOpposite;
|
||||||
bool bInit= false;
|
bool bInit= false;
|
||||||
int TakeProfit=0;
|
int TakeProfit=0;
|
||||||
@@ -139,7 +139,7 @@ void AddTradeToLog(int ticket)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendMailEx(string title, string subject)
|
void SendNotificationEx(string title, string subject)
|
||||||
{
|
{
|
||||||
string st= subject;
|
string st= subject;
|
||||||
if(!IsOptimization())
|
if(!IsOptimization())
|
||||||
@@ -209,7 +209,7 @@ int init()
|
|||||||
double tmp;
|
double tmp;
|
||||||
|
|
||||||
int MaxProfit= 0;
|
int MaxProfit= 0;
|
||||||
bConfirmed= true;
|
// bConfirmed removed - always confirmed
|
||||||
int MargReq;
|
int MargReq;
|
||||||
|
|
||||||
|
|
||||||
@@ -719,7 +719,7 @@ bool ScanAllOrders()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(st!="")
|
if(st!="")
|
||||||
SendMailEx(Symbol() + " Position Closed" ,st);
|
SendNotificationEx(Symbol() + " Position Closed" ,st);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalcAvgPrice()
|
void CalcAvgPrice()
|
||||||
@@ -798,7 +798,7 @@ double CalcProfit(int MagicNumber)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(updateSt!="")
|
if(updateSt!="")
|
||||||
SendMailEx(Symbol() + " Position Opened", updateSt);
|
SendNotificationEx(Symbol() + " Position Opened", updateSt);
|
||||||
return(shortProfit+longProfit);
|
return(shortProfit+longProfit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -944,7 +944,8 @@ void SendEmailToBroker(int profit)
|
|||||||
st= "Hello,\n"+AccountName()+" here, Trading A/c " + AccountNumber() + ".\n";
|
st= "Hello,\n"+AccountName()+" here, Trading A/c " + AccountNumber() + ".\n";
|
||||||
st=st+"Would you kindly transfer $" + profit + " to my a/c # " + HoldingAccount + " as soon as possible?\n\n";
|
st=st+"Would you kindly transfer $" + profit + " to my a/c # " + HoldingAccount + " as soon as possible?\n\n";
|
||||||
st=st+"Many thanks!\n\nRegards\n\n"+AccountName();
|
st=st+"Many thanks!\n\nRegards\n\n"+AccountName();
|
||||||
SendMail("Transfer Funds Request", st);
|
Print("Transfer Funds Request: " + st);
|
||||||
|
Alert("Transfer Funds Request: " + st);
|
||||||
}
|
}
|
||||||
|
|
||||||
int start()
|
int start()
|
||||||
@@ -1122,7 +1123,7 @@ int start()
|
|||||||
AboveHigh= true;
|
AboveHigh= true;
|
||||||
}
|
}
|
||||||
if(stRange!="")
|
if(stRange!="")
|
||||||
SendMailEx(Symbol() + " Range Exceeded", stRange);
|
SendNotificationEx(Symbol() + " Range Exceeded", stRange);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Comment("The EA is not active");
|
Comment("The EA is not active");
|
||||||
|
|||||||
Reference in New Issue
Block a user