Hi, I'd like to plot the time of a change beside the price in a scanner so I tried replacing closing price with time so I could load the variation as well. Ain't working. The first is the original price study.
Much help appreciated!
Plot time of a study's price change in scanner [SOLVED]
Plot time of a study's price change in scanner
- Attachments
-
- Time of alert.png
- (93.33 KiB) Downloaded 1139 times
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Plot time of a study's price change in scanner [SOLVED]
Hello darob,
Here is a sample code for that:
Here is a sample code for that:
Code: Select all
using System;
using System.Drawing;
namespace PowerLanguage.Indicator
{
public class price_change : IndicatorObject
{
private IPlotObjectStr Plot1;
private IPlotObjectStr Plot2;
public price_change (object ctx)
: base(ctx)
{
}
[Input]
public int ExchangeShift { get; set; }
protected override void Create()
{
Plot1 = AddPlot(new StringPlotAttributes("BarCloseTime", Color.Red));
Plot2 = AddPlot(new StringPlotAttributes("BarUpdateTime", Color.Red));
}
protected override void StartCalc()
{
}
protected override void CalcBar()
{
Plot1.Set(Bars.TimeValue.ToString());
Plot2.Set(DateTime.Now.AddHours(ExchangeShift).ToString());
}
}
}