📜 AXY Bot License Check – MT5 Version (Final) //+------------------------------------------------------------------+ //| AXY Bot License Check (MT5) | //| Integrates with Whop Software App for Validation | //+------------------------------------------------------------------+ #property strict // --- User Inputs --- input string LicenseKey = "PASTE-YOUR-WHOP-KEY"; // Buyer's Whop License Key // --- Whop API Details --- string apiUrl = "https://api.whop.com/api/v2/licenses/validate"; string apiToken = "IenZmm8yNng1jpwFY98ilFV5NFRviXsmfVpmlFcMCfY"; // Whop API Token bool licenseValid = false; //+------------------------------------------------------------------+ //| Check License Function | //+------------------------------------------------------------------+ bool CheckLicense() { string headers = "Authorization: Bearer " + apiToken + "\r\nContent-Type: application/json\r\n"; string result; char post[]; // JSON body with license key string body = "{ \"license_key\": \"" + LicenseKey + "\" }"; StringToCharArray(body, post); // Allow WebRequest for api.whop.com if(!WebRequest("POST", apiUrl, headers, 5000, post, result, NULL)) { Print("❌ WebRequest Failed: ", GetLastError()); return(false); } // Debug: print API response Print("Whop API Response: ", result); // Check if the license is valid if(StringFind(result, "\"valid\":true") != -1) return(true); return(false); } //+------------------------------------------------------------------+ //| Expert Initialization | //+------------------------------------------------------------------+ int OnInit() { if(CheckLicense()) { Print("✅ License validated. Welcome to AXY Bot."); licenseValid = true; } else { Alert("🚫 License invalid or expired. Contact support."); ExpertRemove(); // Stops the bot if license is invalid return(INIT_FAILED); } return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert Tick | //+------------------------------------------------------------------+ void OnTick() { if(!licenseValid) return; // --- Place your AXY Bot trading logic here --- } ________________ 📦 Instructions for Xavier – MT5 Setup 1. Duplicate Your Bot * Open MetaEditor in MT5. * Find your current AXY Bot .mq5 file. File → Save As → Name it: AXY_Bot_MT5_Licensed.mq5 * ________________ 2. Add the License Code * Copy all the code above. * Paste it at the very top of your duplicated bot file. * Keep your trading logic inside OnTick() where marked. ________________ 3. Enable WebRequests in MT5 * Go to Tools → Options → Expert Advisors. * Tick "Allow WebRequest for listed URL". Add: https://api.whop.com * ________________ 4. Compile * Press F7 in MetaEditor to compile. * MT5 will generate a .ex5 file — this is the file you send to buyers. ________________ 5. Test * Attach the bot to a chart in a demo account. * Enter a valid Whop license key in the LicenseKey input when attaching. * If valid → bot runs. * If invalid → bot stops with alert.