View Single Post
  #5 (permalink)  
Old 02-29-2008, 11:49 PM
Michel Michel is offline
Senior Member
 
Join Date: Feb 2006
Posts: 525
Michel is on a distinguished road
Quote:
Originally Posted by fxbs View Post
another way - but that's - dirty trick:
...
There is no ONE best solution.
It depends of what you want to do: for example, some indics must run at every tick of bar 0, but some other needs to run only once at the open of the bar, it's stupid to let them run at each tick; some cannot run the last "x" bars of the history because they need the datas, some run from the past to the present and some others no, and so on.
The best solution is the one YOU understand !
I must admit that sometime it's very tricky...
I such cases, in order to test how it works, I suggest you to add a command inside the "for" loop to print or comment the bar number, for example :

for(int i = limitblablabla...)
{
Print(i + " " + Bars + " " + IndicatorCounted());

In a generic case, if you only want to add a MaxBars count at a working indic , the easiest way is to add at the first line of the "for" loop this line :

for(int i = limitblablabla...) //original command , no need to understand it
{
if(i > MaxBars) continue;

....
Reply With Quote