Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Plotting Indicators from a Strategy
 Post subject: Plotting Indicators from a Strategy Post rating: 0   Post Posted: Sun 19 May, 2013, 13:29 

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


 
 Post subject: Re: Plotting Indicators from a Strategy Post rating: 0   Post Posted: Mon 20 May, 2013, 16:13 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
use:
chart.addIndicator(getIndicators().getIndicator("STOCH"), new Object[]{14, 3, IIndicators.MaType.SMA.ordinal(), 3, IIndicators.MaType.EMA.ordinal()});


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com