I have no problem when compiling my code, i have tested it in visual studio c#, and its working fine.
I am getting an error while applying the strategy to my chart.
*NT** Enabling NinjaScript strategy
**NT** Error on calling 'OnBarUpdate' method for strategy 'GetBuySellPrint/2a3c76e798bc43919bbe5b4f281d2018': Object reference not set to an instance of an object.
and then no output at all.
Any idea why i am getting this (flummoxed because the compiler is not returning an error)
if(IsTimeTrue()==false) return; if(BarsInProgress == 1) { lock(lastprint) { int nodecount= 0 ; LinkedListNode<Prints> listnode = printslist.First; Prints lastprintinlist = new Prints(); nodecount = printslist.Count; lastprintinlist = printslist.Last.Value; if(nodecount==0) return; if (lastprint.CompareTo(lastprintinlist)==true) return; listnode = printslist.Find(lastprint); if (listnode == null) { listnode = printslist.First; } else { listnode = listnode.Next; } while(listnode!= null) { Print("from List"); // Process fresh prints listnode.Value.PrintToScreen(); listnode = listnode.Next; } lastprint = printslist.Last.Value; } } }
Comment