Article Library

Bonjour friends,
The holiday season is upon us, and I wanted to jam through this highly useful article for your research and statistical analysis on how to make R language work for you.This write-up covers the following topics:
  • Introducing R
  • R Installation
  • Installing packages
  • Creating graphs
If you’re not already familiar with R programming, there’s no better time to learn and get started with this powerful little programming pack. In it you can run very detailed statistical analysis in a matter of no time. Knowing how to code and planning your work will help you in your analysis and research. Since R is recognized as a credible statistical package, it’s helpful for you to know how to code with this language to help shape your writings in global currencies.
First thing to know is that R works off of the S language framework developed at Bell labs; and S-PLUS, which is mathematically expressive. So, if you have any experience with coding in S or so-called latex in your research papers, you will quickly learn how to master R programming language.
During my time as an undergrad at the University, I had the privilege of working with really good statistical software for my analy…
Read article
Translate to English Show original
killer195175 avatar

good work

orto leave comments
JForexUtils - A collection of useful java classes for JForex - Part3
Welcome to the third part of the JForexUtils documentation.
In case you missed previous parts:
Part 1
Part 2
All project links are listed at the end of this article.
In this part we will cover the very central context of order submission and change.
The tools for these tasks are easy to use and can be configured for complex scenarios.
All examples can be downloaded as a java file in the ExamplePart3.
Class OrderUtil
This important class handles all order creations and changes.
In Part 2 we've seen how to create an OrderParams object which holds all parameters for an order.
Let's start to use this orderParams object to open a new order:
1)Submit new order to server
This was fairly easy with the help of the orderParams object!
In the first line we create the orderUtil instance and in the second line we pass our previously created orderParams object to the submit method.
This is the minimal use case for opening a new order.
You may have a few questions though:
Q1 Where is the created order?
Q2 What if an exception was thrown; where is it and aren't we supposed to catch it?
Q3 What if the submission was rejected by th…
Read article
Translate to English Show original
orto leave comments
JForexUtils - A collection of useful java classes for JForex - Part2
Welcome to the second part of the JForexUtils documentation.
In case you missed part 1 and want to start from the beginning -> Part 1
In this part we will see how to do pip and amount conversion calculations as well as fetching quotes for an instrument. Finally, we see how to easliy create order parameter instances which are later used for submitting orders to Dukascopy servers.
All following code snippets/pictures can be found as a Java file in ExamplePart2.
All links are listed at the end of this article.
Class CalculationUtil
This class has two aspects: the first are static methods for which you don't need an instance. The second covers calculations for amount conversions between currencies and instruments. These require an instance of CalculationUtil since it relies on live market data.
1)Static pip and amount calculations
Line 1: This method scales an amount to lots; one lot of the JForex platform is represented as 0.1. So the result in the example is 0.12345678.
Line 2: Here the signed pip difference of two prices of an instrument is calculated. The result of 1.12887-1.12743 is 14.4 pips. If you swap the pri…
Read article
Translate to English Show original
Kbelestro avatar
Kbelestro 16 Feb.


Olkiss70 avatar
Olkiss70 21 Feb.

very important work!

zarina avatar
zarina 27 Feb.

it's about programming ?

Nihad avatar
Nihad 27 Feb.

Brilliant, working on a similar project for statistical functions.

FXjuxe avatar
FXjuxe 28 Feb.

@Nihad: Thank you. I also implemented a bridge between JForex and "R". When I have time I will present it here.

orto leave comments
JForexUtils - A collection of useful java classes for JForex - Part1
Dear JForex programmers,
if you have ever felt that strategy programming in JForex is sometimes a cumbersome task, then you will find some help in this and upcoming articles.
I've developed a Java library with lots of tools which greatly simplifies strategy development.
I share this library with you and will describe its features and use cases.
As a preview here are some of the major features you will be able to use:
* Useful tools for creating currencies and instruments
* A very easy to use builder for order parameters
* A powerful class for all order submission or changes. It is thread safe and you can send order commands directly from all threads with one consistent API
* With the help of a calculation tool you can do pip math tasks, convert order amounts etc.
* Quote classes provide an easy way to get the latest ticks/bars. They are also very fast which pays off when doing long backtests
* The most complex class is able to do a merge operation in one go!

Hopefully this preview has quicken your appetite
Please obey these prerequisites:
[list]This article series is for experienced(!!)
Read article
Translate to English Show original
Natalia_Kisenko avatar

excellent work!  are you a programmer?

FXjuxe avatar
FXjuxe 12 Feb.

Thx, I work as software engineer for a big telecommunication company.
I developed this library in my spare time.
The real cool stuff is still to come in the follow up articles.

sonjatrader avatar

good article

CriticalSection avatar

well done FXjuxe - keep up the good work!

Olkiss70 avatar
Olkiss70 21 Feb.

very useful!

orto leave comments
I am no way near a professional programmer or a financial engineer, but I have a dream of becoming a Quant. I am still learning JForex having started doing so this year and wish to share bits of reusable code that make using JForex and VJForex easier for beginners. As I stated, this is going to be moderately basic stuff suited for beginners so “quants” can skip this.
All functions discussed, are available to download here:
OnCandle as Your Start Point
Most strategies in the contest use the onCandle method to start their strategies, but not all utilize the following two fail-safes.
  1. Matching candle instrument to default instrument
  2. Comparing default period to candle period

Checking if the candle instrument is the same as the current default instrument is necessary for situations where a strategy loops through currency pairs looking for qualifying signals or to create a trading currency basket.
Example of Different OnCandle Period and Instruments
The example below checks first for the 20-day Average True Range (ATR) values of 4 pairs before assigning the instrument to trade. Note: It uses the daily candle while a different part of the strategy uses 1-minute candle.
The above two chec…
Read article
Translate to English Show original
Olga18375 avatar
Olga18375 26 Aug.

Good job!! Agree with people!!

anna_n avatar
anna_n 31 Aug.

like it much

amine_chourou avatar

Great stuff !
Thanks for the mention in your article!

RadarTradar avatar

Great article! It fills a real void I feel should have been filled a long time ago. Thank you.

Rolf_LIAO avatar

very useful, thank you

orto leave comments
1. Overview
It is always interesting discussion about automated trading vs. manual trading. In this article I will try to explain how trading ideas can be automated and transferred to strategies by using of visual jforex platform and how it can perform fast analysis of data.
2. Important notes
As all we know any kind of trading involves risk. There are different means to minimize such a risk. Visual jforex platform as far as I know is still in development stage and strategies developed by it are not recommended to use in real environment. If someone decides to use it in real environment he takes all associated risk related to it.
But as I mentioned every trading involves risk. And if I can minimize risk to acceptable to me levels I can use strategy in real environment. Before putting strategy to real environment I usually adhere to rules listed below:
1. Before running strategy in real environment it should be tested for considerable period of time in demo environment;
2. There should be certain places in strategy to stop it in case something goes wrongly (e.g. max. open positions amount, equity targets, use of leverage targets);
3. If strategy is developed using visual jforex str…
Read article
Translate to English Show original
SalviLeana avatar
SalviLeana 13 Apr.

Well done !

Angelwales avatar
Angelwales 14 Apr.

nice work .......  great plan

Julia_Zhulinskaya avatar

looks like a good process

VictoriaVika avatar

very impressive!

bharatholsa avatar

Very good article covering complete strategy building process !!

orto leave comments
1. Overview
In my previous publications I concentrated on strategies to be used in strategy contest development. As presently developed strategy needs further testing and it consumes a lot of time I decided to describe possibilities how visual jforex could be used to implement trading ideas and to use it in demo account.
2. Setting of strategy parameters
Strategy which building will be described in further sections of article is dedicated for catching of small movements inside tight range. Time when strategy to be used could be chosen so that no big movements in selected pair during selected period of time could be predicted. It could be for example be loaded during Asia trading session when most pairs with exception of those with JPY's do not move very intensively.
Thus strategy which will be developed parameters to be as follow:
- Pair - EUR/USD;
- Maximum number of simultaneously opened trades - 3;
- Opening of trade based on 10 min candles if last tick is 1 or more pips higher than candle open - sell trade is executed, if 1 or more pips lower - buy trade I executed. This rule applies if there is no open positions at the moment. If there is one open position additional requireme…
Read article
Translate to English Show original
milaleva avatar
milaleva 16 June


Mani avatar
Mani 17 June

good work +1

Skif avatar
Skif 24 June

как всегда , отличная статья !!!

bharatholsa avatar

nice article ... from the screenshots in your article - the name of the strategy appears to be "fordemo". Can you pls put the visual jforex file for this strategy on your strategy page so that i can understand it better ... thanks.

agddivisas avatar
agddivisas 27 June

very good, I like it!

orto leave comments

Visual JForex is a great Dukascopy tool for building automatic trading strategies. It is easy to use and doesn't require any programming knowledge. Visual JForex is powerful enough to build and test even very complex strategies. In the following article, we will review some tips about this platform.
Dear reader, I have dedicated much thought and many hours to write this article. So I'm really interested in hearing what you think about it. Please comment and share your thoughts! I hope this article will make your experience with Visual JForex more effective and enjoyable. :-)
Learn and Experiment

This is probably the most important tip! You can learn a lot about Visual JForex from videos, as well as the forum (see resources below). After you've gained some knowledge, experiment with it. For example, you can try to convert a trading strategy that you already use into Visual JForex. Here are some great learning resources:
Read article
Translate to English Show original
geula4x avatar
geula4x 31 Oct.

@alifari Thank you :-) Happy trading today :-)

Fxtrader500 avatar

This article is a good introduction to Visual Jforex. Well done!

geula4x avatar
geula4x 1 Nov.

@Fxtrader500 Thank you :-) Happy trading today :-)

frangonve avatar
frangonve 23 Dec.

I need more help to paste the group of blocks. I can find "Copy" in using right-click, but i don't find "paste" or "rename". Thanks

frangonve avatar
frangonve 23 Dec.

I've found how to rename a group of blocks clicking in the edit symbol at the upper left corner of the collapsed group. But still unable to "paste" the group of blocks

orto leave comments
Although I have an extensive programming background, for more than a few years I've stopped doing any programming and started pursuing other career job, so although I did forgot a lot of things I think I can handle the Visual JForex platform and describe you in details my simple EMA crossover system. The process of creating a strategy is what Dukascopy likes to see, so that was the main reason why I've decided to write this article.The main concept for this system is incredibly simple yet unbelievably effective and even if you don't have any programming knowledge, you should be fine by simple following the step-by-step guide from this article.Lets proceed first by giving a short summary of our strategy:Indicators we're going to use: 5EMA, 10EMA, RSI(10).Time Frame: Hourly (very important!).Pairs: Virtually any pair seems to work as this is strictly technical analysis. I recommend sticking to the main currencies and avoiding cross currencies.When to Enter a trade: Enter LONG when the 5EMA crosses the 10EMA from underneath and RSI must be above 50 to warrant entry. Enter SHORT when the 5EMA crosses the 10EMA from the top and RSI must be below 50 to warrant entry.When to Exit a trade:…
Read article
Translate to English Show original
foxybaby avatar
foxybaby 19 Dec.

running on live account

Daytrader21 avatar

foxybaby Please before running it on the live account do some backtesting to see how it has behaved for the last few months. I thing it still needs some improvements.

Nihad avatar
Nihad 3 Mar.

Thanks for the wonderful effort and I suggest you record a youtube video and post it here along, the available videos by DK are primitive. Additionally, any help on building an INDICATOR Block?

Daytrader21 avatar

Nihad Thanks, unlike you I find dukascopy videos very helpfully. I'm not sure I quite understand your question, please can you be more specific?

Senno88 avatar
Senno88 4 Sep.

Is it possible to download this strategy somewhere?

orto leave comments
IntroductionIn my last article i write about how to save JForex values to files, expecting this month to write about saving this values on database. But i need to find and test a simple database that can be used by the most part of our readers without to much settings, configurations et all and i haven't finished it yet. Because of that, i write in this article about sending emails from inside of JForex in reaction to some values or events we want to get informed about them. The information about this subject provided on Dukascopy Wiki is somewhat incomplete and not works "out of the box", because almost all e-mail providers changed the way we can send e-mails using their servers. The example provided on wiki works if you have a insecure smtp (Simple Mail Transfer Protocol) server, and actually this is not used by almost all e-mail providers to avoid spam and unauthorized access. The possibility of sending e-mails inside JForex with events, values or alerts is a good tool for the ones who can't be always looking the charts but want to be alerted when something occurs and have access to their e-mail. With this article you can build your strategy to send e-mails with text only. At t…
Read article
Translate to English Show original
scramble avatar
scramble 30 Mar.

nothing to say! great inputs as always! thanks :)

doctortyby avatar
doctortyby 31 Mar.

keep it up jose

DiamondCutter avatar

good stuff

isobitis avatar
isobitis 1 Apr.

Good work. Works in windows.
However in Linux it throws an exception access denied ("" "" "resolve")

jlongo avatar
jlongo 1 Apr.

isobitis: it seems a problem with your Java permissions not allowing the socket utilization. See permissions policies.

orto leave comments
IntroductionIn first place i want to apologize the gap in time for my articles, but some personal problems prevented me from to have the time, the required concentration and patience to write them. In this article i try to talk about exporting JForex values we want to files on a textual manner for human readability or to CSV (comma separated values) to import them on other programs, for example Excel, Mathlab or any compatible program. Also you can import csv files directly on database. The ideia to this article came from my necessity to export some values for later analisys and use with other objectives without the need to be connected or doing tedious copy and paste of wanted values. In this article i will describe and exemplify all the process and obstacles faced during my learning process to achieve this. With this article you will be capable of extending it for other ideias you might have.The ideia...I need to loop by all available instruments to get some values from them. If we are doing this manually, that will be a tedious and time consuming task. For this article we assume we need the high, open, close, low, range and ATR values from monthly, weekly and daily periods of al…
Read article
Translate to English Show original
soon avatar
soon 20 Feb.

good luck

ecoplace avatar
ecoplace 21 Feb.

good luck , good articl more chance to you

fprophet avatar
fprophet 21 Feb.

I get errors trying to write to file on my Demo account:

with @RequiresFullAccess set:
Error creating or accessing the file: exportdata.txt (Access is denied)

without @RequiresFullAccess set:
Error creating or accessing the file: access denied ( exportdata.txt write)

I have tried various file path-names, without luck
Any thoughts on how to fix this?

fprophet avatar
fprophet 21 Feb.

ok - I figured out that the file has to already exist - this strategy code doesn't appear to be able to create the file ....

jlongo avatar
jlongo 22 Feb.

@fprophet; The strategy create a file if not exist (i tested in windows and linux)... may be any restriction on your filesystem that not allow the creation at the path (UAC of windows can be a reason). The directory reffered must exist. Anyway, to be sure you can change the path to your home directory or use IContext.getFilesDir() + "/filename.txt" to create the file at your home directory or at ".../JForex/Strategies/Files/". I hope that helps. Trade well. JL

orto leave comments
IntroductionIn last article i presented a strategy called “MyOfflineTrades” that allow us to do manual trading on Historical Tester. I have described all steps needed to use it and how to use it. Now i will try to explain how i have developed it and you can use this knowledge to extend or to use it on other projects. I tried to make it in the simplest way i can, maybe some code can be developed in some more efficient ways.MyOfflineTradesOne of first dilemas i faced was to decide how i integrate the form of the strategy on the strategy itself. We have two solutions for that: one as external java source file and import the corresponding class or jar file by calling it as external file. But this approach can create some problems to some users using it. Other solution is to use inner classes and develop the form class inside the strategy itself. This project is a simple one, just a few classes and not too large in code. This way i decided by this second approach and this way i don't need to provide more files than the strategy file itself. The only disavantage is working all the code on only one java file (not advisable to use on large projects). Bellow a snipet code how to do that. Im…
Read article
Translate to English Show original
jlongo avatar
jlongo 6 Nov.

@SpecialFX: yes, netbeans is free, also other ide software as eclipse. I think Dukascopy development use the last one.

LinnuxFX avatar
LinnuxFX 15 Nov.

Helpful tool, hope it help improve your trading skills...

jlongo avatar
jlongo 24 Nov.

Hi Dukascopy Community: I released a new version of this strategy with a small improvement. You can get it at the forum thread at first post... More improvements to come later. Trade well and prosper in your way. JL

doctortyby avatar
doctortyby 25 Nov.

Keep improving the Coding and the Writing Style dear Jose, I appreciate your efforts very much. You should even start your own mentorship progam here on Dukascopy LIVE Tv :) Don't mind the language barrier

jlongo avatar
jlongo 25 Nov.

@"Doc":Thank you as always for your kind words. The language barrier, i think i can get there but for that i need to practice... Unfortunatly i don't have much time available for that.
Have a nice weekend!

orto leave comments
Continuing previous article...Note: On previous article i forget to make the link to the forum thread where you can download this strategy. You can download it here.Image 1: On this image i explain bellow all the strategy window items (on the left) and the option windows for changing Stop Loss and Take Profit respectively after order submition (at center). At the left of the image we have one example of the strategy running where we have two orders closed, three orders submited where two of them are filled (one with profit and one with loss) and one pending order waiting to trigger if the conditions are meet. Also we can see the Stop Loss and Take Profit prices on the red circles if the orders have them. On the green circle we have the price of the pending order and it will be filled when price reach the specified price.Legend of the image (missing items are described on my last article that you can read here).8 - "Pips" or "Value" (default "Pips"): Here you define the way you use to fill the Stop Loss and Take Profit boxes. With the default selected you must fill with the pips amount you want for Stop Loss and Take Profit on each of the corresponding boxes. If you select "Value" …
Read article
Translate to English Show original
doctortyby avatar
doctortyby 16 Oct.

I will have to download all your article series and start building a strategy because you provide great information and setups. Keep writing

ecoplace avatar
ecoplace 28 Oct.

good article , thank you

SmithJr avatar
SmithJr 29 Oct.

Thanks JL for all the work behind this tool. Keep the good work ;)

Cristian_Andres avatar

hello sir Jlongo wanted to thank greatly for his work has saved more than one, but I wanted to tell you that I felt some sadness that partial closure myOfflineTrades.jfx had not, I see that the line appears stop loss and take profit in the graph test or historical backtesting, but can not move or drag these lines to modify the stop loss and take profit from the same graph
Finally, I hope my drafting error apologize because I do not speak English speak Spanish but thanks to google I can try to send this message of appreciation and concern
Greetings and many pips

jlongo avatar
jlongo 9 Jan.

@Cristian Andres: With this strategy you can't drag the lines to adjust SL/TP. At this moment i don't have time to try to develop that in historical tester. To change SL/TP just click on correspondig SL/TP cell of the corresponding order at the table orders and a window will pop up to change the value of SL or TP. I hope that helps. JL

orto leave comments
IntroductionIn first place i wish to apologise the fact some readers are expecting i will write about the use of indicators on strategies in this articles as i said before. I need to study more about them to try to do better articles about this theme. But surelly they will come. In this month article i will present you a tool for JForex to allow us to do manual trading in Historical Tester. You may not see any advantage on this, but for me is very important because i have a full time job, also other projects and i can't always be on front of the screen. Sometimes i can, but doing other things where i can't be focused on the charts. I can have some "quality" screen time where i can get focused on the charts at weekends and sometimes at night (my time zone is GMT DST), but at this time the market is closed or going slowly with the asian sessions. With this limitations on mind i tried to find a way to trade on the market at more volatile market periods (London and New York sessions) when i have time available but the only thing i find for JForex is a strategy created by the user "Kirilla" (you can see about it here). But this strategy is very limited with errors and don't do what i pr…
Read article
Translate to English Show original
LinnuxFX avatar
LinnuxFX 10 Oct.

Nice upgrade of Kirilla strategy, you bring it to a new and functional level, I will test my manual strategies with this useful tool. Good Work!

SmithJr avatar
SmithJr 29 Oct.

Useful tool. Really nice work JL!

ecoplace avatar
ecoplace 29 Oct.

nice collection very useful

hyperscalper avatar

Very good approach

patrickjames avatar

Does anyone have any issues while running this on a mac? When I load it, the window that allows me to buy/sell is cut off and I'm unable to extend it.

orto leave comments
Backtesting a strategy (continuation)In my last article i don't have the space to write all i want about. To make the things easier i provide again in this article the corresponding image, but to see all 6 first items description you need to go to read my last article. Image 1: Historical Tester and the options on it. Explanation below (for the first ones read my last article).Legend (continuation):Red 7: Custom Tester Settings - In this window we have two areas. The first one is related with visual mode settings (if checked on blue rectangle). Here if we check the options, we have a chart representation added to the main chart of the evolution of "Equity", "Balance" and "Profit/Loss" with the evolution along the test. If you want to have more space available for the main chart ou if you want to add indicators to this main chart you can uncheck them and get the values on the final report where we get the results of the test. On the template dropbox we can select the template for chart presentation. On period dropbox we select the period bars we want to use to visualise the main chart. In the second one we can decide if we want to save the test originated messages and reports saved …
Read article
Translate to English Show original
jlongo avatar
jlongo 26 Sep.

@tcsabina: Yes you can do backtesting with only the API. Go to "src" folder under the unziped API file and search for "". You can start to see how works without JForex and if you want you can develop a program for that. I don't talk about that in this articles series because of complexity and some laziness to get into this, as i don't need it. Hope that helps. JL

tcsabina avatar
tcsabina 26 Sep.

absolutely. this helps me!
thanks for the fast reply.

jlongo avatar
jlongo 26 Sep.

Welcome tcsabina :)

deansi avatar
deansi 30 Sep.

Good news jlongo, final reports CAN be made from backtests run with Optimisation switched on! ,

you just need to double click on the result list (after the backtest is completed) to generate a html report for the pass# you have double clicked on, and you can do it to any or all of the passes in the list you like!

jlongo avatar
jlongo 30 Sep.

@deansi: Thank you for warning us :) Trade well

orto leave comments