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

Re: [amibroker] Need help - "for" loop MACD() not incrementing in array



PureBytes Links

Trading Reference Links

Hi - If you want to step through the array bar-by-bar, you should be using 
subscripts inside the loop that refer to the bar, e.g.

MCAD[i]

But unless you need the loop for something else, I think you could just 
remove the looping code at the top and use your regular array-based AFL to 
do what you want...

Steve

----- Original Message ----- 
From: "Michael" <herpse30@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Wednesday, October 07, 2009 12:08 PM
Subject: [amibroker] Need help - "for" loop MACD() not incrementing in array


> Thanks for lookin'.
> I am attempting to process a for loop through EOD data that includes a 
> test of the difference between the MACD() and Signal(). I installed a 
> trace and found that the MACD() and Signal() are not incrementing through 
> the data array. The numbers returned remain the same and I go nowhere.
>
> What do I have to do to increment MACD() and Signal() through the EOD data 
> within a for loop?
>
> Partial code sample follows:
>
> for(i = 1; i < BarCount; i++ )
> { // for loop bracket
> x = MACD();
> y = Signal();
> Hist = x - y;
> z = Hist > Ref(Hist, -1); // z = 0 if True, 1 if False
> _TRACE("x =" + x +"  y =" + y +"  Hist =" + Hist);
>
> Thanks,
> Mike L.
>
>
>
> ------------------------------------
>
> **** 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/
>
> Yahoo! Groups Links
>
>
>
> 




------------------------------------

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

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/