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,
plot price and line at specific time
- 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
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?).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.
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?
Re: plot price and line at specific time
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
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
-
- 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
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);
}
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);
}