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

[amibroker] Re: Could someone comment on how this loop is executed (Basic)


  • Date: Thu, 18 Feb 2010 03:55:58 -0000
  • From: "Matthias" <m.kuschel31@xxxxxxxxx>
  • Subject: [amibroker] Re: Could someone comment on how this loop is executed (Basic)

PureBytes Links

Trading Reference Links



Hello,

Thanks to all for the prompt reply. (I just figured out how to format this, my 1st post looked a little strange).

EMA1 = EMA(C, 10);

EMA2 = EMA(C, 200);

Buycross = Cross(EMA1, EMA2);

Counter = Cum(Buycross);

Triples = Cross(Counter % 3 == 0, 0);

Plot(EMA1,"EMA10", colorRed,styleLine);

Plot(EMA2,"EMA20",colorBlue,styleLine);

Plot(Triples, "Triples", colorGreen, styleOwnScale | styleHistogram);

This code works absolutely fine, many thanks, only problem here: it starts to count wrong(should count to 3, but counts to 2 only considering the 1st triplele of crossovers, probably due to intializing the EMA200) any suggestions? But I need you to understand where I am coming from:

Obviously you are much more experienced in writing afl than me and I get Mike's basic concept of avoiding loops for proefficient coding and the "EMA-plot-labeling" was not correct.

You have to understand that I am trying to realize/code my ideas and the 2nd code is where I started off and probably would start off again, be it good or bad programming. I do have your solution to my problem now, but I still don't understand why my "concept" does not do the job. Of course I did read the articles on "How AFL works", this was were I started and also got a hand on the barcount funtion which I thought was the problem (not counting the whole OHLC-array due to faster processing speed). I also asked my brother on this simple one, who is used to programming C. As AFL is "C-based" I would have assumed this code should work. Please help me to understand what went wrong / is wrong in my logic here, I consider understanding this basic concept to be very important for future purpose.

Thanks in advance,

Matthias



__._,_.___


**** 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

__,_._,___