I'm programing a system for graphicaly edit HCMS (Hierarchical concurency state machine) for edit easly differents strategies and test it for AutoTrading system., For this and because i'm encouter limitations with c# compilateur embeded with NinjaTrader, i'm using Visual studio 2012 for build the external assembly (im' using NLua for sripting system, http://gojs.net/latest/samples/orgcharteditor.html libs for java script for graphicaly edit the State Machine and more external lib who are not easy to use with NinjaTrader embede compilere (Nlua partialy working with NinjaTrader copiler, somme signature with default parameters disepears for sample...)
But i have a probleme with custom type i'm making in both side, they are consideded as different type even if it's definied in c# source code compiled by NinjaTrader embeded compilater, and the same signature are considered as different type:
ex:
Strategy\StrategyInterface.cs
Argument '1'*: impossible de convertir de 'IEngineNTInterface [c:\Users\asaff\Documents\NinjaTrader 7\bin\Custom\Strategy\StrategyInterface.cs(69)]' en 'IEngineNTInterface []' CS1503 - click for info 174 52
I have the same probleme with all type definied in code, included interfaces, except for base type of c# like string, int, list etc...
All Struct and classe type can't be used on the two side because considered as different by the Ninja embeded compiler (but no by Visual studio who can use the type defined in NinjaTrader without problems).
Basicaly with this limitation, i'm can communicate from NinjaTradre strategy to external assembly, but not in reverse direction.
So , ultimalty, i'm try to compile all with Visual studio, included the strategy base clase i'm writing in NinjaTrader side, Visual studio can generate the DLL with type imported from NinjaTrader like Indicator and Strategy, but when i'm import the compiled assembly with Visual Studio in Ninja Trader, i have this message when i'm try to use the strategy on a graph (the importing opération working without error)
06/04/2016 21:35:14 Default Unable to retrieve type infos from assembly 'StrategyInterfaceExternNT': System.Reflection.ReflectionTypeLoadException: Impossible de charger un ou plusieurs des types requis. Extrayez la propriété LoaderExceptions pour plus d'informations.
à System.Reflection.Module._GetTypesInternal(StackCr awlMark& stackMark)
à System.Reflection.Assembly.GetTypes()
à NinjaTrader.Cbi.AssemblyDictionary.GetTypes(Type superClass)
So what is missing for be able to compile a strategy with visual studio and import it in assembly for on NinjaTrader after ?
For info, defininition of the base classe:
/// <summary>
/// Module d'interface pour les stratégies codées dans une assembly externe à NinjaTrader
/// </summary>
[Description("Module d'interface pour les stratégies codées dans une assembly externe à NinjaTrader")]
public class StrategyInterface : Strategy, IOrderResult, IEngineIndicateur, IEngineNTInterface
{
....
and the classe StrategyInterface have variable instance of:
private StrategyInterfaceExternNT.StrategyInterfaceExtern _ExternStrategyInterface;
StrategyInterfaceExternNT.StrategyInterfaceExtern is the entry clas of assembly compiled by Visual studio 2012.
I'm understand this subject is far of the scope of custom suport for progaming indicator and strategy, but if you can give me a direction, it's appreciated.
Thanks if you can help me a little because i'm stuck with this probleme of incompatibilities of type between assembly compiled by NinjaTradre and Visual studio 2012 (all in .Net 3.5)
Twanaar
ps: after i'm plan porting this system in NinjaTrader 8, and perhaps sell it.
Comment