Hello,

Your code is incorrect.
Usage of Study function is described in the manual:
http://www.amibroker.com/guide/h_studies.html

Correct code is:

Plot(C, "Price", colorBlack, styleCandle ); 
su = Study("SU", GetChartID() ); 

isn = IsNull( su ); 

begpoint = NOT isn AND Ref( isn, -1 ); 
endpoint = NOT isn AND Ref( isn, 1 ); 

dt = DateTime(); 

startdatetime = LastValue( ValueWhen( begpoint, dt ) ); 
enddatetime = LastValue( ValueWhen( endpoint, dt ) ); 

startval = LastValue( ValueWhen( begpoint, su ) ); 
endval = LastValue( ValueWhen( endpoint, su ) ); 

if( startdatetime == 0  ) 
{ 
  Title = "Study with ID=='SU' is not drawn yet"; 
} 
else 
{ 
Title = 
"Study (x0,y0) = " + DateTimeToStr( startdatetime ) + "," + startval + "\n" + 
"Study (x1,y1) = " + DateTimeToStr( enddatetime ) + "," + endval ; 
} 

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "exnergy007" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, September 08, 2008 10:05 PM
Subject: [amibroker] How to get study line coordinates ??


> Hi !
> I am trying to get study line coordinates for beginning and end to use
> these coordinates in formula. But I cant find right function to obtain
> these values.
> 
> 
> this code below doesnt work:
> 
> Plot(C, "Price", colorBlack, styleCandle );
> su = Study("SU", GetChartID() );
> 
> 
> WriteVal( BeginValue( su ));
> WriteVal( EndValue( su ));
> 
> I just wanted to code something simpler than i.e. fibonacci extension.
> 
> 
> ------------------------------------
> 
> 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
> 
> 
> 

Reply via email to