Programmer en C++

Post Reply
XXEROFF
Posts: 23
Joined: 25 Mar 2016 08:36

Programmer en C++

Post by XXEROFF »

bonjour,

J'ai voulu voir les possibilités de programmer en C++ sur la NanoTrader.
Après avoir reçu le kit .zip de la part du support, j'ai téléchargé Visual Studio
pour tester un exemple de réalisation.
Aucune version n'étant précisée dans la doc fournie, j'ai téléchargé Visual Studio 2015.

Hélas, cette version convertit les projets pour une "mise à jour définitive" et
le projet NanoDLLTester ne fonctionne pas avec cette version convertie.
Je connais le C++, mais pas la programmation système Microsoft/VisualStudio
pour corriger leurs bugs.
(C'est moderne, très High Tech, les changements de version chez Microsoft !! ).

Je peux donc créer des DLL (standard windows DLL), mais pour les interfacer avec la Nano, l'exemple m'aurait été
très utile.
À moins que, si c'est pour une utilisation personnelle uniquement, il suffise de placer la DLL dans le répertoire dédié ??
Capture.PNG
You do not have the required permissions to view the files attached to this post.
stargate
Posts: 21
Joined: 18 Dec 2013 15:42

Re: Programmer en C++

Post by stargate »

Dans la doc page 5 il est dit ceci pour installer les DLL sur la Nano,
Attention toutefois il semble que dans les dernières versions de la Nano les plugins (DLL)n’apparaissent plus dans les sentimentors
demander à WHS
7.1 Making the DLL visible to NanoTrader
In order to make a DLL available to NanoTrader the DLL needs to be copied into the location
<NanoTrader installation directory>\PlugIns\Indicators
Create the directory in case it does not yet exist.
7.2 Loading and Initialization
The API distinguishes between “loading” the DLL and “initializing” it. NanoTrader might load the DLL to obtain additional information, such as version number, author, description, etc. This might be done through the NanoTrader browser to present the available DLLs to the user. Loading does not automatically mean the DLL will be used, so do not perform any specific initialization procedures when the DllMain() function is called – other than populating the NanoDllDetails structure.
If a DLL is to be used by a NanoTrader study the DLL routine Initialize() will be called once prior to any other call.
7.3 Multiple Instances of a PlugIin
An indicator plugin can exist in multiple instances at the same time, e.g., the same plugin might be used as a filter and indicator within one study and/or for studies targeted to multiple symbols.
Therefore the interface distinguishes between two main data structures:
NanoDllDetails holds all static information shared by all instances, whereas NanoInstanceDetails holds data local to an instance. A new instance is created by calling Initialize(). This routine creates and populates a NanoInstanceDetails structure and returns a pointer to it. All API calls are provided this parameter. NanoInstanceDetails holds a void *data for holding all additional data required by an instance.
7.4 The NanoDllDetails-Structure
The DLL needs to populate a NanoDllDetails structure to provide descriptive information about the DLL to NanoTrader. It is complemented by NanoInstanceDetails holding the actual pointers to data series which need to be plotted as well as the description of parameters that show up in the NanoTrader user interface.

typedef struct
{ //General Information about the DLL
char *version; //Version number of this DLL - use Format
//Version.Subversion", e.g., "3.2"
char *author;
char *shortDescription; //A short description; displayed in the
//DesignerBar and "Add Indicatro"-dialog.
char *longDescriptionUrl; //A URL pointing to a full description
char *authorEmail; //eg, "john@smith.com
char *authorWeb; //eg, "http://www.indicatorFactory.com"
XXEROFF
Posts: 23
Joined: 25 Mar 2016 08:36

Re: Programmer en C++

Post by XXEROFF »

Bonsoir, stargate,

Merci pour ta réponse!

j'ai eu les consignes dans le zip envoyé par le support,
mais je me rends compte que cet interfaçage est plutôt complexe,
et y compris comment écrire un programme C++ lisible par la Nano (après compilation en dll bien sûr !).

Il me faudrait donc un exemple complet de fichier C++, le plus simple possible, mais qui présente toutes les caractéristiques pour créer un DLL.

Programmes-tu toi même des DLL en C++ ?

Bonne continuation !
Post Reply

Return to “WHS NanoTrader”