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

Re: [amibroker] Code Question Involving Arrays



PureBytes Links

Trading Reference Links

Hi Bret,

I believe that YP0 and YP1 are arrays since you are using an array 
(Base_Normalization) to create them. LineArray function wants its arguments 
to be numbers instead. Wrapping these lines in LastValue should probably 
solve the problem:

YP0 = Lastvalue( Price_Array [ XP0 ] / Base_Normalization );
YP1 = Lastvalue( Price_Array [ XP1 ] / Base_Normalization );

Steve

----- Original Message ----- 
From: "Quad Rate Serial Abby" <quad_pumped_abby@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Tuesday, June 07, 2005 10:51 AM
Subject: [amibroker] Code Question Involving Arrays


>I have the following code.  I am trying to normalize the price and
> plot the line of the slope of the average price over the last 15 days.
> This way I can turn it into an explore and use it to see which stocks
> are out performing relatively.  I don't really need to plot the slope
> and I could take it out, but I would like to know why it doesn't work,
> because I suspect it may cause an error in the calculation of the
> array itself.  If I take out the normalization division there is no
> problem.  The error in the "Plot LineArray" is:
>
> Argument #4 has incorrect type (the function expects different
> argument type here)
>
> The code is:
>
> StartP = 15;
> EndP = 1;
> Price_Array = MA (( H + L ) / 2, 1 );
> LP1 = LastValue ( Cum ( 1 ));
> XP0 = LP1 - StartP;
> XP1 = LP1 - EndP;
> Base_Normalization = Ref ((( H + L ) / 2), -StartP );
> YP0 = Price_Array [ XP0 ] / Base_Normalization;
> YP1 = Price_Array [ XP1 ] / Base_Normalization;
> Plot ( Price_Array, "", 1, 1 );
> Plot ( LineArray ( XP0, YP0, XP1, YP1 ), "", 4, 1 );
>
> Thanks in advance for anybodys help,
>
> Bret
>
>
>
>
>
> 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 other support material please check also:
> http://www.amibroker.com/support.html
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
> 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

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