Sign Up
Zouein Family helps you connect and share with the people in your life.

Securing your EA

Use this code to allow the EA to only run in backtesting:

//+---------------------------------------------------- --------------+
//|Backtesting only lock function by NickZouein
//+---------------------------------------------------- --------------+
int OnInit()
{
if(!IsTesting())
{
Alert("EA is for backtesting only! -Expert removed- www.GegaTrade.com");
Comment("THIS EA WORKS ONLY IN STRATEGY TESTER!!!");
ExpertRemove();
return(0);
}

======================================================= ========================

Use this code for locking your EA to certain account numbers:
int OnInit()
{
//+---------------------------------------------------- --------------+
//|Multi Account numbers lock function by NickZouein
//+---------------------------------------------------- --------------+
if ((AccountNumber()==2777846) ||
(AccountNumber()==2100038456) ||
(AccountNumber()==2774747) ||
(AccountNumber()==2766240) ||
(AccountNumber()==317227) ||
(AccountNumber()==2768451) ||
(AccountNumber()==315341) ||
(AccountNumber()==2775831) ||
(AccountNumber()==315457) ||
(AccountNumber()==2784772) ||
(AccountNumber()==7203319)
// (AccountNumber()==608684)//My account
)
{
return(false);
}
else
{
Alert("Wrong Account! -Expert removed- www.GegaTrade.com");
Comment("WRONG ACCOUNT NUMBER!!!");
ExpertRemove();
return(true);
}

======================================================= ================

Use this code for date expiry in EA's:
string ExpiryDate="2016.04.15";
//+---------------------------------------------------- --------------+
//| Expert initialization function |
//+---------------------------------------------------- --------------+
int OnInit()
{
if(TimeCurrent() > StrToTime(ExpiryDate)|| TimeLocal() > StrToTime(ExpiryDate))
{
Alert("Trial expired. nick@zouein.com for new version");
ExpertRemove();
return(0);
}

======================================================= ==================================
string ExpiryDate="2016.04.15";
//+---------------------------------------------------- --------------+
//| Expert initialization function |
//+---------------------------------------------------- --------------+
int OnInit()
{
if(TimeCurrent() >= StrToTime(ExpiryDate))
{
Alert("Trial expired. nick@zouein.com for new version");
return(0);
}
else
{
Print(" Indicator Valid");
}


if(Digits==3 || Digits==5)
pip=10*_Point;
else
pip=_Point;

if( (Buy_LS_Method == ELS_BALANCE) && (Buy_LS_Balance <= 0.0) )
{
Alert("Lot Size % of Bla bla bla.....
...
...
void OnTick()
{

if(TimeCurrent() >= StrToTime(ExpiryDate))
{
Alert("Trial expired. nick@zouein.com for new version");
return;
}
else
{
Print(" Indicator Valid");
}


if(Buy_Enabled)SeqBuy();
if(Sell_Enabled)SeqSell();
} ...
...
...
Last update on January 29, 9:06 am by Nicolas Zouein.
All times are GMT +3. The time now is 10:16 am.