License solution for algo providers
Forums › ProRealTime English forum › General trading discussions › License solution for algo providers
- This topic has 3 replies, 3 voices, and was last updated 1 year ago by Nicolas.
-
-
08/17/2021 at 8:32 AM #175510I have been thinking a bit about how much work it has to be to compile uniqe algos/indicators for each customer every time you rent something out.When only renting out a few algos to a few customers it is manageable, but when you have alot of algos and alot of customers you would have to spend wast time and energy to modify indicators and set valid-to-dates for each customer.Since PRT doesnt have a built in way to handle this i thought of a better way, a way that we can code ourselves to handle this. So i wrote up this code today that I think handles the problem in quite a neat way.Basically you can keep publishing the strategy with open code.You then implement, in each indicator that you want to rent out, a simple checksum generator.So, you compile the indicators that you want to rent out with hidden code but not limited to single import.These indicators you can publish for everyone to download on a website for example.Then, for each customer that rents an algo from you, you compile a user uniqe “Licence-indicator” with the algos that this customer payed for, and the date up until this should be valid.This “Licence-indicator” is compiled with hidden code and limited to a single import.The “Licence-indicator” has the same generator-code as all the indicators you have published, so what an indicator does is that it calls this “Licence-indicator” that checks if the customer has acces to this algo during this date.If they do, it returns a checksum (generated by generator-code) and the indicator can, with the same code, verify that this actually is a valid checksum.This would mean that when renting out algos, you dont have to compile multiple indicators for each customer, you simply compile one “Licence-indicator” for each customer.I havent been able to debunk this myself, so I turn to you guys to “crack” this system.Strategy1234567891011121314//This is the strategy file that takes all the trades//This file is "compiled" completely open code so that users can fiddle with pos-size and SL/TS/TP//This can be published on a website for example, but if the user doesnt have a valid licence file it wont trigger any signalsDEFPARAM CUMULATEORDERS = FalseTradeSignal = CALL "License Test - Indicator"(close)If TradeSignal ThenBuy 1 Contract At MarketSET STOP LOSS 10SET TARGET PPROFIT 10EndIfThe secret indicator you rent out that triggers trades12345678910111213141516171819202122232425262728293031323334353637383940//This is the Indicator file that contains all conditions to trigger a trade//The file is "compiled" copy protected with the code hidden, but NOT locked for single import//This can be published on a website for example, but if the user doesnt have a valid licence file it wont trigger any signals//The uniqe AlgoNo int for each published algoThisAlgoNo = 3//Check that the user has a License file valid for this date and for this algo//This code is the same in all published indicatorsChecksum = CALL "License Test - License"[ThisAlgoNo](close)//This is where the publisher inserts its own uniqe checksum generator code.//This code is the same in the licence file and in each published indicator, but only the publisher knows this "code"Generator = Average[3] / ThisAlgoNo + Date / (Average[7] / ThisAlgoNo) * RSI[11]If Checksum = Generator ThenLicenseIsValid = 1ElseLicenseIsValid = 0EndIf//Your normal indicator business, finding triggers and filtering trends....If Average[8] Crosses Over Average[20] ThenTradeSignal = 1ElseTradeSignal = 0EndIf//You return the signals to the strategy if LicenseIsValid, else return 0If Not LicenseIsValid ThenTradeSignal = 0EndIfReturn TradeSignalThis is the license file you compile for each customer12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455//This is the License-file that is made uniqe for each paying customer//The file is "compiled" copy protected with the code hidden AND locked for single import//Settings to change for each customer depending on purchaseValidUntil = 20211201 //Do not return a valid checksum after this date$ValidForAlgo[0] = 3 //Algos (each algo gets a uniqe int) that the customer payed for (99 = All algos)$ValidForAlgo[1] = 7 //...$ValidForAlgo[2] = 13 //...$ValidForAlgo[3] = 19 //...$ValidForAlgo[4] = 21 //...//Check that licence is valid at this dateIsValidUntil = Date < ValidUntil//Reset IsValidForAlgo each timeIsValidForAlgo = 0i = 0//Set IsValidForAlgo to 1 if AlgoNo (from indicator) is in the $ValidForAlgo arrayWhile ISSET($ValidForAlgo[i])If $ValidForAlgo[i] = AlgoNo ThenIsValidForAlgo = 1EndIfi = i + 1Wend//If $ValidForAlgo[0] = 99 then the customer payd for all algosIf $ValidForAlgo[0] = 99 ThenIsValidForAlgo = 1EndIf//The licence file is valid this date and for this algo, calculate and return correct checksum to incicator//If the licence file is not valid, Checksum = 0 is returnedChecksum = 0If IsValidUntil And IsValidForAlgo Then//This is the checksum generator if the licence is valid, the same code is used as a de-generator in the indicator to verify that//the licence file has "approved" the indicator at a specific time, this can be modified how ever you like, as long as the generator//is the same in the License file and in the indicator, and that it implements AlgoNo that is hard coded in the indicator//The generator should be advanced enough to not be able to reverse-engineerChecksum = Average[3] / AlgoNo + Date / (Average[7] / AlgoNo) * RSI[11]//In the indicator the checksum is verified with the same code, for example in algo no 15 the code would be//Checksum = CALL "License Test - License"[15](close)//Generator = Average[3] / 15 + Date / (Average[7] / 15) * RSI[11]//If Checksum = Generator Then//LicenseIsValid = 1//Else//LicenseIsValid = 0//EndIfEndIfReturn Checksum08/17/2021 at 10:13 AM #175519
Thanks for sharing and for the idea and the code.
For the record, to save you time generating exports, managing licenses, expirations and customers, the marketplace solution is IMO the best solution.
In addition to providing you with an ultra-secure licensing system (and integrated in ProRealTime), with an automatic process, the marketplace also allows you to generate trials, manage subscriptions with recurring payments, automatic update management for all your customers, a support ticket tool, etc.
I can help you in the process of putting your shop online, contact me directly: market@prorealcode.com or visit https://market.prorealcode.com and register as a seller 🙂12/08/2023 at 9:16 AM #225040Hi! With this solution, is it possible to manage licenses, subscriptions and so on and still sell your algos of marketplace, for example at your own website? Or are these tools limited to only sell your algos at the marketplace?
12/08/2023 at 9:19 AM #225041Hi, to benefit from our services, your products must be hosted on https://market.prorealcode.com 🙂
-
AuthorPosts