Multiple Products in NinjaTrader

As I described in an earlier post, NinjaTrader runs all third-party "Strategies" in one big application environment. In other words, I write a strategy, and then the assembly is packaged and run on each of my customer's machines in the single NinjaTrader application.

Problem: I am selling multiple products, each with its own licensing / purchasing / trial days, etc. When product 1 is started up and loaded by the customer, it works fine, but when they later want to load product 2, I cannot change .dat files using PDetsFromPath because it is "already loaded".

Any suggestions?

Note - if there is anyone else on earth using TurboActivate on NinjaTrader, anything I do will probably break their code - in the event my customer happens to be their customer.

One idea: what if I upload the "machine-unique" information used by TurboActivate to my web service and validate the licensing from there for each client? Can TurboActivate support that model?

Thanks

Here's a good place to start: Licensing multiple products per process

Note - if there is anyone else on earth using TurboActivate on NinjaTrader, anything I do will probably break their code - in the event my customer happens to be their customer.

This sounds like design flaws in NinjaTrader. Plugins shouldn't be allowed to interfere with other plugins. You should push them to make things (a) more flexible so you have control over how you build your plugin and (b) make plugins "isolated" from other plugins. These a problems that are solvable.

In the meantime, if you know this is a problem (other TA users) you can just call TurboActivate.SetCurrentProduct() before any function call.

One idea: what if I upload the "machine-unique" information used by TurboActivate to my web service and validate the licensing from there for each client? Can TurboActivate support that model?

I'm not quite sure what you're asking. You can use LimeLM on your own servers, if you want.

Thanks for the "Licensing multiple products per process" link. That looks like it will work for me.

I continue to catch a "The TurboActivate.dat file has already been loaded." exception. My guess is that this occurs when I try to load the _same_ .dat file again. The TurboActivate.dll is never removed from memory by me or by NinjaTrader (which most customers will run without restart for days on end), so repeated startups of one of my strategies (products) causes the execption. Is that correct? Can I continue and just ignore that caught exception? Will that exception not occur on loading a second, different .dat file associated to a separate strategy (a separately licensed product)?

Thanks

Can I continue and just ignore that caught exception?

Yes. Perhaps we should change TurboActivate.cs to not throw an exception on that particular "error" (it's more of a soft error than a critical show stopper error).

Will that exception not occur on loading a second, different .dat file associated to a separate strategy (a separately licensed product)?

Correct. You won't get it if you're loading a new separate file.

Thanks again. You guys are fast and helpful as always.