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.

Learning to convert indicators and getting frustrated not being able to write java
 Post subject: Learning to convert indicators and getting frustrated not being able to write java Post rating: 0   New post Posted: Thu 21 Feb, 2013, 02:25 

User rating: 1
Joined: Fri 08 Feb, 2013, 13:23
Posts: 8
Hello,

I am trying to transfer a series of indicators from MT4 to JForex, I managed to find a code converter at https://code.google.com/p/mql4-connector/

What it does is convert MQL files into java. Then all java files are placed in JForex/indicators folder so I can open them within JForex. These are the steps I implemented:

Left hand side, right click in “Custom Indicators  Open indicator”, I select the indicator and it is opened in JForex. Within that screen there is a button that is the compile (F5) option. Once I click several of them come back with error messages within the code itself and three of them with a message “Cannot instantiate indicator” that I do not know what it means. Indicator with this message has a [1] sign in the list below. It follows a list of indicator I tried to compile.

My java knowledge is almost zero. Can anyone help me to find the solutions? Thanks.

These are the indicators:

Indicator TMA
TMABand
TMAChannel_End_Point [1]
TMAslopev14B430
TMATrue [1]
TMATruev2152
TMATruewithDistancexx [1]
THVTRIXv601_mod

The error messages list follows:

2013-02-21 00:09:20 ----------
2013-02-21 00:09:20 Incompatible operand types String and Instrument
2013-02-21 00:09:20 ^^^^^^^^^^^^^^^^^^^^
2013-02-21 00:09:20 if (ld_380==ld_388&&ls_412==Instrument()&&ld_396==Time(4)-Time(5)&&Bars-l_bars_364<2.0){
2013-02-21 00:09:20 2. ERROR in F:\Documents and Settings\Carlos\Local Settings\JForex\Carlos\jfxide\tmp\compile\THVTrixv601_mod.java (at line 284)
2013-02-21 00:09:20 ----------
2013-02-21 00:09:20 Invalid character constant
2013-02-21 00:09:20 ^^^^^^^^^^^^^^^^
2013-02-21 00:09:20 @Configurable("") public Color text1Color=toColor(C'0x77,0x77,0x00');
2013-02-21 00:09:20 1. ERROR in F:\Documents and Settings\Carlos\Local Settings\JForex\Carlos\jfxide\tmp\compile\THVTrixv601_mod.java (at line 43)
2013-02-21 00:09:20 ----------
2013-02-21 00:09:19 Compiling THVTrixv601_mod.java
2013-02-20 23:59:24 Cannot instantiate indicator
2013-02-20 23:59:24 jforex.converted.TmaTruewithDistancesxx.toInt(Ljava/lang/Number;)I
2013-02-20 23:59:23 Compilation successful. Indicator ID: 799287FA64CF47CD840FC08BDB873B92
2013-02-20 23:59:22 Compiling TmaTruewithDistancesxx.java
2013-02-20 23:58:58 ----------
2013-02-20 23:58:58 The public type j102TMATRUEv2152 must be defined in its own file
2013-02-20 23:58:58 ^^^^^^^^^^^^^^^^
2013-02-20 23:58:58 public class j102TMATRUEv2152 extends MQL4ConnectorIndicator {
2013-02-20 23:58:58 1. ERROR in F:\Documents and Settings\Carlos\Local Settings\JForex\Carlos\jfxide\tmp\compile\TMATRUEv2152.java (at line 9)
2013-02-20 23:58:58 ----------
2013-02-20 23:58:58 Compiling TMATRUEv2152.java
2013-02-20 23:57:38 Cannot instantiate indicator
2013-02-20 23:57:38 jforex.converted.TmaTrue.toInt(Ljava/lang/Number;)I
2013-02-20 23:57:38 Compilation successful. Indicator ID: 060F3B30379F3F60B79E9929A88698B7
2013-02-20 23:57:37 Compiling TmaTrue.java
2013-02-20 23:57:17 ----------
2013-02-20 23:57:17 The public type j102TMAslopev14B430 must be defined in its own file
2013-02-20 23:57:17 ^^^^^^^^^^^^^^^^^^^
2013-02-20 23:57:17 public class j102TMAslopev14B430 extends MQL4ConnectorIndicator {
2013-02-20 23:57:17 1. ERROR in F:\Documents and Settings\Carlos\Local Settings\JForex\Carlos\jfxide\tmp\compile\TMAslopev14B430.java (at line 9)
2013-02-20 23:57:17 ----------
2013-02-20 23:57:16 Compiling TMAslopev14B430.java
2013-02-20 23:55:55 Cannot instantiate indicator
2013-02-20 23:55:55 jforex.converted.TMAChannel_End_Point.toInt(Ljava/lang/Number;)I
2013-02-20 23:55:55 Compilation successful. Indicator ID: A714C7B848D809A7F634AFBC727D8409
2013-02-20 23:55:53 Compiling TMAChannel_End_Point.java
2013-02-20 23:55:28 ----------
2013-02-20 23:55:28 Unreachable code
2013-02-20 23:55:28 ^^^^^^^^^^^^^^^^^^^
2013-02-20 23:55:28 if(true)return 0.0;}
2013-02-20 23:55:28 1. ERROR in F:\Documents and Settings\Carlos\Local Settings\JForex\Carlos\jfxide\tmp\compile\TMABand.java (at line 138)
2013-02-20 23:55:28 ----------
2013-02-20 23:55:28 Compiling TMABand.java
2013-02-20 23:32:47 ----------
2013-02-20 23:32:47 Unreachable code
2013-02-20 23:32:47 ^^^^^^^^^^^^^^^^^^^
2013-02-20 23:32:47 if(true)return 0.0;}
2013-02-20 23:32:47 1. ERROR in F:\Documents and Settings\Carlos\Local Settings\JForex\Carlos\jfxide\tmp\compile\IndicatorTMA.java (at line 111)
2013-02-20 23:32:47 ----------
2013-02-20 23:32:47 Compiling IndicatorTMA.java
2013-02-20 22:25:51 Connected.
2013-02-20 22:26:07 Your account has been blocked. Please contact Support Desk.

I will really appreciate if someone can help in fixing these errors.

I attached all java codes.

Thanking in advance.

Kind regards,

Carlos
=


Attachments:
TmaTruewithDistancesxx.java [18.1 KiB]
Downloaded 286 times
TMATRUEv2152.java [13.18 KiB]
Downloaded 284 times
TmaTrue.java [13.61 KiB]
Downloaded 289 times
TMAslopev14B430.java [10.93 KiB]
Downloaded 293 times
TMAChannel_End_Point.java [2.6 KiB]
Downloaded 287 times
TMABand.java [4.68 KiB]
Downloaded 291 times
THVTrixv601_mod.java [13.44 KiB]
Downloaded 290 times
IndicatorTMA.java [3.63 KiB]
Downloaded 294 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: Learning to convert indicators and getting frustrated not being able to write java Post rating: 0   New post Posted: Thu 21 Feb, 2013, 08:28 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
This is a third party library which does not get supported neither by the platform nor in this forum, either you need to use the MQL converter for your indicators:
https://www.dukascopy.com/wiki/#MQL_Converter
Or write them by using the JForex Indicator API, start here:
https://www.dukascopy.com/wiki/#Indicator_API:_Overview


 
 Post subject: Re: Learning to convert indicators and getting frustrated not being able to write java Post rating: 0   New post Posted: Mon 25 Feb, 2013, 04:42 

User rating: 1
Joined: Fri 08 Feb, 2013, 13:23
Posts: 8
All the indicators are freely available at forexfactory website, this is the thread:

https://www.forexfactory.com/showthread.php?t=343533

The author posted in a zip file all of them, so if they can be used with MT4, I should be able to converted into JForex platform. This was my thinking at the time of posting and asking for assistance. :?


 
 Post subject: Re: Learning to convert indicators and getting frustrated not being able to write java Post rating: 0   New post Posted: Mon 25 Feb, 2013, 08:31 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please specify what kind of additional assistance you require.


 

Jump to:  

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