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

Re: [amibroker] LineArray parallel lines based on study()?



PureBytes Links

Trading Reference Links

Panos,
 
You need another parameter.  The last parameter should be 0 or 1. Look under lineArray in help.
 
midline=LineArray( startdatetime , StarMidLine , enddatetime , EndMidLine, 1 , 0 ) ;
----- Original Message -----
Sent: Saturday, September 20, 2008 2:41 PM
Subject: [amibroker] LineArray parallel lines based on study()?

Hi
 How to get some more parallel lines with study() ? I try with LineArray but is something missing here
 
Few days ago tomasz provide How to get study line coordinates and based on this example i wrote the following in this example I would like to draw a line in between the ?RE? and ?SU?
Can any one find my mistake here
midline=LineArray( startdatetime , StarMidLine , enddatetime , EndMidLine, 1  ) ;
 
the code is :
 
// How to get more parallel lines based on study() ?
SetChartBkColor(ParamColor("backround ",colorBlack));
Plot(C, "Price", colorWhite, styleCandle );
 
su = Study("SU", GetChartID() );        isn = IsNull( su );
re = Study("RE", GetChartID() );        isn_re = IsNull( re );
 
begpoint = NOT isn AND Ref( isn, -1 );  //SU
endpoint = NOT isn AND Ref( isn, 1 );   // SU
begpointRE = NOT isn_re AND Ref( isn_re, -1 );  //re
endpointRE = NOT isn_re AND Ref( isn_re, 1 );   // re
 
// SU
dt = DateTime();
startdatetime = LastValue( ValueWhen( begpoint, dt ) );  
enddatetime = LastValue( ValueWhen( endpoint, dt ) );
startval = LastValue( ValueWhen( begpoint, su ) );
endval = LastValue( ValueWhen( endpoint, su ) );
 
// RE
dtre = DateTime();
startdatetimeRE = LastValue( ValueWhen( begpointRE, dtre ) );
enddatetimeRE = LastValue( ValueWhen( endpointRE, dtre ) );
startvalRE = LastValue( ValueWhen( begpointRE, RE ) );
endvalRE = LastValue( ValueWhen( endpointRE, RE ) );
 
// difference RE - SU
StarMidLine=((startvalRE -startval ) /2) +startval ; 
EndMidLine=((endvalRE -endval ) /2)+endval   ;
  Plot( EndMidLine,"",2,1);  //
  Plot( StarMidLine,"",3,1);
// what is missing in the following line
midline=LineArray( startdatetime , StarMidLine , enddatetime , EndMidLine, 1  ) ;
Plot( midline, "Middle line", colorBlue );
 
//    Print Title
if( startdatetime == 0  )  { Title = "\nStudy with ID=='SU' is not drawn yet";  }
else if( startdatetimeRE == 0  )  { Title = "Study with ID=='RE' is not drawn yet"; }
else  {   Title =
"StudySU (x0,y0) = " + DateTimeToStr( startdatetime ) + "," + startval + "\n" +
"StudySU (x1,y1) = " + DateTimeToStr( enddatetime ) + "," + endval + "\n" +
"StudyrRE (x0,y0) = " + DateTimeToStr( startdatetimeRE ) + "," + startvalRE + "\n" +
"StudyRE (x1,y1) = " + DateTimeToStr( enddatetimeRE ) + "," + endvalRE +
"\n StarMidLine ="+StarMidLine+
"\n EndMidLine="+EndMidLine;
}
 
////////// code end
 
PS : i am trying to make something like gann grids do i have to use cum() and plot() ?

Thank you again
panos
__._,_.___

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




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___