ForexConnect API 1.4.1 beta

Moderator: Moderator

ForexConnect API 1.4.1 beta

Postby Julia CJ » Wed Mar 02, 2016 8:39 am

ForexConnect API 1.4.1 beta version has been released.

Release notes


1. Ability to retrieve information about commissions has been added.
To retrieve information about commissions, use new interface IO2GCommissionsProvider.
New method getCommissionsProvider has been added to the IO2GSession interface.
Using the IO2GCommissionsProvider interface you can:
1. Retrieve lists of commissions for the specified offer and account. For this purpose, use method IO2GCommissionsProvider.getCommissionDescriptions.
2. Calculate estimated commissions for trading operations. For this purpose, use the following methods: IO2GCommissionsProvider.calcOpenCommission, IO2GCommissionsProvider.calcCloseCommission, IO2GCommissionsProvider.calcTotalCommission.

2. The Search function has been updated. It is now possible to search not only for specified values, but also for values that are greater, less or between the specified ones.
New enumeration O2GRelationalOperators has been added. A new parameter with the O2GRelationalOperators type has been added to the following methods:
getNextGenericRowByColumnValue, getNextGenericRowByMultiColumnValues, getNextGenericRowByColumnValues, getNextGenericRowByCondition

3. It is now possible to receive only trading events omitting events caused by data recalculation. New method setTableEventsFilter has been added to the IO2GTable interface.

4. Ability to set request timeouts has been added. If a timeout expires and there is no request response, ForexConnect will send the request failed notification.
New methods setRequestsTimeout, getRequestsTimeout have been added to IO2GSession.

5. It is now possible to retrieve notifications about beginning\ending of the table events batch. The events batch is a set of events generated for a table by a single server message. The IO2GUpdatesProcessStatusListener interface has been added.

6. You can choose the mode of the open price for the candle calculation using the Close price of the previous candle or first tick of the current candle. The new parameter has been added to fillMarketDataSnapshotRequestTime.

Breaking changes:

1. New parameter in methods getNextGenericRowByColumnValue, getNextGenericRowByMultiColumnValues, getNextGenericRowByColumnValues.
To simulate the old behavior, the "EqualTo" value of the new parameter should be used.

2. New parameter in the fillMarketDataSnapshotRequestTime.
To simulate the old behaviour, the "PreviousClose" value of the new parameter should be used.
You can download the release here:
Julia CJ

Re: ForexConnect API 1.4.1 beta

Postby triplepointdev » Tue Jul 12, 2016 9:14 pm

trying out 1.4.1 im able to get 1.3.0 to work in eclipse for java but when i try to use 1.4.1 it gives

Exception in thread "main" java.lang.UnsatisfiedLinkError: {path to use}/ForexConnectAPI4/lib/java/ cannot open shared object file: No such file or directory

on linux using eclipse and the java side of the api
Posts: 4
Joined: Tue Jul 12, 2016 6:30 pm

Re: ForexConnect API 1.4.1 beta

Postby triplepointdev » Tue Jul 12, 2016 9:27 pm

Exception in thread "main" java.lang.UnsatisfiedLinkError: {$PATH}/ForexConnectAPI4/lib/java/ cannot open shared object file: No such file or directory
I'm using eclipse java side of the API

I'm able to get 1.3.0 to work and run sample in eclipse.
Posts: 4
Joined: Tue Jul 12, 2016 6:30 pm

Re: ForexConnect API 1.4.1 beta

Postby Julia CJ » Fri Jul 15, 2016 2:25 am

Hi Triplepointdev,

1) We have prepared the example of successfully working project eclipse. You can find this file in your e-mail.
2) Please write the name of using eclipse version, Java version, using build. If you use the build of script (ant,maven) you need to apply such script.
3) If you have Java 1.6 version or more earlier version, please update it to 1.7 minimum.

The Java 1.6 version is not recommended to use: ... 19409.html

There is written: "These older versions of the JRE and JDK are provided to help developers debug issues in older systems. They are not updated with the latest security patches and are not recommended for use in production."
Julia CJ

Re: ForexConnect API 1.4.1 beta

Postby triplepointdev » Fri Jul 15, 2016 4:08 pm

java -Djava.library.path={path}/workspace/API/ForexConnectAPI4/lib/.:{path]/workspace/API/ForexConnectAPI4/lib/java/. forexconnect_check.Trader

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: com/fxcore2/IO2GSessionStatus
Posts: 4
Joined: Tue Jul 12, 2016 6:30 pm

Re: ForexConnect API 1.4.1 beta

Postby Julia CJ » Mon Jul 25, 2016 3:45 am

Hi Triplepointdev,

1)We recommend you to use build scripts ( you can take as a basis ant-scripts in the samples). Using them will be easier to reference the libraries after build.

2) If you want to use the command line, you need to add classpath instead of Djava.library.path by using appropriate command. For example,

- the compilation: javac *.java -classpath /home/computer/user/build/www-fxcorporate-com/ForexConnectAPI-1.4/ForexConnectAPI-1.4-Linux-x86_64/lib/java/fxcore2.jar

- launch: java -cp /home/computer/user/build/www-fxcorporate-com/ForexConnectAPI-1.4/ForexConnectAPI-1.4-Linux-x86_64/lib/java/fxcore2.jar: forexconnect_check.Trader

3)In any case, if you can launch any sample (for example, login), it means forexconnect is compiled correctly. If you see “java.lang.NoClassDefFoundError” , it indicates the existence of some problem in local environment and the way was written incorrectly somewhere or the connection of libraries was made in a wrong way.
Julia CJ

Re: ForexConnect API 1.4.1 beta

Postby Amanda » Tue Aug 02, 2016 8:59 pm

Where can I download the API for .NET? All the download links are broken. Could you update the links please?
Posts: 1
Joined: Tue Aug 02, 2016 8:34 pm

Re: ForexConnect API 1.4.1 beta

Postby Julia CJ » Wed Aug 03, 2016 4:10 am

Hi Amanda,

Everything should work at this moment, please try to load again.
Julia CJ

Re: ForexConnect API 1.4.1 beta

Postby vetocch » Mon Nov 28, 2016 10:15 pm


I need help ! trying to test login sample , but always got
Exception in thread "main" java.lang.UnsatisfiedLinkError: E:\projects\java\FXCM\login\fxcore2.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(
at java.lang.ClassLoader.loadLibrary(
at java.lang.Runtime.loadLibrary0(
at java.lang.System.loadLibrary(
at com.fxcore2.O2GTransport.<clinit>(Unknown Source)
at login.Main.main(
my env : 10 professional 64 bit
2.JDK 1.8.0_112
3.netbeans IDE 8.2
4. I puy all dll files and java\fxcore2.jar,java\fxcore2.dll which included in C:\Program Files\Candleworks\ForexConnectAPIx64\bin to E:\projects\java\FXCM\login
then set working directory to E:\projects\java\FXCM\login, VM options : -Djava.library.path=.;

what should I do to make it works ?? thank you !!
Posts: 3
Joined: Mon Nov 28, 2016 10:00 pm

Re: ForexConnect API 1.4.1 beta

Postby Sergey.Konovalov » Tue Dec 06, 2016 5:09 am

Hello vetocch,

Please confirm that you have completed the following ForexConnect API Help items:

How to include ForexConnect API in Java


The article discusses how to include ForexConnect API in Java application.


Let's say ForexConnect API is installed to C:\Program Files\Candleworks\ForexConnectAPI.
To include ForexConnect API in your Java application, you should:

Add fxcore2.jar to the libraries
In NetBeans: Libraries->Add JAR/Folder
In Eclipse: Project->Properties->Java Build Path->Libraries tab->Add External JARs
Add: C:\Program Files\Candleworks\ForexConnectAPI\bin\java\fxcore2.jar

Change working directory
In Netbeans: Run->Working Directory
In Eclipse: Project->Properties->Run/Debug Settings->New->(Select Configuration Type)->Main tab (Pick the main class)->Arguments tab->Working Directory (click "Other")
Add: C:\Program Files\Candleworks\ForexConnectAPI\bin

Send java.library.path to Java VM
In Netbeans: Project->Properties->Run->VM options
In Eclipse: Project->Properties->Run/Debug Settings->(pick up configuration you just created)->Arguments tab->VM arguments
Add: -Djava.library.path=.;./java (path for Windows)

Add namespace com.fxcore2 to your project:
import com.fxcore2.*;
Posts: 15
Joined: Fri Dec 02, 2016 1:44 am


Return to ForexConnect API

Who is online

Users browsing this forum: No registered users and 1 guest