Forex Factory
  • Login

  • Username: Password:
  • 10:30pm

  • Search
  • Home

  • Forums

  • Trades

  • Calendar

  • News

  • Market

  • Brokers

Options

Search
Search
Search

Subscribe to Thread

Bookmark Thread

First Page First Unread Last Page Last Post

Printable Version

  • Interactive Trading
  • /
  • Reply to Thread
  • 43

Neural Network Trading, Serious people only!

  • Last Post
  • First Unread
  •  
  • Page 1 2345 6
  •  
  • Post# 1
  • Quote
  • First Post: Feb 19, 2008 3:26pm
  • charlinks
    Joined Jul 2007 | 389 Posts | Status: Neural Network Trainer
I've had it. I'm starting this thread to discuss specifics of using neural networks.

RULES: DO NOT CLUTTER THIS THREAD WITH POINTLESS QUESTIONS OR OBSERVATIONS! THIS THREAD IS TO DISCUSS *VIABLE* SCENARIOS AND IMPLEMENT THEM TOGETHER. I AM LOOKING FOR COMMENTS FROM PEOPLE WHO MEET ONE OR MORE OF THESE CRITERIAS. IF YOU ARE NOT SURE OR JUST WANT TO ASK SEND ME A PRIVATE MESSAGE. AGAIN KEEP THIS THREAD CLEAN!

A) HAVE IMPLEMENTED NEURAL NETWORK
B) HAVE EXPERIENCE USING A NEURAL NETWORK
C) HAVE AN INNOVATIVE IDEA OF HOW TO STRUCTURE THE INPUTS, OUTPUTS AND HIDDEN LAYERS FOR BETTER RESULTS
D) HAVE SUGGESTIONS ON HOW TO BALANCE THE NETWORKS, NUMBER AND TYPE OF NEURONS, PROPAGATION, ETC.

I have currently integrated FANN with MT4 and am able to feed it any inputs and outputs. Currently am trying to optimize a price distribution used as an input as well as an output. Some results are good some are not.

I am looking for ideas on how to optimize the network for better results.

I am also considering using cascade training as that may be a more viable and adaptive technique. Has anyone tried that with FANN? What is your take on that?

Many Thanks!

I will release the MT4 FANN plugin when it's at a better stage. That way we can all experiment with it and post the results here using the same tools.

  • Post# 2
  • Quote
  • Feb 20, 2008 3:14pm
  • ghcmartins
    Joined Mar 2006 | 8 Posts | Status: Member
Hi!

Two years ago I started using NNīs to see if I could get something useful for forecasting FOREX or other markets, I bought intraday data, EOD data and start looking for this kind of forecastings:

1- Forecast the major direction of the price during the day. i.e.: If close will be higher or lower than the opening prices and the expected volatility for the day, so I could open a position daily with the direction and use volatility as target profit.

2- Forecast only price action and get some HLC price for the next day

3- Inserting news as input with some criteria i.e.: Major announcements when they happened what was the market reaction (up, none or down), oil prices, dow jones, etc.... doing this you will have a lot of inputs and maybe better results arise. For me best results came this way, but itīs very tought job to keep creating this kind of datasheets and a lot of data is needed.

Never forget to normalize (untrend) your data, check the use of negative numbers (if they work or not with your NN mechanism). I used JOONE (www.joone.org - good!).

Have a defined criteria for training, validation and real testing. Weights for training, and all that stuff.

As an advice, donīt use only technical indicators (Stochs, RSI, MM, etc..). They donīt work for very volatile markets and short term forecast.

I think news being used as numerical sentiment indicators (1,0,-1) and other markets like oil, indexes (dow jones, european markets, asina markets) and detrended price, volatility of what youīre studying, may result on whatīs best for a NN forecast.

Iīm not a programmer, but i can handle some things. Another advice is to use from 40-100 neurons and using sigmoid funciotns (at joone you have some options, other NNīs only offer sigmoids). Trainig sets with less than 500 lines are no good and donīt use more than 1000 (best results are find when more recent data is used). 20% to 30% use for validation and 5%-10% to real test, these numbers are my experience not technical advice.

I just received this email about : http://www.neural-forecasting-competition.com/

Hope that helps,have luck at your trial. For me the results were too weak to consider trading using NNīs , I have other methods non - mechanical that give me better results, so I forgot about NNīs, but Iīve heard of very good results and people that get it arenīt willing to share it.

Guilherme
  • Post# 3
  • Quote
  • Feb 20, 2008 4:44pm
  • pippero
    Joined Oct 2007 | 206 Posts | Status: Trend following is for teens
Do Joone and FANN offer Probabilistic Networks? I wrote .dll's to access networks created with neurosolutions software, and also a quick converter to convert C source code generated by NeuroShell into an MQL compatible syntax.

My hypothesis is that NN are best used to filter signals from more traditional systems -- not for forecasting ( at least wehn it comes to financial timeseries).
  • Post# 4
  • Quote
  • Feb 20, 2008 4:48pm | Edited at 4:51pm – Need to add more comment
  • indianguyinny24
    Joined Jul 2007 | 2,119 Posts | Status: Member
I had implemented NN for stock for mostly opening range and sometime was very very close like .01 difference.

Had some network Configured with various level of Inputs.

I double that we need atleast 1000 line of data my comfort level comes at 30% for validation....


I am here to help if some one needs any input....I did some thing related to EUR USD a year ago that time forex was new but if some one is interested we can make this as a combine effort.

Also can i input that i am sure as data variates one network will not be enough for all currency so why not look for a specific pair and then try to analyse...Let me know this way we can handle more efficently...

Thanks For bringing this up

V
  • Post# 5
  • Quote
  • Feb 20, 2008 7:42pm
  • seeit
    Joined Dec 2005 | 177 Posts | Status: Member
You can try a neural net free. Downlod the trial Ensign charting which includes a free forex feed. Open a 2 minute Euro chart. Go to their indicators and put on the Ensign Map. It plots the last 24 hour 2 minute data points, and does a good job of timing of highs and lows over the next 24 hours.. You can update the map at anytime to take into account the latest data points.

It use to be called the Pessevento Map. The originator of the Pesavento neural net design back in the early 1990s was Dennis Regan (deceased). Dr. John Arrington (PhD Stanford) and Larry Pessavento spent months reverse engineering the Pesavento neural net, testing and understanding thoroughly every aspect of its unique design.

Gft , now sells the neural net for forex for $500. a month. What a rip. You can get the same info for the rental of the Ensign charting, $ 34. a month.

They will deny that the GFT neural network is the same as the Ensign Map, but I have Larry Pesavento on Tape saying that he and Ensign are in a lease agreement with GFT, with revenue sharing. Larry made the claim after a presentation he gave for his services and a GFT neural net . There you go, $500. dollars a month or $34. a month. Ensign is pretty good, I also use Fibonnacci Trader .
  • Post# 6
  • Quote
  • Feb 24, 2008 2:59am
  • charlinks
    Joined Jul 2007 | 389 Posts | Status: Neural Network Trainer
Thank you all for participating! I feel that I am way behind in this field than some of you! It is great to hear all the different experiences and ideas!

I promised to give you MT4 FANN integration and here it is!

I am attaching here the FANN integration and a sample script you can use for testing/learning purposes.

Place MT4_FANN.mqh in your include directory
Place MT4_FANN.dll in your libraries directory

(EDIT: There is a limit on attachments so download directly from fANN)
http://prdownloads.sourceforge.net/f...0.zip?download

From the zip file get fanndoubleMT.dll (found in fann-win-dll-2.0.0.zip\fann-2.0.0\MicrosoftWindowsDll\bin)
and place it in the SAME folder as your MT4 terminal.exe

Note: Scripts run only once so you can drag and drop it onto the chart and watch the experts output. It will generate a NN file that can later be loaded (you can train from a script "offline" and make an EA that loads the same file)

I am looking forward to people's experiments and ideas using the plugin!

Best Regards!
Attached Files
File Type: mqh MT4_FANN.mqh   < 1 KB | 2,285 downloads
File Type: mq4 NN_Delta.mq4   4 KB | 2,371 downloads
File Type: zip MT4_FANN.zip   6 KB | 2,467 downloads
  • Post# 7
  • Quote
  • Feb 24, 2008 3:29am
  • SA_Node
    Joined Sep 2007 | 32 Posts | Status: Member
Quoting charlinks
I've had it. I'm starting this thread to discuss specifics of using neural networks.
Thank you for starting this thread. I've been using Neuroshell Day Trader for last 3 years for stocks (with eSignal data). I've been thinking of combining neural networks and fibo for trading forex. While Neuroshell Day Trader is almost state-of-art, i'm not sure about capability of MT4 for neural networks. Please explain if MT4 can handle complex neurones. Looking at success of Fibo based trading in some of threads in FF, combining same with Neural Networks could be amazing.
  • Post# 8
  • Quote
  • Feb 24, 2008 5:23am
  • indianguyinny24
    Joined Jul 2007 | 2,119 Posts | Status: Member
HI SA,

I am trying this for like last 2-3 months ihavent had a good result on this...

So your input will be highly appreciated..

V
  • Post# 9
  • Quote
  • Feb 25, 2008 7:16pm
  • pipsqueaks
    Joined Apr 2007 | 6 Posts | Status: Member
Quoting SA_Node
Thank you for starting this thread. I've been using Neuroshell Day Trader for last 3 years for stocks (with eSignal data). I've been thinking of combining neural networks and fibo for trading forex. While Neuroshell Day Trader is almost state-of-art, i'm not sure about capability of MT4 for neural networks. Please explain if MT4 can handle complex neurones. Looking at success of Fibo based trading in some of threads in FF, combining same with Neural Networks could be amazing.
Have you found success in using Neuroshell Day Trader to trade stocks?
  • Post# 10
  • Quote
  • Feb 26, 2008 12:28pm
  • kamyar
    Joined Feb 2006 | 11 Posts | Status: Member
Quoting pipsqueaks
Have you found success in using Neuroshell Day Trader to trade stocks?
hi
the same question like above from me.do u?
  • Post# 11
  • Quote
  • Feb 26, 2008 12:37pm
  • drummer486
    Joined May 2007 | 110 Posts | Status: Statistocrat
Quoting charlinks
I promised to give you MT4 FANN integration and here it is!

Charlinks,

Looks great! I will definitely be doing some experimentation. The MT4-FANN integration was a pain last time I tried, but this should make it easier. Well done!
  • Post# 12
  • Quote
  • Feb 26, 2008 11:20pm
  • indianguyinny24
    Joined Jul 2007 | 2,119 Posts | Status: Member
Any idea how to do it...

V
  • Post# 13
  • Quote
  • Feb 26, 2008 11:40pm
  • Plutonite
    Joined Mar 2007 | 1,374 Posts | Status: we are stardust, we are golden
You would do well to try and move away from the typical implementation and actually try to come up with different data to feed the network than just price. I can help a little here (this is my field) but first i suggest you think about the following ideas:

-What am I using to train my perceptrons?
-Is the initial weighting on the nodes ideal or can I do better?
-What outputs am I hoping for?
-Can I use values derived from the prices as inputs to draw a better picture?
-- high-close on a bullish bar, high-open on bearish one
-- close-open on bullish bar, open-close
-- open-low on bullish, close-low for bearish bar
-Can I use them AND price together?
-How are we going to test? Surely not on metatrader data?
Finally (big bonus points and possible breakthrough research):
-Can I account for, and counter, concept drift? Is it even possible?

As you can see, I am suggesting you use a representation of the OHLC bars to train the network on price action rather than price. I'm afraid I can't program much here with my workload right now, but please pm me if you want more clarification.

By the way, the systems being sold right now for thousands of dollars are SO much simpler and more naive than what I am suggesting above. And they "work". But then, I am forward thinking kind of dude

Good luck.



Quoting charlinks
I've had it. I'm starting this thread to discuss specifics of using neural networks.

RULES: DO NOT CLUTTER THIS THREAD WITH POINTLESS QUESTIONS OR OBSERVATIONS! THIS THREAD IS TO DISCUSS *VIABLE* SCENARIOS AND IMPLEMENT THEM TOGETHER. I AM LOOKING FOR COMMENTS FROM PEOPLE WHO MEET ONE OR MORE OF THESE CRITERIAS. IF YOU ARE NOT SURE OR JUST WANT TO ASK SEND ME A PRIVATE MESSAGE. AGAIN KEEP THIS THREAD CLEAN!

A) HAVE IMPLEMENTED NEURAL NETWORK
B) HAVE EXPERIENCE USING A NEURAL NETWORK
C) HAVE AN INNOVATIVE IDEA OF HOW TO STRUCTURE THE INPUTS, OUTPUTS AND HIDDEN LAYERS FOR BETTER RESULTS
D) HAVE SUGGESTIONS ON HOW TO BALANCE THE NETWORKS, NUMBER AND TYPE OF NEURONS, PROPAGATION, ETC.

I have currently integrated FANN with MT4 and am able to feed it any inputs and outputs. Currently am trying to optimize a price distribution used as an input as well as an output. Some results are good some are not.

I am looking for ideas on how to optimize the network for better results.

I am also considering using cascade training as that may be a more viable and adaptive technique. Has anyone tried that with FANN? What is your take on that?

Many Thanks!

I will release the MT4 FANN plugin when it's at a better stage. That way we can all experiment with it and post the results here using the same tools.

Virtue finds and chooses the mean. Aristotle, Ethica Nichomachea
  • Post# 14
  • Quote
  • Feb 27, 2008 6:25am
  • drummer486
    Joined May 2007 | 110 Posts | Status: Statistocrat
Quoting Plutonite
-Is the initial weighting on the nodes ideal or can I do better?
Char, are you just using fann_randomize_weights? What are the weighting min and max?

Actually, what do you think about posting a link to your dll's source so that people could make some updates to it?

I'm working with the code right now to try to implement the ideas I presented in my Price Analysis with Neural Networks journal. I'll be sure to post when I get something working.
  • Post# 15
  • Quote
  • Feb 27, 2008 6:37am
  • charlinks
    Joined Jul 2007 | 389 Posts | Status: Neural Network Trainer
Sorry I have been pretty busy lately...

Attached is the source code for the plugin. yes I realize it uses a very hard-coded initialization. It would actually be great to keep an open-source version that adapts to the needs people have.

Just add the files to your MT4 sample project and add the function names in the def file.

Also make sure you rename the output file to MT4_FANN.DLL

(You may need to remove their cpp file and use the attached main.cpp instead)
Attached File
File Type: zip MT4_FANN.zip   3 KB | 1,956 download
  • Post# 16
  • Quote
  • Feb 29, 2008 4:09am
  • SA_Node
    Joined Sep 2007 | 32 Posts | Status: Member
Quoting indianguyinny24
HI SA,
I am trying this for like last 2-3 months ihavent
V
The NDT has given 40-50% win rate if combined with a system like eASCtrend or RMO (equis) systems. That too for regularly trending stocks following volatilty of their futures/options. Used alone, NDT has had very dismal results for me. I've had no experience of Neuroshell with Forex

I've found similar results for Ensign Map (earlier called Pesavento Predictive Study) and Pyrapoints on stocks and futures. Again I've not tried these on FXCM free forex data-feed in Ensign.
  • Post# 17
  • Quote
  • Mar 16, 2008 7:40am
  • arryex
    Joined Jul 2006 | 12 Posts | Status: Member
I have been using Neuroshell with some add-ons but seems its difficult to get better trading strategy. Just 2 weeks a go I bought Noxa add-ons, seems quite fun.
It can generate faster optimize result,currently I am using it for paper trade and feed it with MT4 data and review the signal on real trade.

See here some sample that I applied using 15m EURUSD pairs, 3 days for training/optimization (grey candles), 2 days for paper trade (orange candles) and the remaining are signal generated during actual trade (green candles). On bottom chart is the system equity which is calculated with this formula (Gross Profit ) - (Gross Loss ) + Open Position Profit. I start my initial account $500, $2 spread (for entry & exit), optimization objective: maximize (#winner-#looser)*Profit.

I have seen some people selling trading strategy/ea, but with Neuroshell+add ons you can built them by your self.

Cheers,
Arry
Keep learning ...learning prior to success..
Attached Image (click to enlarge)
Click to Enlarge

Name: Noxa testing.jpg
Size: 185 KB
  • Post# 18
  • Quote
  • Mar 18, 2008 9:08am
  • arryex
    Joined Jul 2006 | 12 Posts | Status: Member
Hi Friends,

I give you here attached free e-book (one of my collection) which I created based on my own experience using Neuroshell. This e-book may useful for Neuroshell users.

Any comments are appreciated.

Have a nice reading,
Arry
Attached File
File Type: pdf Chapter 4 - Inserting and Testing Defined Trading strategy.pdf   270 KB | 14,545 downloads
  • Post# 19
  • Quote
  • Mar 19, 2008 11:48am
  • kamyar
    Joined Feb 2006 | 11 Posts | Status: Member
Hey
Here is my own developed system .first i created a neural model that predict SOMETHING.after that the trading strategy optimized and developed based on the NN model.
the Trading system optimized for two month and paper traded for 1week
here is some statistics
TRADING STRATEGY
MA10-5.cht
EURUSD_M15.csv (EURUSD_M15)
Current
08.03.19 7:18:10 PM

STATISTICS
Performance Statistic All Trades Long Only Short Only
Start Date 08.03.11 6:15:00 PM
End Date 08.03.18 6:00:00 PM
Beginning Price 1.5343
Ending Price 1.5788
Change in Price 0.0445
Percent Change in Price 2.9%
Annual Percent Change in Price 132.5%

Return on Trades 2.7% 2.7% 0.0%
Annual Return on Trades 122.4% 121.8% 0.6%

Return on Account 2.7% 2.7% 0.0%
Annual Return on Account 122.7% 122.1% 0.6%

Net Profit $ 0.0413(413pips) $ 0.0411 $ 0.0002
Gross Profit $ 0.0491 $ 0.0489 $ 0.0002
Gross Loss $ 0.0078 $ 0.0078 $ 0.00
Ratio Gross Profit/Loss 6.29 6.27 0.00

Percent Profitable Trades 80.0% 75.0% 100.0%
Number Trades 5 4 1
Number Winning Trades 4 3 1
Number Losing Trades 1 1 0

Largest Winning Trade Profit $ 0.0242 $ 0.0242 $ 0.0002
Largest Losing Trade Loss $ 0.0078 $ 0.0078 $ 0.00

Average Trade Profit $ 0.01 $ 0.01 $ 0.00
Average Winning Trade Profit $ 0.01 $ 0.02 $ 0.00
Average Losing Trade Loss $ 0.01 $ 0.01 $ 0.00
Ratio Avg Win/Avg Loss 1.57 2.09 0.00

Maximum Consecutive Winners 3 2 1
Maximum Consecutive Losers 1 1 0

Average Trade Span 91 bars 114 bars 3 bars
Average Winning Trade Span 110 bars 146 bars 3 bars
Average Losing Trade Span 16 bars 16 bars 0 bars

Longest Trade Span 262 bars 262 bars 3 bars
Longest Winning Trade Span 262 bars 262 bars 3 bars
Longest Losing Trade Span 16 bars 16 bars 0 bars

Largest Shares Traded 1 1 1
Largest Winning Shares Traded 1 1 1
Largest Losing Shares Traded 1 1 0

Average Shares Traded 1 1 1
Average Winning Shares Traded 1 1 1
Average Losing Shares Traded 1 1 0

Commissions Paid $ 0.0015 $ 0.0012 $ 0.0003
Maximum Drawdown $ 0.0111 $ 0.0111 $ 0.0006
Maximum Open Trade Drawdown $ 0.0072 $ 0.0072 $ 0.0006
Required Account Size $ 1.5375 $ 1.5375 $ 1.5332
Attached Image (click to enlarge)
Click to Enlarge

Name: eurusd_m15.JPG
Size: 47 KB
  • Post# 20
  • Quote
  • Apr 7, 2008 3:06pm
  • Martin66
    Joined Jan 2008 | 9 Posts | Status: Member
Hi,

I like the first post... lets see if it keeps this thread informative.

Some thoughts:
- NNs are basically linear filters. Sigmoid output functions add some nonlinearity, but still little input change coresponds to little output change
- I think a big problem is to represent the data in a form a (more or less) linear system can handle. Some data is discrete, maybe another representation makes sense to improve its usefulness to the NN.

- detrending data: Does it really make sense to remove a trend from the input data? An uptrending market seems different to me compared to a sideways one. Of course the input range of the neurons is an issue, so some kind of preprocessing is necessary.
- what about calculating linear regression for a number of input intervals (ie. 20 H1) or multiple time frames (20 H4, 20 H1, 20 m5)? Regression woulde extract the trend from a single bar, removing H/L spikes as noise
- scaling: what about scaling the input by a x day ATR?
- which timeframes: Do we input m1 data (hunge number of inputs - gives lots of weights to optimize (or overfit)) or larger (maybe progressively) time frames?
- does it make sense to imitate the viewing behaviour of traders? If all traders look at H1 charts, we'd better stick to H1. If all switch from H4 to H1 and m5 (for fine tuning entry/exit), should we imitate that with the input intervals?

- Time: Does the NN need to know what day/time it is? Probably.
- representing the day: 6 inputs for Sunday...Friday or linear interval 0...1 scaled from week open (Sun) to close (Fr)?
- Time: Adding an input with scaled hour (0..23) adds a disconuity when changing from 23:59 to 0, where there is none (see above: linear). We could add region indicators instead, like one for asian, europe, US markets open. Or instead of one indicator for hour, transform 0..24h to 0...360° and calculate sin/cos from that. This creates a smooth +-1 vector.

- output: Predicting future price is useless IMO. Output could be: If I enter a market order with 80 pips SL and TP, should I enter long or short? This could scale well for a +-1 output, >0.5 for long, < -0.5 for short, the rest for don't know. The problem with this is that the result is extremely nonlinear: If I enter a 80TP long trade and the price reaches +79 and then reverses, I have a negative result. If it reaches +81, I have a positive result. This is a disconuity that any model might have difficulties with. We could linearize this: We enter 20 long trades with SL/TP from 60 to 100, what is the combined result? This to some degree smooths the result jumps when a certain price level is just not hit. Another idea: What is the largest trade TP we can enter long without being stopped out (in pips, same TP as SL, or TP=1.5xSL for better risk/reward?).
- can we use one network for deciding to go long or short (or do nothing) or do we need one for short, one for long (maybe more)? I'd prefer one, but this depends on the output functions we train (are they symmetric w.r.t. price or not)

...
Thread Tools Search this Thread
Show Printable Version Show Printable Version
Email This Thread Email This Thread
Search this Thread:

Advanced Search

  • Interactive Trading
  • /
  • Neural Network Trading, Serious people only!
  • Reply to Thread
    • Page 1 2345 6
0 traders viewing now
  • More

©2013 Forex Factory, Inc. / Terms of Use / Privacy Policy

Forex Factory® is a registered trademark.

Connect

  • Facebook
  • Twitter
  • RSS

Company

  • About FF
  • FF Blog
  • Careers at FF
  • Advertising
  • Contact FF

Products

  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer

Website

  • Homepage
  • Search
  • User Guide
  • Member List
  • Online Now
  • Report a Bug