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

RE: [amibroker] AFL help please: linearray.



PureBytes Links

Trading Reference Links

Bob

Thanks for pointing out where I seem to have gone
wrong.


> Linearray needs two each X and Y points and
> rightfully complained when you
> fed it two Y arrays.
 

Oh OK so the x and y values have to be numbers rather
than arrays.
That makes sense.

The Help file does say 
Note 2: the function accepts only numbers therefore
generates single line…. but I guess I just assumed the
buyprice was a dollar value,  rather than an array.

If I use

y0 = valuewhen(buy,c); 
y1 = y0 * 1.1;

 for example I still get no joy.

How can I extract the buyprice generated by my buy
condition to become a number that I can use in y0 and
then convert to a target number in y1?
 
> Was there a reason why you used
> LineArray(x0,y0,x1,y1, 0, 1) in place of the
> default LineArray(x0,y0,x1,y1)?

Just trying to understand and follow the Help file.
LineArray(x0,y0,x1,y1); is also not working

Guess I'll have to spend more time with this.

thanks again.

ChrisB

> -----Original Message-----
> From: kris45mar [mailto:kris45mar@xxxxxxxxx]
> Sent: Saturday, February 12, 2005 7:14 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] AFL help please: linearray.
> 
> 
> 
> Could someone please check I am using Linearray
> correctly?
> 
> I want to plot a line from the buyprice indicating a
> certain annualised percent gain, eg 10 % gain after
> 260 bars.
> 
> If I use this code
> 
> ******************
> 
> Buy = Cross ( Close, EMA(C,30));
> 
> //price = ValueWhen(Buy,1);
> 
> 
> x0 = ValueWhen(Buy,BarIndex(),1);
> y0 = BuyPrice;
> x1 = BarsSince(Buy) == 260;
> //x1 = x0 + 260;
> y1 = BuyPrice * 1.1;
> 
> Line = LineArray(x0,y0,x1,y1, 0, 1);
> 
> Plot(C,"",1,64);
> Plot(EMA(C,30),"",1,1);
> PlotShapes(shapeUpArrow * Buy,colorBlue,0,L,-15);
> 
> Plot(Line, "line", colorGreen,1);
> 
> *******************
> 
> I get the following error:
> 
> x1 = BarsSince(Buy) == 260;
> y1 = BuyPrice * 1.1;
> 
> Line = LineArray(x0,y0,x1,y1, 0, 1);
> -------------------------------------------^
> 
> Error 2.
> Bad argument(s)
> 
> I think I am using the LineArray function correctly.
> Is there an error in my x0,x1,y0,y1 initialising?
> 
> Regards
> 
> ChrisB
> 
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Find what you need with new enhanced
> search.
> http://info.mail.yahoo.com/mail_250
> 
> 
> 
> Check AmiBroker web page at:
> http://www.amibroker.com/
> 
> Check group FAQ at:
>
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 
> 



		
__________________________________ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 


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

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/