Where the code is
A local dll and a shared package are both desktop. A server package is server. See Sharing indicators for how each one reaches a chart.
Your know-how
A .NET dll is not a secret. Anyone who has the file can read its code with a free decompiler, and obfuscation slows this down without preventing it. So:- A desktop package gives your code to every user. This is fine for an indicator you sell as a tool, or share with people you trust. It is not fine for a model you consider the product itself.
- A server package keeps the code on the server. The chart of the user asks for the indicator with its parameters and receives points and annotations. Nothing of the logic travels.
What the user trusts
A desktop indicator runs inside the Deepchart of the user, with the data of their charts and account around it. Deepchart limits what a dll can do before it loads it:- The dll is checked. Deepchart reads it before loading it and refuses it when it uses anything outside the indicator API and a small set of basic types: no files, no network, no processes, no threads, no reflection, no other libraries. The log names what was found. See Troubleshooting.
- A local dll is tied to a developer. It is loaded only when it carries the developer id of the logged user: nobody runs a dll copied into their folder by someone else.
- A package is reviewed. A package published for other users is reviewed by Volumetrica before it is distributed.
- Trading is limited. An indicator can send orders only on a backtesting account or on a simulation account, never on a paper or live one. See Trading.
These limits are there to protect the user. They also protect you: an indicator which stays inside them is one you can publish without thinking about what it could reach on someone else’s machine.
Day to day
Time limits on the server
The server calculates many indicators at once, so every call into an indicator has a time limit, measured on the clock. An indicator which goes over it, or which goes too deep in a recursion, is stopped: the charts which show it getIndicator stopped: time or stack limit exceeded.
Do the work of a bar in its own
OnOpen and OnClose. A calculation of the whole history in OnEnd(false) has 5 seconds for every bar together.
Choosing
- The logic is the value, and it needs only the bars: write it with the portable API and keep it ready for a server package.
- The indicator is a tool around the order book, the trades of the history or the trading interface: it is a desktop one. Keep it in its own dll.
- You are not sure: start portable. Adding a desktop feature later is one attribute away; removing one is a rewrite.