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 force a valid currency pair instance from indicator?
 Post subject: how to force a valid currency pair instance from indicator? Post rating: 0   New post Posted: Mon 15 Mar, 2010, 07:43 

User rating: 1
Joined: Sat 26 Sep, 2009, 21:06
Posts: 13
Hi.. I've already solved the problem with more then one pair in one indicator. Even more I've just found the way how to choose pairs from indicator(via integerList and setInstrument ;) ). But now I have another two bugs:

1. When I change a second currency pair via indicator settings, I have to switch to another TF and go back to the current. Because if I don't do it, the chart won't be updated to the new settings. It looks like InputParameterInfo.setInstrument() can't be updated "on the fly". So is there any way how to "refresh" chart directly from indicator code right after any settings changes?

and the second one:
2. When I choose (as a second currency in my indicator) a currency pair, which I haven't had in platform anytime before, JForex won't show me any error msg even exception and simply will do nothing :roll: I have to subscribe pair I needed, open them into standalone chart window, then restart my indicator with that pair as a second pair and then it will start to work. So Is there any way how to subscribe any new currency pair and download its history from indicator code? When I "hardcode" nonsubscribed exotic currency pair into indicator and compile it, JForex will show me "pair is not subscribed" and will stop indicator context, but.. when I change it in realtime from code, It won't show anything, which is problem.

So would you say, that these problems can be solve or IIndicator interface wasn't developed for that kind of functionality

thanks anyway


 
 Post subject: Re: how to force a valid currency pair instance from indicator? Post rating: 0   New post Posted: Thu 25 Mar, 2010, 16:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
1)The Indicator interface main purpose is to provide a functions which helps to calculate indicators. The main idea of indicator is to get some array of data, do some calculations and represent the result.
We are not sure what exactly are you trying to do, but maybe you should consider to use a strategy for your business logic and use indicator as tool to get indicator value. We have a sample where is used more than one instrument. This could help https://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=6&t=476
2)Thank you for your guidance. We'll fix this. Unfortunately at the moment it's not possible to subscribe for an instrument via API.


 

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