I put

Code:
if(is(INITRUN)) {
    Capital = 5000;    // starting capital
}



at the top of my run() routine.
The strategy then performs trades and closes trades with profits and losses. But for some reason the Capital and CapitalClosed variables do not get updated properly:



While CapitalClosed registers some loss at the beginning it then just stops registering the other trade results. And Capital just never gets updated.

Am I doing something wrong? Should I include more commands to make these quantities properly track the current state of affairs?

Thanks for any suggestion!

Last edited by Hredot; 09/27/17 16:06.