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.

using encog - neural networks
 Post subject: using encog - neural networks Post rating: 0   New post Posted: Fri 28 Dec, 2012, 09:52 
User avatar

User rating: 2
Joined: Fri 02 Mar, 2012, 22:08
Posts: 200
Location: New Zealand, Dunedin
Hi all

I wish to incorporate encog in my strategy
My understanding is that I need to use @Library("......jar") but am unclear about two things

1) Am I right in understanding that a full path is required if you place the encog.jar file in the files folder

2) It is not clear to me which encog.jar file is the correct one to use

Thank you

Bob M
Dunedin
New Zealand


 
 Post subject: Re: using encog - neural networks Post rating: 0   New post Posted: Fri 28 Dec, 2012, 15:46 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
us_copiosus wrote:
1) Am I right in understanding that a full path is required if you place the encog.jar file in the files folder
The full path is always required.


 
 Post subject: Re: using encog - neural networks Post rating: 0   New post Posted: Fri 28 Dec, 2012, 16:23 
User avatar

User rating: 70
Joined: Sat 22 Sep, 2012, 17:43
Posts: 118
Location: Brazil, Fortaleza, Ceará
The .jar files you're looking for depend where you obtained them.
For the latest Encog version 3.1.0 installations, you need the following jars

if you downloaded encog-core-3.1.0-release.zip

jar you want is encog-core-3.1.0.jar found in the <ENCOG_CORE_INSTALL>\lib directory

if you downloaded encog-examples-3.1.0.zip

jar you want is encog-core-3.1.0-SNAPSHOT.jar found in the <ENCOG_EXAMPLES_INSTALL>\lib directory

Both jars are essentially the same.
Where ever any of these jar files reside, your strategy needs the full path to either.


 
 Post subject: Re: using encog - neural networks Post rating: 0   New post Posted: Fri 28 Dec, 2012, 16:34 
User avatar

User rating: 2
Joined: Fri 02 Mar, 2012, 22:08
Posts: 200
Location: New Zealand, Dunedin
Thank you so much for the responses............................
However when I compile my strategy I get the following single error message
**************************
Code is as follows:-

import java.util.logging.Level;
import java.util.logging.Logger;

@RequiresFullAccess
@Library("C:/Users/Stan/My Documents/JForex/Strategies/files/JFUtil.jar;C:/Users/Stan/My Documents/JForex/Strategies/files/encog-core-3.0.0-SNAPSHOT.jar")

import com.quantisan.JFUtil.JForexAccount;
import com.quantisan.JFUtil.JForexContext;
****************************

error message
***************************
2012-12-28 15:08:15 ----------
2012-12-28 15:08:15 Syntax error on token(s), misplaced construct(s)
2012-12-28 15:08:15 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2012-12-28 15:08:15 @Library("C:/Users/Stan/My Documents/JForex/Strategies/files/JFUtil.jar;C:/Users/Stan/My Documents/JForex/Strategies/files/encog-core-3.0.0-SNAPSHOT.jar")
2012-12-28 15:08:15 @RequiresFullAccess
2012-12-28 15:08:15 1. ERROR in C:\Users\Stan\AppData\Local\Temp\jfxide\tmp\compile\NeuralStrategy.java (at line 31)
2012-12-28 15:08:15 ----------
**************************

Bob M
New Zealand


 
 Post subject: Re: using encog - neural networks Post rating: 0   New post Posted: Fri 28 Dec, 2012, 16:53 
User avatar

User rating: 70
Joined: Sat 22 Sep, 2012, 17:43
Posts: 118
Location: Brazil, Fortaleza, Ceará
The compiler doesn't like those imports you placed after the @ constructs. Move the quantisan imports back up with the java.util ones.


 
 Post subject: Re: using encog - neural networks Post rating: 0   New post Posted: Fri 28 Dec, 2012, 17:59 
User avatar

User rating: 2
Joined: Fri 02 Mar, 2012, 22:08
Posts: 200
Location: New Zealand, Dunedin
Hi

did what you suggested.........
***************************
2012-12-28 16:57:43 ----------
2012-12-28 16:57:43 The attribute value is undefined for the annotation type Library
2012-12-28 16:57:43
2012-12-28 16:57:43 @Library("C:/Users/Stan/My Documents/JForex/Strategies/files/JFUtil.jar;C:/Users/Stan/My Documents/JForex/Strategies/files/encog-core-3.1.0.jar")
2012-12-28 16:57:43 3. ERROR in C:\Users\Stan\AppData\Local\Temp\jfxide\tmp\compile\NeuralStrategy.java (at line 51)
2012-12-28 16:57:43 ----------
2012-12-28 16:57:43 Library cannot be resolved to a type
2012-12-28 16:57:43 ^^^^^^^
2012-12-28 16:57:43 @Library("C:/Users/Stan/My Documents/JForex/Strategies/files/JFUtil.jar;C:/Users/Stan/My Documents/JForex/Strategies/files/encog-core-3.1.0.jar")
2012-12-28 16:57:43 2. ERROR in C:\Users\Stan\AppData\Local\Temp\jfxide\tmp\compile\NeuralStrategy.java (at line 51)
2012-12-28 16:57:43 ----------
2012-12-28 16:57:43 RequiresFullAccess cannot be resolved to a type
2012-12-28 16:57:43 ^^^^^^^^^^^^^^^^^^
2012-12-28 16:57:43 @RequiresFullAccess
2012-12-28 16:57:43 1. ERROR in C:\Users\Stan\AppData\Local\Temp\jfxide\tmp\compile\NeuralStrategy.java (at line 50)
***************************

The compiler is still not happy :)

Bob M
New Zealand


 
 Post subject: Re: using encog - neural networks Post rating: 0   New post Posted: Fri 28 Dec, 2012, 18:21 
User avatar

User rating: 70
Joined: Sat 22 Sep, 2012, 17:43
Posts: 118
Location: Brazil, Fortaleza, Ceará
2012-12-28 16:57:43 Library cannot be resolved to a type
2012-12-28 16:57:43 ^^^^^^^
2012-12-28 16:57:43 RequiresFullAccess cannot be resolved to a type
2012-12-28 16:57:43 ^^^^^^^^^^^^^^^^^^


These types belong in the com.dukascopy.api package. If you haven't imported com.dukascopy.api.* the compiler won't know about them.

You can also:

import com.dukascopy.api.Library; https://www.dukascopy.com/client/javadoc/com/dukascopy/api/Library.html
import com.dukascopy.api.RequiresFullAccess; https://www.dukascopy.com/client/javadoc/com/dukascopy/api/RequiresFullAccess.html

However, If you're compilng outside of JForex, then perhaps the dukascopy client libraries are not on your classpath.

Hopefully your coming from some other programming language and are just getting used to Java. The type of programming you are considering doing
(AI/ML/NN) is going to give you headaches if you're not one for fine detail.

Every JForex strategy file you see has dukascopy imports - study the examples - compile the examples - play around with them.
The same goes for Encog. Study the examples, compile the examples and play around with them outside of JForex.
Then bring both experiences together seamlessly :)

All the best.


 
 Post subject: Re: using encog - neural networks Post rating: 0   New post Posted: Fri 28 Dec, 2012, 18:30 
User avatar

User rating: 2
Joined: Fri 02 Mar, 2012, 22:08
Posts: 200
Location: New Zealand, Dunedin
Thank you - so simple, when you know

Happy New Year to you all

Bob M


 

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