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.

Neural network with JForex
 Post subject: Neural network with JForex Post rating: 0   New post Posted: Wed 22 Feb, 2012, 18:15 

User rating: 0
Joined: Thu 09 Jun, 2011, 07:49
Posts: 4
Location: France, Nice
Here's a quick example neural network with JForex with one of the fatest's neural network framework

https://github.com/fxmozart/DukasCopy-Encog

you can run directly from the command line the compiled version in the downloads (for a quick example) by doing:
java -jar EncogDukascopy.jar USERNAME PASSWORD

Example output:

Epoch #6 Error:0.08144309815477535
Epoch #7 Error:0.14100546077892667
Epoch #8 Error:0.1581448235642699
Epoch #9 Error:0.05698126829554865

Year Actual Predict Closed Loop Predict Real Value Predcted Value
Train:101 0.5652 0.5695 0.5695 1.3782 1.3799
Train:102 0.5652 0.5468 0.5469 1.3782 1.3707
Train:103 0.5652 0.6173 0.6173 1.3782 1.3994

---------------------
Basically the whole thing only retrieves data :
public List GetBars() throws java.text.ParseException, JFException
{
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyy HH:mm:ss");
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
Date dateFrom = dateFormat.parse("05/10/2008 00:00:00");
Date dateTo = dateFormat.parse("04/10/2010 00:00:00");
List bars = JForexContext.getHistory().getBars(Instrument.EURUSD, Period.ONE_HOUR, OfferSide.ASK, dateFrom.getTime(), dateTo.getTime());
return bars;
}

Then puts it in a dim array:
public double [][] IBarsToArray(List inputBars)
{
double [][] ohlcArray = new double[4][inputBars.size()];
for (int i = 0; i < inputBars.size(); i++){
ohlcArray[0][i] = inputBars.get(i).getOpen();
ohlcArray[1][i] = inputBars.get(i).getHigh();
ohlcArray[2][i] = inputBars.get(i).getLow();
ohlcArray[3][i] = inputBars.get(i).getClose();
}
return ohlcArray;
}

Then it's basically back to "Normal' encog and starting with training etc....

First lets pick which data field we want (let's get the closing values):
//Lets copy the closing values to sunspots
SUNSPOTS = GetWorkableArray(FullData,3);
public double[] GetWorkableArray(double [][] dukasArray, int whichArray)
{
double [] Arrayed = new double [dukasArray[whichArray].length];
Arrayed = dukasArray[whichArray];
return Arrayed;}

Then just run the usual sunspot Run command....

As simple as that...

Rest, drawing the indicator, other network types is back to either JForex or encog API's..


FxMozart,

Olivier G..


 
 Post subject: Re: Neural network with JForex Post rating: 0   New post Posted: Fri 27 Apr, 2012, 19:58 

User rating: 1
Joined: Mon 27 Feb, 2012, 22:49
Posts: 119
Location: Czech Republic,
Hello Olivier,

it looks very interesting. But I am not specialist at this. Therefore I have some questions.

System forecasts values. What successfulness does it have? The best would be for the biggest changes and small and middle divergence (between forecast and real value).

What values does it forecast? Close, High, Low? How many period? For only analysing period?

Is this system usable for all currency pairs? And for futures and stocks? I think about trading futures and stocks using python.

Could you write detailed description of this system?

Thanks very much

lifon


 
 Post subject: Re: Neural network with JForex Post rating: 0   New post Posted: Wed 09 Jan, 2013, 03:38 

User rating: 0
Joined: Thu 09 Jun, 2011, 07:49
Posts: 4
Location: France, Nice
This is an example, you can make a forecast of most anything.


 

Jump to:  

cron
  © 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