Web: SharkIndicators AMA: Ask Me Anything Webinars: SharkIndicators Webinars Elite offer: Click here
Posts: 16 since Aug 2010
Thanks Given: 4
Thanks Received: 53
|
magnumdbl,
To elaborate on BigMike's solution,
your cond1 is a dataseries that is indexed. This means (when you reference it from OnBarUpdate):
cond1[0] refers to the value you set cond1 to on the current bar.
cond1[1] refers to the value you set cond1 to 1 bar ago.
cond1[2] refers to the value you set cond1 to 2 bars ago.
When you call:
cond1.Set(1)
that is actually the equivalent to setting the current value of cond1, thus it's a shortcut for:
cond1[0] = 1;
Jeremy
|