- ago
Hi, Do you have a sample indicator for a bar chart type indicator? I am trying to create one. Do you create a loop to populate the O, H, L, C. Or create a separate indicator for each one?
0
1,047
Solved
5 Replies

Reply

Bookmark

Sort
Cone8
 ( 4.98% )
- ago
#1
IndicatorBase derives from TimeSeries, so an "indicator" can only be 1 TimeSeries.... you'd need to create 4 of them.

Version 6 had a PlotSyntheticSymbol that would put 4 series together using the chart style. We'd need to add that again for v7.
0
- ago
#2
All righty. Thank you
0
- ago
#3
Not sure if the extra method is required. You could build a BarHistory object with your OHLC and plot it using PlotBarHistory:

CODE:
public override void Initialize(BarHistory bars) {          BarHistory bh = new BarHistory("test", HistoryScale.Daily);          for (int i = 0; i < bars.Count;i++)             bh.Add(bars.DateTimes[i], bars.Open[i] *0.98, bars.High[i] * 1.02, bars.Low[i] * 0.97, bars.Close[i] * 0.99, 1);          PlotBarHistory(bh, "TEST"); }
1
Best Answer
Cone8
 ( 4.98% )
- ago
#4
Nice! Good thinking. Will have to note that for the WL6 to WL7 QuickRef Conversion
1
- ago
#5
I like the solution in Reply# 3 best for its simplicity; however, if you're willing to create four separate companion TimeSeries instances (Are you?) and define a GetBarChartCompanion() method (to identify these TimeSeries), then PlotStyle BarChart may be an alternative option. See PlotStyles BarChart in https://www.wealth-lab.com/Support/ExtensionApi/IndicatorLibrary

I "think" the BarChart approach is trying to emulate PlotSyntheticSymbol() from WL6 in a weird way. Both approaches have their pros and cons. The BarChart approach is definitely to be used only with an indicator design.
0

Reply

Bookmark

Sort