Community Blog

Filtered by tags:  Java
Avatar

Skipping Trading Breaks during Backtesting

Backtesting a Strategy for long periods of time (e.g. years) can be very time consuming.
You can speed things up during long backtesting runs by adding code to your Java Strategy that will skip over times when your selected Instrument's Market is Closed, like this:

public ITimeDomain curWeekend = null;
long time = bidBar.getTime();
if (engine.getType() == IEngine.Type.TEST) {
if (curWeekend == null) curWeekend = context.getDataService().getOfflineTimeDomain(instrument);
if (time >= curWeek
Read full story
Translate to English Show original
orto leave comments
Avatar

New York SESSION_HOURS and DAYLIGHT SAVING

If you want to know if the New York Session is currently open you have to take in account the time of year
as New York could be on Eastern Standard Time (EST) or Eastern Daylight Time (EDT).
We can easily do this in our Java code using the following constants
private static int USopen = 8, USclose = 17;
private static String UStimezone = "EST5EDT"; // New York SESSION_HOURS

and then in our onBar logic set up a Calendar to obtain the current time in the required timezone, as follows:
Cale
Read full story
Translate to English Show original
orto leave comments
Avatar

JFcontestFeb23 : Contest Strategy

This Strategy trades using the 5 Minute chart for instrument EUR/USD.
It is a scalper that looks for high probability short-term trades, with a small Takeprofit (5 pips) and a large Stoploss (40 pips).
Version 1 of this Strategy is very simple: it gets the RSI(14) and checks if it is over-bought (i.e. exceeds 70) or is over-sold (i.e. below 30).
If over-bought we expect the price to retrace, so we SELL, and if over-sold we BUY.
Trading is restricted to GMT 1000 start, 1600 finish.
%Equity t…
Read full story
Translate to English Show original
orto leave comments
Avatar

Identifying your Strategy Orders

When coding your Strategy in Java it is important to be able to identify the orders that your Strategy 'owns' (i.e. created & is managing) - and not get those mixed up with Orders on the same Account that were created manually or by any other Strategy that is running at the same time.
So when you want to Count your Filled (and/or Pending) orders, or Close your open positions, you may need to ensure they were created by the ‘owning’ Strategy.
I do this by always creating Orders with a Label tha…
Read full story
Translate to English Show original
orto leave comments
Avatar

Calculating Amount to Trade based on Risk

For currency pair 'instrument' I calculate OrderAmount to Trade with the following code, assuming I want to Risk 80% of my Equity (which is ok for the Strategy Contest):
@Configurable("%Equity to Risk") public double EQpcAmount = 80;
JFUtils utils = context.getUtils();
double EquityInUSD = history.getEquity()*utils.getRate(JFCurrency.getInstance(String.valueOf(context.getAccount().getCurrency())),JFCurrency.getInstance("USD"));
double OrderAmount = roundDecimals(EquityInUSD/1000000)*(EQpcAmo…
Read full story
Translate to English Show original
orto leave comments
Avatar

Flipper - the Trading Tool (Updates)

Hi traders,
Recently I have significantly updated my bot
Updates:
Link for the latest version
1) From now hybrid loop is always ON but the Number of tries remains the same!
Each mode reverse/non-reverse works the specific number of tries!
2) Stoprecovering check box allows the strategy to stop open trades after reaching a certain number!
3) Stop multiplying/recovering value - allows you to stop multiplying the previous amount of the order if Stoprecovering is OFF,
or as written above to s…
Read full story
Translate to English Show original
Illya avatar
Illya 7 Apr.

ahil2004  Не совсем понял вопроса. Но я могу дать доступ работы этой стратегии на реальном счете!

ahil2004 avatar
ahil2004 7 Apr.

Спасибо. Давайте. Я попробую. У меня сейчас мало времени для компа и я ищу нормальную автостратегию.

Illya avatar
Illya 7 Apr.

ahil2004  Напишите мне на почту, и я скину Вам стратегию kurin899@gmail.com

ivan25130145 avatar

добрый день! заинтересовала ваша стратегия, можно ли ее апробировать?

ivan25130145 avatar

Добрый день! Можно ли апробировать вашу стратегию?

orto leave comments
Avatar

Daily trading results with algorithms

Hi Traders,
Here are my daily results of the GBPUSD pair After reaching two times of SL closed in profit and covered all the previous losses!
https://www.dukascopy.com/fxcomm/blog/?action=post-show&post_id=223229

Cheers,
Ilya
Read full story
Translate to English Show original
orto leave comments
Avatar

Flipper - the Trading Tool

FLIPPER
The Flipper tool is an assistant in manual and automated trading. It helps you to choose the direction of the market if one or more of your orders were closed by SL.
When the first order is closed by SL, it will immediately open a position, depending on the operating mode, with the same SL and TP as the previous one, and multiplies the position size by the value set by Order Multiplier. Thus if Order Multiplier =2 and the position size was 0.01…
Read full story
Translate to English Show original
alango avatar
alango 13 July

Красиво????

orto leave comments
Avatar

Day view

Boe decisions for pound assets will be followed!Yesterday, it was stated that an agreement was reached during the final coalition talks in Germany. In January, a preliminary agreement was reached between the SPD(Social Democratic Party) and the CDU/CSU(Christian Union bloc), but it was expected to be January 21 when the SPD sought approval from its members by the Extraordinary Congress. The final negotiations were initiated here as well. As a final step after yesterday's agreement, it is stated …
Read full story
Translate to English Show original
orto leave comments
Avatar

JFX compiler - Maven plugin - easily compile your strategy in IDE

Dear Developers and Traders,
Intro
I would like to share with you custom Maven plugin that facilities packaging of strategies, plugins and indicators to .jfx file directly from your favorite IDE. The plugin is especially helpful if your project consists of many classes and/or external libraries.
Current situation
Without the plugin, if you have a project that contains several classes, your options are two:
1. Keep all classes in one file – terrible to structure your code and navigate around, d…
Read full story
Translate to English Show original
Illya avatar
Illya 11 Oct.

Thanks for sharing!

orto leave comments
More