Dukascopy
 
 
Wiki JStore Search Login

JFOREX-2830 Multi instrument Indicator problem
 Post subject: JFOREX-2830 Multi instrument Indicator problem Post rating: 0   New post Posted: Wed 09 Mar, 2011, 08:29 

User rating: 0
Joined: Thu 19 Aug, 2010, 13:53
Posts: 62
Hi,

Can you please have a look at this indicator . Download: https://www.tektronic.ro/problem.zip
Ignore what it does and errors shown. Basically, calculates the correlation between 2 instruments.

When I first time use Add Custom indicator, the first below image appears. The indicator correctly identifies the pairs names at that indexes 20 & 21.

Index: 21 Name: AUDCAD Ord: 29
Index: 20 Name: AUDCHF Ord: 30

After I click Ok , the indicator gives me in void setOptInputParameter(int index, Object value) the values (ordinals) at index 20 & 21, which are 29 & 30 and I use to detect the pairs selected. You can see in the second capture I get them correct.

But indicator settings line shows wrong data as you see in the second image. It appears that instead to use the value (instrument ordinal) from that indexes it uses the index itself as value.

I am not sure if I am wrong, think no. But if this is a bug/problem with JForex I please you let me know before you start fix it so I can know and go doing other stuff meantime.
Overall, I would like to know if I am on the correct way in logic of this indicator. Is something else I should take care or I do wrong ?

Image
Image


 
 Post subject: Re: JFOREX-2830 Multi instrument Indicator problem Post rating: 0   New post Posted: Thu 10 Mar, 2011, 11:32 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
Please try the following:
public void onStart(IIndicatorContext context) {
  ...
  for(int i=0;i<aInstrLen;i++) {
         aInstrOrd[i] = aInstruments[i].ordinal();
          aInstrNames[i] = aInstruments[i].name();
  }
  ...
  optInputParameterInfos = new OptInputParameterInfo[] {
   new OptInputParameterInfo("Period",OptInputParameterInfo.Type.OTHER, new IntegerRangeDescription(14,2,100,1)),
   new OptInputParameterInfo("Instrument 1",OptInputParameterInfo.Type.OTHER,new IntegerListDescription(Instrument.AUDCHF.ordinal(),aInstrOrd,aInstrNames)),
   new OptInputParameterInfo("Instrument 2",OptInputParameterInfo.Type.OTHER,new IntegerListDescription(Instrument.AUDCAD.ordinal(),aInstrOrd,aInstrNames))      
  };      
  ...
}


 
 Post subject: Re: JFOREX-2830 Multi instrument Indicator problem Post rating: 0   New post Posted: Thu 10 Mar, 2011, 14:08 

User rating: 0
Joined: Wed 08 Jun, 2011, 10:19
Posts: 29
Location: North Pole
Hi,
How do we perform forced synchronization of input arrays?
Support, you're already working on it?


 
 Post subject: Re: JFOREX-2830 Multi instrument Indicator problem Post rating: 0   New post Posted: Thu 10 Mar, 2011, 14:25 

User rating: 0
Joined: Thu 19 Aug, 2010, 13:53
Posts: 62
Quote:
Hi,
Please try the following:


I deliberately put them viceversa and the problem appeared. Is this wrong ?
It should not matter how I put the ordinals in array, it think.


 
 Post subject: Re: JFOREX-2830 Multi instrument Indicator problem Post rating: 0   New post Posted: Wed 16 Mar, 2011, 14:29 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
This is how IntegerListDescription works at the moment, you have to put values in ascending order.


 

Jump to:  

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