|
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.
Improved getFXSentimentIndex - Add Filtering |
bradhallett
|
Post subject: Improved getFXSentimentIndex - Add Filtering |
Post rating: 0
|
Posted: Thu 18 Apr, 2013, 01:51
|
|
User rating: 3
Joined: Thu 17 Nov, 2011, 04:06 Posts: 39 Location: Canada, Ottawa
|
The current version of getFXSentimentIndex is as follows: getFXSentimentIndex(Instrument instrument, Period period, long from, long to)
This version returns null values during weekends. An improvement would be to allow filtering, such as: getFXSentimentIndex(Instrument instrument, Period period, Filter filter, long from, long to)
The following version would also be useful: getFXSentimentIndex(Instrument instrument, Period period, Filter filter, int numberOfCandlesBefore, long time, int numberOfCandlesAfter)
|
|
|
|
 |
API Support
|
Post subject: Re: Improved getFXSentimentIndex - Add Filtering |
Post rating: 0
|
Posted: Thu 18 Apr, 2013, 07:28
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
bradhallett wrote: This version returns null values during weekends. An improvement would be to allow filtering, such as: getFXSentimentIndex(Instrument instrument, Period period, Filter filter, long from, long to)
The following version would also be useful: getFXSentimentIndex(Instrument instrument, Period period, Filter filter, int numberOfCandlesBefore, long time, int numberOfCandlesAfter) Consider calculating the sentiment index as indicator, see: https://www.dukascopy.com/wiki/#Sentiment_index/Call_Sentiment_Index_as_indicatorinstead of using the from-to calculateIndicator method, use one which uses Filter.
|
|
|
|
 |
bradhallett
|
Post subject: Re: Improved getFXSentimentIndex - Add Filtering |
Post rating: 0
|
Posted: Fri 19 Apr, 2013, 11:32
|
|
User rating: 3
Joined: Thu 17 Nov, 2011, 04:06 Posts: 39 Location: Canada, Ottawa
|
Is it possible to get the a currency's sentiment (ie. GBP) instead of a symbol via indicator? If so, can you please demonstrate how this is possible?
|
|
|
|
 |
API Support
|
Post subject: Re: Improved getFXSentimentIndex - Add Filtering |
Post rating: 0
|
Posted: Fri 19 Apr, 2013, 11:38
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Change SentimentIndexBarIndicator.DataSource in the optional inputs.
|
|
|
|
 |
bradhallett
|
Post subject: Re: Improved getFXSentimentIndex - Add Filtering |
Post rating: 0
|
Posted: Fri 19 Apr, 2013, 11:51
|
|
User rating: 3
Joined: Thu 17 Nov, 2011, 04:06 Posts: 39 Location: Canada, Ottawa
|
Would this work? new Object[] { SentimentIndexBarIndicator.SentimentMode.CHART_PERIOD.ordinal(), SentimentIndexBarIndicator.DataSource.Currency.getInstance("GBP"), SentimentIndexBarIndicator.MAX_BARS_DEFAULT }
|
|
|
|
 |
API Support
|
Post subject: Re: Improved getFXSentimentIndex - Add Filtering |
Post rating: 0
|
Posted: Fri 19 Apr, 2013, 11:56
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
 |
bradhallett
|
Post subject: Re: Improved getFXSentimentIndex - Add Filtering |
Post rating: 0
|
Posted: Fri 19 Apr, 2013, 12:16
|
|
User rating: 3
Joined: Thu 17 Nov, 2011, 04:06 Posts: 39 Location: Canada, Ottawa
|
Based on the Netbeans, it looks like the coding would be: Object[] values2 = indicators.calculateIndicator(instrument, period, new OfferSide[] { OfferSide.ASK }, "SentimentBar", new AppliedPrice[] { IIndicators.AppliedPrice.CLOSE }, new Object[] { SentimentIndexBarIndicator.SentimentMode.CHART_PERIOD.ordinal(), SentimentIndexBarIndicator.DataSource.PRIMARY_CURRENCY.ordinal(), SentimentIndexBarIndicator.MAX_BARS_DEFAULT }, from, to); To get the GBP, I would need to use an instrument such as the GBP/USD. Is this correct?
|
|
|
|
 |
API Support
|
Post subject: Re: Improved getFXSentimentIndex - Add Filtering |
Post rating: 0
|
Posted: Fri 19 Apr, 2013, 12:22
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Test the code and report if any issues.
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|