- ago
I'm trying to plot custom overbought and oversold levels with PlotTimeSeriesOscillator, but I'm not getting it to work. See screenshot. But it does look pretty. I'm running WL8 Build 47.


CODE:
using WealthLab.Backtest; using WealthLab.Core; using WealthLab.Indicators; namespace WealthScript1 {    public class TASC202010 : UserStrategyBase    {       public override void Initialize(BarHistory bars)       {          SMI smi = new SMI(bars,8);          PlotTimeSeriesOscillator((TimeSeries)smi, smi.Description, smi.PaneTag, 40.0, -40.0, WLColor.Fuchsia, WLColor.Green, WLColor.Red);          /* PlotIndicator(smi, WLColor.Fuchsia);          DrawLine(0, 40,bars.Count-1, 40,WLColor.Green,2,LineStyle.Dotted,smi.PaneTag);          DrawLine(0,-40,bars.Count-1,-40,WLColor.Red, 2,LineStyle.Dotted,smi.PaneTag); */       }       public override void Execute(BarHistory bars, int idx) { }    } }
0
237
Solved
3 Replies

Reply

Bookmark

Sort
- ago
#1
Because you're calling it incorrectly. As per IntelliSense, it should be the other way round:
CODE:
PlotTimeSeriesOscillator((TimeSeries)smi, smi.Description, smi.PaneTag, -40.0, 40.0, WLColor.Fuchsia, WLColor.Green, WLColor.Red);
0
Best Answer
- ago
#2
Thanks a bunch. That's fixes the problem.

Although not essential, it would be nice if it checked for switched parameters and threw a run-time error when that happens. This is an easy mistake to make, and it isn't always recognizable because one confuses the overbought and oversold terminology.
0
Cone8
 ( 4.34% )
- ago
#3
It wouldn't be nice. Maybe someone wants that result.
Ah hell, let's go back to punch cards.
0

Reply

Bookmark

Sort