mjj38
- ago
How do I set the PlotStyle for an indicator in a coded strategy when using a Custom PlotStyle? PlotStyles are set using an enum but the enum for the custom plotstyle enum (I believe) is only generated at build time.
0
444
Solved
4 Replies

Reply

Bookmark

Sort
Glitch8
 ( 8.38% )
- ago
#1
The plan was you'd be able to assign the IndicatorBase.PlotName, but it looks like we never got to testing this case so it doesn't work currently. I enabled this to work in Build 16, so after that point you can use code like this. Replace "Histogram" with your plot style's Name property.

CODE:
public override void Initialize(BarHistory bars) {          ROC r = ROC.Series(bars.Close, 10);          r.PlotName = "Histogram";          PlotIndicator(r); }
1
Best Answer
mjj38
- ago
#2
Perfect. Thanks Glitch!
0
mjj38
- ago
#3
After setting the custom PlotStyle as demonstrated above, is there a way to access the plotstyle to modify the parameters? I have some custom parameters associated with the custom plotstyle I created.
0
Glitch8
 ( 8.38% )
- ago
#4
You could put them into the source TimeSeries Cache and then access them from within the PlotStyle.
1

Reply

Bookmark

Sort