Using Easylanguage to draw a rectangle

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Using Easylanguage to draw a rectangle

Postby arjfca » 25 Apr 2011

Hello

Is it possible to draw a rectangle using Easylanguage in indicator?

I'm looking to draw a rectangle and modify the interior depending of some condition. My idea is to keep the rectangle in syncs with the chart and expand it with the apparition of a new bar.

Martin
Attachments
Rectangle.gif
(5.07 KiB) Downloaded 939 times

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Using Easylanguage to draw a rectangle

Postby TJ » 25 Apr 2011

57.51.39
Hello

Is it possible to draw a rectangle using Easylanguage in indicator?

I'm looking to draw a rectangle and modify the interior depending of some condition. My idea is to keep the rectangle in syncs with the chart and expand it with the apparition of a new bar.

Martin
not exactly the answer you want...
viewtopic.php?f=1&t=6894

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Using Easylanguage to draw a rectangle

Postby TJ » 25 Apr 2011

Hello

Is it possible to draw a rectangle using Easylanguage in indicator?

I'm looking to draw a rectangle and modify the interior depending of some condition. My idea is to keep the rectangle in syncs with the chart and expand it with the apparition of a new bar.

Martin
from your chart, it looks like all you need is to draw a straight line that extends to the end.

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Re: Using Easylanguage to draw a rectangle

Postby SP » 26 Apr 2011

A tl_rectangle function would be nice if MC could implement it. It is easier to modify the colors, style, width, ... and to delete the rectangle if you have only one ID like with text or trendlines.

Should we add this to the features requests?

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Using Easylanguage to draw a rectangle

Postby arjfca » 26 Apr 2011

Hello SP
Should we add this to the features requests?
Of course it could be add to a request.

I did try to work with trendline. For The trendline function
" Value1=TL_New_s(Sdate,Stime,Sprice,Edate,Etime,Eprice);"

we need to provide a starting (date, time, Price) and Ending (date, Time, Price).

No success yet. Nothing is displayed. That's only a part of my quest as i want to color the interior of this given "trend line"

Code: Select all

Variable:
New_Date (0),
sDate (0),
Stime (0),
Sprice (0),
Edate (0),
Etime (0),
Eprice (0);

If barstatus = 2 then begin
If o = 1.4557 and h = 1.45585 and l = 1.4539 then begin // Only a Selection of a bar to start drawing a test trend line
print (close:5:5); // Simple confirmation that i got the good bar
Sdate = Date;
Stime = Time;
Sprice = Open;
Edate = Date;
Etime = 1648; // Time bar where the test trend line should finish
Eprice = Close;
Value1=TL_New_s(Sdate,Stime,Sprice,Edate,Etime,Eprice);
Print (value1:5:5);
Print ("Sdate: " , Sdate:8:0);
Print ("Stime: ", Stime:8:0);
Print ("Sprice:", Sprice:5:5);
Print ("Edate:", Edate:8:0);
Print ("Etime:", Etime:8:0);
Print ("Eprice:", Eprice:5:5);

end;
end;

Martin

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Using Easylanguage to draw a rectangle

Postby TJ » 26 Apr 2011

you can give this a try...

Image
Attachments
Rectangle demonstration.txt
(586 Bytes) Downloaded 602 times
rectangle demonstration.jpg
(112.95 KiB) Downloaded 1270 times

janus
Posts: 835
Joined: 25 May 2009
Has thanked: 63 times
Been thanked: 104 times

Re: Using Easylanguage to draw a rectangle

Postby janus » 26 Apr 2011

A tl_rectangle function would be nice if MC could implement it. It is easier to modify the colors, style, width, ... and to delete the rectangle if you have only one ID like with text or trendlines.

Should we add this to the features requests?
YES!

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Using Easylanguage to draw a rectangle

Postby arjfca » 26 Apr 2011

OK TJ

I will try to work around your code

Martin

Trip
Posts: 8
Joined: 08 Mar 2011
Been thanked: 8 times

Re: Using Easylanguage to draw a rectangle

Postby Trip » 27 Apr 2011

The attached plots Darvis Boxes, using trend lines it may be helpful.
Attachments
Darvis Box.TXT
(6.19 KiB) Downloaded 596 times


Return to “MultiCharts”