plot price and line at specific time

Questions about MultiCharts .NET and user contributed studies.
O66
Posts: 146
Joined: 28 Nov 2006
Location: Netherlands
Has thanked: 2 times
Been thanked: 3 times

plot price and line at specific time

Postby O66 » 25 Jul 2015

hi,

how can i plot a line at price at a specific time for lets say the next 5 hours.

for instance i want a line plotted at the open price from 9.00
on 14:00 i want a line plotted at the price level of that time etc
the line should have an end time as well.

Unfortunately im not a programmer...
any ideas?

Regards,

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: plot price and line at specific time

Postby JoshM » 25 Jul 2015

how can i plot a line at price at a specific time for lets say the next 5 hours.

for instance i want a line plotted at the open price from 9.00
on 14:00 i want a line plotted at the price level of that time etc
the line should have an end time as well.
So a trend line from 9:00 till 14:00 at that day's opening price, and then a second trend line from 14:00 till 19:00 (?) with the price from 14:00 (closing price at 14:00?).

Should that first trend line go away when the second is drawn, or how do you picture it?

Do you use a non-time based chart (like ticks, volume) by the way?

O66
Posts: 146
Joined: 28 Nov 2006
Location: Netherlands
Has thanked: 2 times
Been thanked: 3 times

Re: plot price and line at specific time

Postby O66 » 25 Jul 2015

thanks for the reply.
everyday i want to plot 4 lines (each with his own color), and i want to see them all together.
each line is the open price of the set time
length of line is determined by the set closing time.
see attached example in NT
Attachments
2015-07-25_15-51-53.png
(29.78 KiB) Downloaded 760 times

holya
Posts: 40
Joined: 28 Aug 2012
Location: Vancouver, Canada
Has thanked: 8 times
Been thanked: 1 time

Re: plot price and line at specific time

Postby holya » 11 Aug 2015

Is this what you're looking for?

public static void DrawCloseRef(DrawContext context, IBar lastBar)
{
Graphics g = context.graphics;
Pen pen = new Pen(new SolidBrush(Color.White));
float left = context.FullRect.Right - 100;
pen.Color = Color.White;
PointF closePf = context.Environment.ChartPoint2Point((new ChartPoint(lastBar.DateTime, lastBar.Close)));
g.DrawLine(pen, closePf.X, closePf.Y, left, closePf.Y);
g.DrawString("" + lastBar.Close, new Font("Arial", 9), new SolidBrush(pen.Color), left, closePf.Y);

}


Return to “MultiCharts .NET”