muhammadalidhedhi
Member
- Credits
- 0
Hi guys,
I want some expiry coding with special condition like
If expiry is invalid and license key is valid than ea should not work
for example if ea is running on demo account and expiry is not valid than ea should not work and same goes for live account
these are the coding of ea for license and i want to add expiry coding like i have explained above to link with that expiry coding like ea will work if both condition meet
no.1 condition should be expiry if expiry is invalid than ea should not even if license key is valid on demo or live condition
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
if(LicenseVerification())
{
return (INIT_SUCCEEDED);
}
else
{
return (INIT_FAILED);
}
//---
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
bool LicenseVerification()
{
if(AccountNumber()==0)
{
Alert("Seems You are not Connected to Internet. License Key verification Failed");
return (false);
}
if(IsDemo()==true)
{
return (true);
}
/*** Login Key Generation Formula ***/
int key=3*(StringToInteger(StringSubstr(IntegerToString(AccountNumber()), 0, 3)))+333333;
if(LicenseKey==0)
{
Alert("Please Enter Your License Key in Inputs Section.");
return (false);
}
if(LicenseKey==key)
{
Alert("License Key Verified");
return (true);
}
else
{
Alert("Invalid License Key, Enter Correct License Key");
return (false);
}
}
//+------------------------------------------------------------------+
I want some expiry coding with special condition like
If expiry is invalid and license key is valid than ea should not work
for example if ea is running on demo account and expiry is not valid than ea should not work and same goes for live account
these are the coding of ea for license and i want to add expiry coding like i have explained above to link with that expiry coding like ea will work if both condition meet
no.1 condition should be expiry if expiry is invalid than ea should not even if license key is valid on demo or live condition
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
if(LicenseVerification())
{
return (INIT_SUCCEEDED);
}
else
{
return (INIT_FAILED);
}
//---
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
bool LicenseVerification()
{
if(AccountNumber()==0)
{
Alert("Seems You are not Connected to Internet. License Key verification Failed");
return (false);
}
if(IsDemo()==true)
{
return (true);
}
/*** Login Key Generation Formula ***/
int key=3*(StringToInteger(StringSubstr(IntegerToString(AccountNumber()), 0, 3)))+333333;
if(LicenseKey==0)
{
Alert("Please Enter Your License Key in Inputs Section.");
return (false);
}
if(LicenseKey==key)
{
Alert("License Key Verified");
return (true);
}
else
{
Alert("Invalid License Key, Enter Correct License Key");
return (false);
}
}
//+------------------------------------------------------------------+