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

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;

thx for help

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

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

Re: vertical line on chart

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

sorry now it s perfect no ???

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

Re: vertical line on chart

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.

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

Re: vertical line on chart

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]

thx TJ

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

Re: vertical line on chart

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

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

Re: vertical line on chart

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.

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

Re: vertical line on chart

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
1.jpg

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

Re: vertical line on chart

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.

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

Re: vertical line on chart

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