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.

StochRsi - a little help needed
 Post subject: StochRsi - a little help needed Post rating: 0   Post Posted: Thu 29 Sep, 2011, 18:59 

User rating: 0
Joined: Sun 11 Sep, 2011, 17:43
Posts: 10
Location: Bulgaria,
Hi guys,

I was wondering on how to use the cross of the fastDPeriod and fastKPeriod to initialize a trade...so far I have:

       
if (stochrsi[fastKPeriod] > stochrsi[fastDPeriod]) {
                    order = engine.submitOrder(getLabel(instrument), instrument, OrderCommand.BUY, lots, 0, 5,
                            lowPrice, tick.getAsk() + instrument.getPipValue() * takeProfit);
}


and stochrsi is defined as:

stochrsi = indicators.stochRsi(instrument, myPeriod, OfferSide.BID, AppliedPrice.MEDIAN_PRICE, 3, fastKPeriod, fastDPeriod, IIndicators.MaType.SMA, 0)


additionally, fastKPeriod is defined:

private int fastKPeriod = 10;


and fastDPeriod is defined:

private int fastDPeriod = 12;


Unfortunately, although the compiler shows no errors, no orders are submitted or filled.
Any suggestions?


 
 Post subject: Re: StochRsi - a little help needed Post rating: 0   Post Posted: Mon 03 Oct, 2011, 07:37 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Apparently you are using the wrong indices in your value retrievals. For indicator calculation see:
https://www.dukascopy.com/wiki/index.php ... alculation
And for application of a similar indicator, see:
https://www.dukascopy.com/wiki/index.php ... Stochastic
To find out what index stands for which output array, see:
https://www.dukascopy.com/wiki/index.php ... r_metadata


 
 Post subject: Re: StochRsi - a little help needed Post rating: 0   Post Posted: Mon 03 Oct, 2011, 11:05 

User rating: 0
Joined: Sun 11 Sep, 2011, 17:43
Posts: 10
Location: Bulgaria,
Thanks.


 

Jump to:  

cron
  © 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