vertical line on chart  [SOLVED]

Questions about MultiCharts and user contributed studies.
chipeur_le_renard
Posts: 50
Joined: 13 Jul 2014
Has thanked: 15 times
Been thanked: 5 times

vertical line on chart

Postby chipeur_le_renard » 03 Apr 2021

hi

can one of you explain how to draw a vertical line on a chart

i post an example

Code: Select all

Inputs: Line1(True), LineTime1(0830), String LineColor1("Gray"), Line2(True), LineTime2(1100), String LineColor2("Red"), Line3(True), LineTime3(1515), String LineColor3("Gray"); Using elsystem.drawingobjects; Using elsystem.drawing; Variables: VerticalLine VL(null); Method void DrawVerticalLine() begin VL = VerticalLine.Create(DTPoint.Create(BarDateTime,0)); VL.Persist = False; DrawingObjects.Add(VL); End; If Line1 and T >= LineTime1 and T[1] < LineTime1 then begin DrawVerticalLine(); VL.Color = Color.FromName(LineColor1); VL.Style = StyleType.Dashed; VL.Weight = 0; End; If Line2 and T >= LineTime2 and T[1] < LineTime2 then begin DrawVerticalLine(); VL.Color = Color.FromName(LineColor2); VL.Style = StyleType.Dashed; VL.Weight = 0; End; If Line3 and T >= LineTime3 and T[1] < LineTime3 then begin DrawVerticalLine(); VL.Color = Color.FromName(LineColor3); VL.Style = StyleType.Dashed; VL.Weight = 0; End;

with this example on TS you can draw this vertical line Using elsystem.drawingobject and elsystem.drawing;



Image


thx for help

regards
Last edited by chipeur_le_renard on 04 Apr 2021, edited 1 time in total.

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

Re: vertical line on chart

Postby TJ » 03 Apr 2021

Please see post #1 & #2
viewtopic.php?t=11713

chipeur_le_renard
Posts: 50
Joined: 13 Jul 2014
Has thanked: 15 times
Been thanked: 5 times

Re: vertical line on chart

Postby chipeur_le_renard » 04 Apr 2021

sorry now it s perfect no ???

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

Re: vertical line on chart

Postby TJ » 04 Apr 2021

The code is not Easylanguage. It is in TS OOP extension.

It is impossible to make a translation or conversion to MultiCharts.
You have to rewrite the whole thing.

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

Re: vertical line on chart

Postby TJ » 04 Apr 2021

Try this:

Note: set plot style as Histogram

Code: Select all

Inputs: Line1(True), LineTime1(0830), LineColor1(DarkGray), Line2(True), LineTime2(1100), LineColor2(Red), Line3(True), LineTime3(1515), LineColor3(DarkGray); If Line1 and T >= LineTime1 and T[1] < LineTime1 then Plot11(c*2, "Line1", LineColor1) // set plot style as Histogram else Plot11(0); If Line2 and T >= LineTime2 and T[1] < LineTime2 then Plot12(c*2, "Line2", LineColor2) // set plot style as Histogram else Plot12(0); If Line3 and T >= LineTime3 and T[1] < LineTime3 then Plot13(c*2, "Line3", LineColor3) // set plot style as Histogram else Plot13(0);

chipeur_le_renard
Posts: 50
Joined: 13 Jul 2014
Has thanked: 15 times
Been thanked: 5 times

Re: vertical line on chart  [SOLVED]

Postby chipeur_le_renard » 05 Apr 2021

thx TJ

pitrader
Posts: 26
Joined: 20 Apr 2022
Has thanked: 1 time
Been thanked: 1 time

Re: vertical line on chart

Postby pitrader » 26 Aug 2022

Is there a way to have these lines plot in advance rather than after the fact?

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

Re: vertical line on chart

Postby TJ » 27 Aug 2022

Is there a way to have these lines plot in advance rather than after the fact?
You need to describe your vision with hard examples.
Please draw a diagram(s) to illustrate the operation.

pitrader
Posts: 26
Joined: 20 Apr 2022
Has thanked: 1 time
Been thanked: 1 time

Re: vertical line on chart

Postby pitrader » 29 Aug 2022

The lines are only drawn after the data has passed. I need the lines to be there before the data. Pic #1 shows the way that it is now. Pic #2 is the way t hat I need it to be.
Attachments
2.jpg
(128.62 KiB) Not downloaded yet
1.jpg
(140.4 KiB) Not downloaded yet

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

Re: vertical line on chart

Postby TJ » 29 Aug 2022

The lines are only drawn after the data has passed. I need the lines to be there before the data. Pic #1 shows the way that it is now. Pic #2 is the way t hat I need it to be.
You need to describe your vision with hard examples.

What are those lines? Date/time lines?
What are the LOGIC of those line?
When do you want them plotted? Beginning of each day to plot the end of the day?

You need to describe your vision with DETAIL hard examples,
You need to describe your logic,
not just a bit of info here and there.
No one can read your mind.

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

Re: vertical line on chart

Postby TJ » 29 Aug 2022

You can make the line with PLOT1[ -1 ] .


Return to “MultiCharts”