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.

How to make the time period a variable when calling indicato
 Post subject: How to make the time period a variable when calling indicato Post rating: 0   New post Posted: Thu 12 Jan, 2012, 22:27 

User rating: 0
Joined: Sat 19 Nov, 2011, 01:24
Posts: 23
Location: United Kingdom,
The below code doesn't work, how can I make the period in the rsi indicator a variable?

If(value=1){String tim="Period.TEN_MINS";}
If(value=2){String tim="Period.FIVE_MINS";}
If(value=3){String tim="Period.ONE_MINS";}

double RSI=indicators.rsi(selectedInstrument, tim, OfferSide.BID, IIndicators.AppliedPrice.CLOSE, RSI_Period, 0);


 
 Post subject: Re: How to make the time period a variable when calling indi Post rating: 0   New post Posted: Fri 13 Jan, 2012, 09:58 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See (for used variable value assignments see the beginning of the article):
https://www.dukascopy.com/wiki/#Indicato ... _Deviation
For more on indicator usage in strategy, see:
https://www.dukascopy.com/wiki/#Strategy_API:_Indicators


 
 Post subject: Re: How to make the time period a variable when calling indi Post rating: 0   New post Posted: Sun 15 Jan, 2012, 12:13 

User rating: 0
Joined: Sat 19 Nov, 2011, 01:24
Posts: 23
Location: United Kingdom,
Ah yes thank you.


 

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