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.

Type mismatch: cannot convert from double[][] to double
 Post subject: Type mismatch: cannot convert from double[][] to double Post rating: 0   New post Posted: Sun 17 Jun, 2012, 19:44 

User rating: 0
Joined: Sat 16 Jun, 2012, 00:18
Posts: 8
Location: Germany, Berlin
Trying to utilize the ht_sine indicator in one of my strategies like this:

htsine [i][j]= indicators.ht_sine(Instrument.fromString(CURRENCY),TIMEFRAME,OFFERSIDE,AppliedPrice.CLOSE,Filter.NO_FILTER,dcshift,bar_time,canafter);


htsine beeing a two dimensional double I am getting the following error:

Type mismatch: cannot convert from double[][] to double.

According to your API Documentation the ht_sine indicator should return a two dimensional array, shouldn`t it?

While I am at it can you please tell me which of the values returned is the lead sine and which the sine?

Kind Regards


 
 Post subject: Re: Type mismatch: cannot convert from double[][] to double Post rating: 2   New post Posted: Sun 17 Jun, 2012, 23:09 
User avatar

User rating: 94
Joined: Mon 06 Feb, 2012, 12:22
Posts: 357
Location: Portugal, Castelo Branco
Hi defc0n1:

I don't know... but if you have

double[][] is a two dimensional array

double[x][y] is pointing to a double only...

try to do the output of the indicator as String on console to see what it returns.

Hope that helps.

Trade well and prospers on your way.

JL


 
 Post subject: Re: Type mismatch: cannot convert from double[][] to double Post rating: 0   New post Posted: Mon 18 Jun, 2012, 08:46 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
jlongo wrote:
Hi defc0n1:

I don't know... but if you have

double[][] is a two dimensional array

double[x][y] is pointing to a double only...

try to do the output of the indicator as String on console to see what it returns.

Hope that helps.

Trade well and prospers on your way.

JL
Hence try assigning the value in the following way (assuming that htsine is of type double[][]):
htsine= indicators.ht_sine(Instrument.fromString(CURRENCY),TIMEFRAME,OFFERSIDE,AppliedPrice.CLOSE,Filter.NO_FILTER,dcshift,bar_time,canafter);


 
 Post subject: Re: Type mismatch: cannot convert from double[][] to double Post rating: 0   New post Posted: Thu 28 Jun, 2012, 01:43 

User rating: 0
Joined: Sat 16 Jun, 2012, 00:18
Posts: 8
Location: Germany, Berlin
Thank you for answering that fixed the problem.

I am printing the output to console now but it doesnt seem to match the output of the indicator.
How many bars back does the standard jforex ht_sine indicator look?
And which of the outputs corresponds to sine and leadsine?

Kind Regards


 
 Post subject: Re: Type mismatch: cannot convert from double[][] to double Post rating: 0   New post Posted: Thu 28 Jun, 2012, 07:55 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
https://www.dukascopy.com/wiki/#Indicator_usage_checklist


 

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