Hiya,
Quote:
Suppose you want to count how many up candles there are in the last 6 historical candles.
You would define a local variable counter and assign 0 to its default value.
True
Quote:
You would expect not to get more then 6 candles right?
False as the condition "More than 6 candles" is not defined anywhere. How do you expect a code to execute an instruction that is not defined/declared ?
Quote:
The counter keeps on counting endlessly.
Normal behavior as the counter is incrementing at every candle's event.
Quote:
The Strategy does not initiate the local variable back to its default value at the beginning of each execution. Instead, it keeps on adding to the value of the previous execution.
False, a default value is attributed to a variable at the "OnStart" & "OnStop" methods unless the user assign the default start value within the strategy itself.
In any case, resetting a counter is a matter of 2 blocks : "IF" & "Assign" that's it.
Quote:
This is simple for a trivial example, but gets chaotic for a bigger strategy.
We'll do our best to avoid you chaotic kinematics

Slowly but surely !
Cheers