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

[EquisMetaStock Group] Re: Diagonal line drawn by indicator



PureBytes Links

Trading Reference Links

Hi there,

Suppose you can find the two points' coordinates as X1,Y1 and X2,Y2. 
The X1 and X2 will typically be from something like 'Cum(1)' combined
with your 'valuewhen' function, something like
X1 = Lastvalue( Sum( Cum(1) * valuewhen(...) ) );
Y1 = Lastvalue( Sum( C * valuewhen(...) ) );
etc.

Now, to get the line, it would look something like

xx = Cum(1);
mm = (Y2-Y1)/(X2-X1);
bb = Y1-mm*X1;
{Final plot}
(xx>=X1)*(xx<=X2)*(mm*xx+bb);

This is not tested, but you should get the idea....  It will draw a
line between the points and zero otherwise.  To start at Y1 and end at
Y2, do something like

(xx>=X1)*(xx<=X2)*(mm*xx+bb)+(xx<X1)*Y1+(xx>X2)*Y2;

with the final line.

Regards
MG Ferreira
TsaTsa EOD Programmer and trading model builder
http://www.ferra4models.com
http://fun.ferra4models.com 





--- In equismetastock@xxxxxxxxxxxxxxx, "rsb_44" <rsb_44@xxxx> wrote:
> I am able to find two points with valuewhen. Is there a way to have a
> diagonal line drawn between those two points via code? How about one
> point and its slope (rate of change)? (y=mx+b)
> 
> TIA
> Ron




------------------------ 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/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/