Atlas, The first assignment - in the loop.
Also, I find that when I have a problem figuring out what is happening, I find that plotting the results helps me figure out what is going on. That is how I found the solution. ... Plotted each of the items individually, then the result... Good Trading --- In [email protected], "Blair" <[EMAIL PROTECTED]> wrote: > > Atlas, > > When you run through your loop, you are setting the ENTIRE array > Croisement to a value. > > If you only want to set the "current" "i" element, you need to > subscript the variable. > > Also the first assignment has the form "==". The Double Equal is > typically used as Equivalence, not assignment ("="); > > Hope that helps!! > > > > > --- In [email protected], "atlas190" <atlas190@> wrote: > > > > Hello , > > > > I meet a bug when I spy the "Croisement" variable with the > > spreadsheet "results" (explorer) . > > The variable "croisement" should receive the value "100" sometimes > > and not always the value "222" . > > > > It's probably a beginner's bug ... > > > > > > aire1 = WMA(C,150); > > aire2 = MA(C,50); > > aire3 = aire1 / aire2 ; > > recup =0; > > Croisement =0 ; > > > > bi = BarIndex(); > > > > for(i=0; i < BarCount -1 ;i++) > > { > > > > recup[i] = bi[i]; > > > > if (aire3[i] >= 0.95 AND aire3[i] <= 1.00) > > > > { > > //Croisement == recup[i]; > > Croisement == 100; //I don't reach this line ?! > > // I am sure that sometimes aire3 has got a > > // value beetwee 0.95 and 1 > > } > > else > > { > > Croisement = 222; > > } > > > > Filter =1; > > > > //AddColumn(bi,"barindex"); > > AddColumn(recup,"pour voir"); > > AddColumn(aire1,"aire1",format = 1.2); > > AddColumn(aire2,"aire2",format = 1.2); > > AddColumn(aire3,"aire3",format = 1.2); > > AddColumn(Croisement,"croisement"); > > //AddColumn(a,"valeur du croisement"); > > >
