Topic: jForex FST bridge
working bridge for jForex
Create and Test Forex Strategies
You are not logged in. Please login or register.
Forex Software → Developers Forum → jForex FST bridge
working bridge for jForex
I made a new bridge for this program, and with this, might be able to trade on jForex with the FST. However the bridge works, it have got some bugs, and that's why I'd like you to take a look at it. This way, we could possibly handle the problem.
Anyway, I'm personally not a programmer, so the code-conventions in the source code are surely not the prettiest. Xcuse me please:)
So that's my problem, and that's why I start a new topic. Can you people help me please?
the bridge written in java.
newest source code attached, maybe later i open a github account for source code with eclipse project.
https://dl.dropbox.com/u/7411164/ForexSBForum/JForex.zip
How to use:
open jForex demo account
download jForex client terminal, open it
in the terminal window left youll see subscribed instruments (maybe EURUSD, USDCHF, USDJPY) right click and remove all, except EURUSD - need for this because jForex sends ticks to strategies from all the subscribed instruments.
owerwrite user/documents/jForex/strategies with the downloaded jforex.zip/jforex contents
workspace subwindow:
strategies - open open downloaded JForexFstBridge.java
strategy editor appears - compile (F5)
then tools menu -> strategies -> click
if everything is ok you'll see JForexFstBridge in list
configure FST for connection ( multiple copies must allowed) - start it
back to jForex,
run strategy: -
options window appears:
MAGIC: strategy unique ID
period : must be the same as the FSB strategy has
connection ID : FST conn id
log : if its checked, the jForex write a logfile in your desktop.
lets run
and maybe the ticks with you and your FST
i think there has som benefits with this bridge:
u can use volume based indicators, because the data is the same. (Dukascopy is ECN so they provide REAL volume and not tick volatilty)
excelent backtest data quality
mayybe ...: can we bactest our strategies in FST because jForex historical tester uses tick data, and so far i can see is exactly the same data stream like real or demo data! but you can improve speed, so one day demo trading can be processed ~ 30 min - one hour.
Strongly BETA so do NOT use it for production please!
thank You!
so i have some problems with running:
every bar opening or/and closing i got messages like:
AND:
FST don't want close trades upon close logic condition (it can not recognize when the bar is closig?...)
except nBars exit, and stoploss/takeprofit (maybe some more indicators can close too, i only tryed RSI and OBOS)
sometimes when i stop bridge in jForex FST freezes...i thing some namedPipe related problems...
When FST receives a tick it sets a TickType to it.
public enum TickType
{
Open, // This is the first tick of the bar
OpenClose, // This is the only tick of the bar
Regular, // Tick between Open and Close
Close, // Close tick (not always the last one)
AfterClose // Tick that belongs to the same bar but have arrived after Close tick.
}
Example 1 hour Bar
08:59:58 TickType.Close <- Previous bar
09:00:02 TickType.Open
09:00:04 TickType.Regular
...
...
09:59:56 TickType.Regular
09:59:57 TickType.Close
09:59:58 TickType.AfterClose
09:59:59 TickType.AfterClose
10:00:01 TickType.Open <- Next bar
MT4 doesn't support any kind of bar closing event, so that we have to simulate one.
In FST you have option "Bar Closing" time advance in seconds = 3 (by default).
We use this option to rise a close event 3 seconds before time of bar closing.
In reality this is an artificial event. It's fully possible another tick to come after that and before the actual bar close. We mark such tick TickType.AfterClose in that case.
The messages you see are debug messages from program because you ave "Show system messages" option on in the Journal.
EDIT
How much is "Bar Closing" time advance in seconds.
It looks like it is 60 seconds !?
It's maximum value must be 15 seconds.
EDIT 2
There are 5 minutes difference between tick time and local clock. Are you receiving time correctly?
..
"A new tick arrived after a Bar Close event" text shows that there are TickType.AfterClose ticks. But these ticks must be only during the last 3 seconds of the bar.
yes...my pc have 5 min difference from ducas server...i corrected it..
no... i set it to maximum only for trying...
did You see 60 sec?
understand, thank you
but there is a problem... bar opening its not only time-based decision right?
if volume = 1... dukascopy has real volume, so may the first tick volume not be 1.
but anyway....this warnings is not problems?
Yes. You have to set volume = 1 in the bridge for the first tick of a bar in order to make it work properly. (We can fix this in FST later).
The massages are not problem normally, but in your case they indicate wrong TickType. Probably if you set the required volume for the first tick it well be enough. Second tick needs a volume > 1.
FST uses the fact that MT4 provide tick volume instead of real volume. (Again we can fix this in FST when working with jForex)
no... i set it to maximum only for trying...
did You see 60 sec
You are right. It's exactly 15 seconds.
And the log messages are correct.
Please try manual trade via FST. Open, Close, Add, StopLoss... If it works properly, the other will be easy.
thanks for the tip.
it helped.
all working properly, later i fix this firstTick-volume problem..
(i think you are right, FST sometimes closes a trade sometimes not)
thank you!
volume issue fixed,
source download in second post updated.
i also added for Instrument Selector so you don't need to ban all other subscribed instruments.
please try it, and report back.
Testing now. No issues so far.
We have to make some changes in FST to fully support Dukas.
Expert has to provide Library version and Expert version.
We can make FST recognizing if working with MT4 or with jForex. In case of jForex to change some messages and other settings for full compatibility.
Later we have to make a Wiki page for the project. Probably also YouTube video and to include this addon to standard distribution.
We need also a GitHub of the project in order too track changes and to maintain full compatibility between MT4 and jForex trading.
Great Job!!
project upgrade:
i created a new gui for jForexBridge called MultiJForexBridge.
u can configure, add, remove, start and stop bridges on the fly
also added equity stop : if equity goes below it will close all trades, and stop bridges..
tick backtesting also working! (with FST)
second post download link updated
installation:
delete All existing files related in previous version (Documents/JForex/Strategies folder)
if you use only this jForex strategy u can delete the entire Strategies folder
unzip downloaded content to Documents/JForex folder
when everything is in order, start jForex terminal, and open strategy - its already compiled - just start it
usage:
log files redirected to: Documents/JForex/Strategies/logs (dir created automatically)
configuration (bridges, bridge parameters, equity stop value...etc)
saved to: Documents/JForex/Strategies/config (dir created automatically)
u can configure Bridge when it is stopped.
and when it started only can switched the log checkbox
all modification saved automatically, and loaded in starting (if bridge flagged as "started" in last shudown, then starts it)
please test it and report
Thank You!
Project upgraded
i also added user manual in the package (second post download link)
many new features, stable, optimized.
so...i think its a usable version (close to production use )
pls try it and report.
regards
Hi, this is a excellent work.
I have tested with 3 FST running diffrent stratigies simultaneously.
Two of them have a Break Even set.
The following exceptions occurs on every Tick after possition is opened:
12:26:15 114 E: error occured:
12:26:15 at org.ttorhcs.BridgeThread.run(BridgeThread.java:42)
12:26:15 at org.ttorhcs.JForexFstBridge.onTick(JForexFstBridge.java:101)
12:26:15 at org.ttorhcs.JForexFstBridge.checkBreakEven(JForexFstBridge.java:361)
12:26:15 at com.dukascopy.api.impl.connect.PlatformOrderImpl.setStopLossPrice(Unknown Source)
12:26:15 at com.dukascopy.api.impl.connect.PlatformOrderImpl.setStopLossPrice(Unknown Source)
12:26:15 at com.dukascopy.api.impl.connect.a.c.a(Unknown Source)
12:26:15 com.dukascopy.api.JFException: Incorrect thread
12:26:15 112 E: error occured:
12:26:15 at org.ttorhcs.BridgeThread.run(BridgeThread.java:42)
12:26:15 at org.ttorhcs.JForexFstBridge.onTick(JForexFstBridge.java:101)
12:26:15 at org.ttorhcs.JForexFstBridge.checkBreakEven(JForexFstBridge.java:361)
12:26:15 at com.dukascopy.api.impl.connect.PlatformOrderImpl.setStopLossPrice(Unknown Source)
12:26:15 at com.dukascopy.api.impl.connect.PlatformOrderImpl.setStopLossPrice(Unknown Source)
12:26:15 at com.dukascopy.api.impl.connect.a.c.a(Unknown Source)
12:26:15 com.dukascopy.api.JFException: Incorrect thread
someone try it at last....:)
thanks for the report!
ill be glad to help, but the problem is this:
i've far from this version, please give a few days to fix it, because my actual version is not public because its contains a modifyed FST and Mr Popov don't respond my request to publish it......sorry...
someone try it at last....:)
thanks for the report!
ill be glad to help, but the problem is this:
i've far from this version, please give a few days to fix it, because my actual version is not public because its contains a modifyed FST and Mr Popov don't respond my request to publish it......sorry...
Can you tell what did you modify in FST? Other than that great job and a big thanks!
i modifyed the N bars exit calculation because it uses time, but i think its not correct, it must be bar count....
if You want look at it i'll be gladly to show you
edit:
oh and when the strategy uses logical groups, it ignores all other exit signals
I not only try it , i am sank in tests from the moment i saw this bridge !
At this moment , I have a running test over 15 months back in time , with process all ticks , at maximum speed set in dukas historical tester !!! it is now at 72 % done.
i also test in real time too.
glad to hear that!
ok, i'll fix this problem soon...
careful with this long term backtest....it becomes slower and slower....(maybe some bug in jForex API or something...)
i make a 4 year backtesting with 10 strategies, it took 9 days!
Thank you very much
Your tests is much faster , may be big differences in hardware
Forex Software → Developers Forum → jForex FST bridge
Powered by PunBB, supported by Informer Technologies, Inc.