I created a trading algorithm which I want to sell. People would be able to buy the "bot" at my website and it would run from there on (if this is even safe to do).

What is the best way to secure my algorithm its code? I created it in Javascript so if I run it straight on the website itself people could just F12 and see my code. I want to make it at least hard for hackers to steal my algorithm since I know that as good as everything is hackable but just not very easy.

I've been thinking of running my bot on a different server, from there all the trading for all accounts would be made. When bought or sold it would send my website a message with "buy" or "sell" so I could show users the bot bought etc. Is this a safe way?

  • If your algorithm is truly novel, then you may want to consider applying for a patent to protect it.
    – mti2935
    Oct 29, 2020 at 13:06
  • I understand, but what if someone steals the algorithm and runs it on its personal computer? In such case no one can know he actually stole my algorithm and the person can just trade without paying. Is the standard copyright on code not enough btw?
    – Allart
    Oct 29, 2020 at 13:12
  • So, what do you want to protect against? You don't want people to use it even once without your express control?
    – schroeder
    Oct 29, 2020 at 13:26
  • Against people that could reuse my algorithm. Yes, if they could use it without buying it at my website then my website would be basicly useless right? Sorry if im unclear :(
    – Allart
    Oct 29, 2020 at 13:44
  • <Slightly-tongue-in-cheek> If the algorithm's any good, why sell it? Why not just use it yourself to make money that way? If it's not any good, why would people buy it? </Slightly-tongue-in-cheek> As schroeder says in a comment to their answer, the only real way to protect the algorithm is to run it on your servers (or ones under your control) and not in JS within users browsers.
    – TripeHound
    Oct 29, 2020 at 15:38

1 Answer 1


Anything you hand to someone can be cracked, known, and ultimately under their control. You can try to make it difficult to understand or use, but that will ultimately fail.

So, you need to change your business model to retain control over the process, or not care if someone uses it without your permission.

  • So how should I retain control of such a process? Could you maybe share a link with such information if there is one?
    – Allart
    Oct 29, 2020 at 13:19
  • 1
    You run the algorithm on a system you control. I'm not sure what link you need for that concept.
    – schroeder
    Oct 29, 2020 at 13:25
  • @Allart Have a look at other businesses that offer similar things and see how they secure things. You will find that you simply cannot control how people do things. Once it becomes known how your algorithm works, people can simply copy it.
    – user163495
    Oct 29, 2020 at 13:29
  • @MechMK1 Hmmm, that sucks xD. Schroeder, I was searching for something like this. But I know enough for now, ty guys.
    – Allart
    Oct 29, 2020 at 13:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .