User rating: 0
Joined: Sun 19 May, 2013, 13:23 Posts: 2
Hi all,
I am trying to plot my strategy indicators to the chart.
It is working well with ema and rsi but when I try to add a stochastic indicator I cannot figure out how to set the optional parameters. I was able to find out that it expects the following:
12:16:10 Output 1: Slow %D - DOUBLE 12:16:10 Output 0: Slow %K - DOUBLE 12:16:10 Opt Input 4: Slow %D MAType - OTHER 12:16:10 Opt Input 3: Slow %D Period - OTHER 12:16:10 Opt Input 2: Slow %K MAType - OTHER 12:16:10 Opt Input 1: Slow %K Period - OTHER 12:16:10 Opt Input 0: Fast %K Period - OTHER 12:16:10 Input 0: Price - PRICE 12:16:10 Stochastic: input count=1, optional input count=5, output count=2
but when using:
chart.addIndicator(getIndicators().getIndicator("STOCH"), new Object[]{14, 3, IIndicators.MaType.SMA, 3, IIndicators.MaType.EMA});
I get the error that parameter 2 is wrong type?!
I also tried
chart.addIndicator(getIndicators().getIndicator("STOCH"), new Object[]{14, 3, null, 3, null});
which does not yield an exception but is not plotted as well.
Only chart.addIndicator(getIndicators().getIndicator("STOCH")) works but I want it with my settings.
Would be glad for a suggestion.
Regards Lars
API Support
Post subject: Re: Plotting Indicators from a Strategy