BarsWidth
property
Returns a current width of candle bar
Syntax
public int BarsWidth { get; }
Example
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using PTLRuntime.NETScript;
using PTLRuntime.NETScript.Charts;
namespace ChartPropertiesExamples
{
public class ChartPropertiesExamples : NETIndicator
{
StringFormat stringFormat = new StringFormat();
stringFormat.Alignment = StringAlignment.Far;
stringFormat.LineAlignment = StringAlignment.Far;
PointF startPoint;
RectangleF rectf = new RectangleF(0, 0, BarsWidth, 20);
public override void OnQuote(){
startPoint=CurrentChart.GetChartPoint(CurrentData.Time(),CurrentData.GetPrice(PriceType.Close,0));
}
public override void OnPaintChart(object sender, PTLRuntime.NETScript.Charts.PaintChartEventArgs args)
{
rectf.X=startPoint.X;
rectf.Y=startPoint.Y;
args.Graphics.DrawString("$", new Font("Arial", 10, FontStyle.Bold), new SolidBrush(Color.White), rectf, stringFormat);
}
}
}
Discussion
Join PTMC community to post your comments
No comments yet. Be the first.