index out of range in multiple position strategy
Author: karla2010
Creation Date: 2/9/2011 2:17 AM
profile picture

karla2010

#1
I am using two different entry strategies and do not want to open more than two positions at a time. I coded the following which seems logically should work but keep getting an index out of range error in this piece of code. Obviously doing something wrong but do not understand what. Any help is appreciated.

CODE:
Please log in to see this code.
profile picture

Cone

#2
When there is 1 active position, its index is 0 in the list:
CODE:
Please log in to see this code.
The snippet seems a little nonsensical, but maybe that's because it's taken out of context.
profile picture

karla2010

#3
Cone,

Thanks, should have figured that out. In the stone age the default value for index arrays started at 1.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).