[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

What is the error message?

For X0 and X1 you need an index number, not a date number.

Instead of calculating dtre, you need to compute BarIndex().

Look at  the requirements for LineArray in help



----- Original Message ----- 
From: "Panos Boufardeas" <panosbouf@xxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, September 20, 2008 3:11 PM
Subject: Re: [amibroker] LineArray parallel lines based on study()?


> Ara
> is not the last parameter..... but X0 and X1 is the problem here i believe
>
> thans
>
> At 01:02 AM 21-09-2008 21-09-2008, you wrote:
>
>>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 -----
>>From: <mailto:panosbouf@xxxxxxxxxxx>Panos Boufardeas
>>To: <mailto:amibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx
>>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
> Yahoo! Groups Links
>
>
>


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

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

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