Raskoks --
Assuming that C1, C2, CondBuy, and CondShort, are arrays and not a function of your buying history,
You might have two problems (or maybe just one):
1. You may, or may not, need to use looping if you wish to make buy sell decisions based on previous buys and sells. 2. More importantly, I do not think that you have thought through what you mean by:
 B= (bsB<bsS);
 S= (bsB>=bsS);
because, if you want to buy before you sell and sell before you buy, you are not pyramiding, and you do not want to buy and sell on the same bar, or vise-versa, then: once you are long, then bsB *is* less than bsS and therefore B would be true (and S false). And once you have sold, then bsB *is* more than bsS and therefore S would be false (and B true).

Once you straighten out 2. above, you might even discover that you don't need looping after all.

-- Keith

raskoks wrote:
Hi, I've got problem with looping of my arrays ;-)
Let's look:

Buy= C1 AND CondBuy AND Ref(B,-1)
Sell=C2 AND CondShort AND Ref(S,-1)

bsB=BarsSince(Buy);
bsS=BarsSince(Sell);
B= (bsB<bsS);
S= (bsB>=bsS);

But i need B and S before Buy and Sell. How to start the array ?
Probably this is not a smart question - bu I stick on it.

--
Best regards
raskoks


Reply via email to