For example, I am keeping an array of type Iorder, for which I allocate memory once only in Initialise and set all elements of this array to null initially. Then I store the results of calls to EnterLongStop and EnterShortStop in this array. When a trade completes (which I detemine simply by the value of Close[0], as each trade has a profit target) I reset the appropriate array element to null, so that it can be reused. Will this cause memory leaks? Should I be freeing the memory used by the IOrder structure returned from EnterLongStop and EnterShortStop before setting the array element to null? The reason I ask is that although the strategy works it slows down and eventually hangs the more times I run it.
Thanks for your help.
Annette
Comment