[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Array Loop simple question



PureBytes Links

Trading Reference Links



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



__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___