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

[amibroker] Re: Looping - our previous discussion



PureBytes Links

Trading Reference Links

Ed,

I can't get your attachements. They show at the bottom of the message
but also say "not stored", and there's nothing to get.  Any idea why
that might be (it seems to be the same for all messages with
attachments here)?

I looked back at the original discussion, and from what it seems like
the objective is to me, I think the whole thing can be done like this:

Setup = ExRemSpan(C < BBandBot(C, 20, 2), waitPeriod-1);
SetupPrice = ValueWhen(Setup,H) * triggerPercentage;
Buy = Cross(H, SetupPrice) && BarsSince(Setup) < waitPeriod;

All that loop code can be replaced by the ExRemSpan array function.

Also, in that original loop code, there are a couple of problems.
Firstly, it skips a bar at the end of each inner loop, because the
statement i=j sets i to the next bar, but then the for loop's i++
statement increments it straight away. It should be i=j-1. Secondly,
it won't run to the end of the array. The outer loop's condition
should be i < BarCount but then the inner loop needs to add "AND j <
BarCount" to its condition to avoid over-running the array.

Regards,
GP




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

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

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/