NeuroShell Trader 3.7 – Custom DLLs

Custom-built dynamic link libraries (DLLs) provide a convenient way to implement indicators/trading strategies that otherwise could not be built using standard NeuroShell Trader Professional (NSTP) means. The NSTP release 3.7 has a new option that controls how custom DLLs are loaded and unloaded by the program.

In all NSTP releases prior to 3.7 there is only one method of calling custom-built DLLs. The DLL is loaded and attached to the program every time a corresponding custom indicator needs recalculation. After the calculation is done, the DLL is detached from the program memory space. After the DLL is detached, it can be recompiled at any time as needed without the necessity of bringing down the NSTP. This provides for easy debugging of the DLL’s source code. The trade-off for such convenience is a slight additional overhead required to attach/detach the DLL to/from the NSTP program memory space.

It is worth noting that the term “detach” does not mean that the DLL is loaded from the hard disk again next time it is needed. The operating system is smart enough to keep unattached DLLs for a while in the global computer memory just in case it is needed again. In other words, you will not see and hear constant hard disk thrashing when the NSTP attaches/detaches custom DLLs.

An additional method, which is new in release 3.7, is to load/attach the DLL upon its first call and leave it permanently attached to the program’s memory. This may just slightly increase the NST’s performance in the case when the DLL’s custom indicator is called many times (for example, during optimizations). The trade-off is that you cannot recompile the DLL “on the fly”, i.e. when the NSTP is running. You have to bring it down, re-compile the DLL, and run the NSTP again to see the results.

The switch that controls how custom DLLs are loaded is located in the NSTRADER.INI file in your Windows folder. Open that file with a text editor and search for the UNLOADCUSTOMDLLS key in the [Advanced Options] section:

[Advanced Options]
UNLOADCUSTOMDLLS=False

The key is self-explanatory.

UNLOADCUSTOMDLLS=False (default in 3.7) instructs the NSTP to leave custom DLLs permanently in the memory.

UNLOADCUSTOMDLLS=True forces the NSTP to detach DLLs from the program memory right after the call to the DLL’s function. This sets the NSTP to operate in the way it does in all releases prior to 3.7.

Currently, there is no corresponding visible switch on the NSTP’s user interface.

Was this article helpful?

Related Articles