Build Neural Network Indicator in MT4 using Neuroshell

This is a discussion on Build Neural Network Indicator in MT4 using Neuroshell within the Trading Software forums, part of the Commercial category; Fralo, Thank you for the links given, by the way BPPN is only for creating indicator (BPPN predictor) not an ...

Reply
 
LinkBack Thread Tools Search this Thread
Old Jan 29, 2010, 1:47am   #25
Joined Feb 2008
Re: Build Neural Network Indicator in MT4 using Neuroshell

arryex started this thread Fralo,

Thank you for the links given, by the way BPPN is only for creating indicator (BPPN predictor) not an EA.

Yes you are correct, my ordersend is not completed that's why i do not have stoploss.

By the way, I switch from 5M to 30M time frame has a less fluctuation on signal generated. my sell order still on going...

There are some options:
- Trade entry based on the signals
- Trade exit can be based on trailing stop, target profit or new signal.
- For small time frame,e.g. 5m target profit 30 to 50 pips possible.
- For high time frame 30M use trailing stop
- For huge time frame such as daily use new signals

I try to build the EA based on above options..unfortunately Sunday I will going to abroad for 1 month (i worked in oil & gas offshore) and may left this for a moment..

Here I add the MT4 crash report when the EA tester run, even I do not have problem when run the EA.

Regards,
Arryex
Attached Thumbnails
classifier-ea-action-2.png   crash-report1.png  

Last edited by arryex; Jan 29, 2010 at 2:04am. Reason: Add crash report when testing EA
arryex is offline   Reply With Quote
Old Jan 29, 2010, 5:34am   #26
Joined Jan 2007
Re: Build Neural Network Indicator in MT4 using Neuroshell

Looks like you have the EA working on a demo account, though I'm not sure how you are sending orders. According to your terminal you have a stoploss, but no takeprofit. Your indicator must access your DLL. I still don't understand how you are getting non forex data into the DLL.

The tester crash must have something to do with using multiple symbols, or maybe non FX symbols, but I know little about the crash log. Maybe another member will help?

But never mind. Have a good safe month. The FX market will still be here when you return.
Regards,
Fralo
fralo is offline   Reply With Quote
Old Jan 29, 2010, 7:08am   #27
Joined Feb 2008
Re: Build Neural Network Indicator in MT4 using Neuroshell

arryex started this thread I modified the EA and include the stoploss, takeprofit and trailing stop as extern variables (adjustable) based on the orderSend command:

External variables:
extern double Risk_Level =0.002, SL=1.5;
extern double TakeProfit = 50;
extern double TrailingStop = 15;

Buy Code:
(TakeProfit>0) OrderSend(Symbol(),OP_BUY,Lots,Ask,5,Stop,Ask+Take Profit*Point,"Classifier™",16384,0,Green);

Sell Code:
if (TakeProfit>0) OrderSend(Symbol(),OP_SELL,Lots, Bid,5,Stop,Bid-TakeProfit*Point,"Classifier™",16384,0,Red);

Trailing stop for buy position:
if(OrderType()==OP_BUY)
{
if(TrailingStop>0)
{
if(Bid-OrderOpenPrice()>Point*TrailingStop)
{
if(OrderStopLoss()<Bid-Point*TrailingStop)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
return(0);
}
}
}
}

Trailing Stop for sell position:
if(OrderType()==OP_SELL)
{
if(TrailingStop>0)
{
if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
{
if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Poi nt*TrailingStop,OrderTakeProfit(),0,Red);
return(0);
}
}
}
}
I named the EA as Classifier 0.1, any new order has green arrow for buy and red arrow for sell position as shown on the chart.

To get all non-forex data it depends on the server demo account you use, i use UWC-Demo to get them, I checked also that ODL may have others data such as Oil and other commodities, hence make us easier to do intermarket analysis. As you see on the picture, I have Index data such as #DJU.XDJ for Dow Jone Utilities Average Index, #DJT.XDJ for Down Jones Composite Average Index. They provide also stock streaming data that possible included as inputs for our neural network.

regards,
Arryex
Attached Thumbnails
uwc-demo.png  
arryex is offline   Reply With Quote
Old Feb 8, 2010, 3:39pm   #28
Joined Feb 2008
Re: Build Neural Network Indicator in MT4 using Neuroshell

arryex started this thread Currently I created and tested the EA without crashing out the MT4, the cause of the problem is avoiding to call a same dll by several indicators or expert advisors.

Here I tested on the 4H chart, which I assumed not too much ripple on the signals. Just a starting point, good or not still can be improved after.

I will try to make GA optimization on MT4 afterward.

Cheers,
Arryex
Attached Files
File Type: pdf Test and result.pdf (255.4 KB, 894 views)
arryex is offline   Reply With Quote
Old Feb 9, 2010, 5:17pm   #29
Joined Jan 2009
Re: Build Neural Network Indicator in MT4 using Neuroshell

Finally i found some time to read this thread and i don't understand a few things, also would like to get some more info

1) Why you want to use MT4 ?? is it because you want to make simulation of trading
with demo account ?? But NST as you know can send orders to demo account directly
though MT4.

Than why to make such simulation ?? You can make much more efficient back test
including out of sample test and Walk Forward test using e.g. Multicharts or even
by NST directly.

2) Did any of your backtests included out of sample test ??? Did you consider statistical significiance of this test according to the rules so e.g. to have such test valid it has to be at least 30 trades from one distribution out of sample. What was the result ??

Krzysztof
Krzysiaczek99 is offline   Reply With Quote
Old Feb 10, 2010, 7:04am   #30
Joined Feb 2008
Re: Build Neural Network Indicator in MT4 using Neuroshell

arryex started this thread Hi Kryzs,

Here are the answer your questions:
1. For me its simple, I use MT4 is my main data source because it's free (no subscription fee). The data coverage as well sufficient especially for forex analysis and multimarket analysis (with stock, index, etc) as basis for neural network. Demo account can be use as our paper trading and forward test, while waiting the proper trading strategy. You are correct we can use NST to send the trading order to MT4, but I do not use it because I use all the indicators value as my NN input from MT4.
It should be not too much different either using indicator values from MT4 or NST, but the important point is in MT4 we get the indicator values at current bar while in NST we can get only the previous bar value (please correct me if I am wrong).
Other advantage is if we are using all data, indicator and NN firing in the same platform (MT4), we get benefit to remove any slippages or delay due to calculating process in NST and transferring the signals. That is why I use Neuroshell2 (not Neuroshell trader) to create the neural network dll and call it from MT4.
I get difficulties to use trained NN in NST if the NN inputs are coming from MT4, but it is possible to use indicators from NST and fire them in NST as well.

2. I know the back test result on MT4 not as good as NST, but I should accept it as long I do not have any other tools can be used. For your information, I took the data from trained NN from MT4 on 15 minutes time frame about 2500 data since 1999 (20% out of sample) and I implement to test it on 4H time frame after 2006. For me it can be considered as a full walk forward test. It give me a hints how a robustness of my trained NN (correct me if I am wrong).

Thank you for your sharing idea.

Arryex
arryex is offline   Reply With Quote
Old Feb 11, 2010, 3:45pm   #31
 
2 Posts
Joined Feb 2010
Re: Build Neural Network Indicator in MT4 using Neuroshell

Quote:
Originally Posted by arryex View Post
Hi Kryzs,

Here are the answer your questions:
1. For me its simple, I use MT4 is my main data source because it's free (no subscription fee). The data coverage as well sufficient especially for forex analysis and multimarket analysis (with stock, index, etc) as basis for neural network. Demo account can be use as our paper trading and forward test, while waiting the proper trading strategy. You are correct we can use NST to send the trading order to MT4, but I do not use it because I use all the indicators value as my NN input from MT4.
It should be not too much different either using indicator values from MT4 or NST, but the important point is in MT4 we get the indicator values at current bar while in NST we can get only the previous bar value (please correct me if I am wrong).
Other advantage is if we are using all data, indicator and NN firing in the same platform (MT4), we get benefit to remove any slippages or delay due to calculating process in NST and transferring the signals. That is why I use Neuroshell2 (not Neuroshell trader) to create the neural network dll and call it from MT4.
I get difficulties to use trained NN in NST if the NN inputs are coming from MT4, but it is possible to use indicators from NST and fire them in NST as well.

2. I know the back test result on MT4 not as good as NST, but I should accept it as long I do not have any other tools can be used. For your information, I took the data from trained NN from MT4 on 15 minutes time frame about 2500 data since 1999 (20% out of sample) and I implement to test it on 4H time frame after 2006. For me it can be considered as a full walk forward test. It give me a hints how a robustness of my trained NN (correct me if I am wrong).

Thank you for your sharing idea.

Arryex


Thanks for Arryex and the other contributors.
Here are a few more bytes and questions on the subject.

Mt4 is indeed a very accessible system with tons of free data providers, huge community and lots publicly available documented experience.
My own problem with MT4 is its computational and programming limitations. For example, even if you manage to program a very fancy indicator that is heavier on resources, it will be extremely slow to backtest. Try testing an EA that includes Corona or other spectral indicators for example. In such cases you will have to give up the available intra-bar data and do with the lower quality MT4 backtesting options. Communicating with other systems is possible but very tedious.

It seems that many of the other alternatives like open quant and multi-charts aren't as prevalent and don't offer this attractive communal experience.
I therefore expect that it should be much harder to develop systems for them but assume that they offer many advantages (any experience of other members on this regard?)

I got to this thread because recently I've been considering NST. From what I understand this is a closed system in the sense that you can't really extract the internals of a trading strategy including its NN components. To me this is an obstacle (which I'm willing to overcome if I can really be convinced that it can generate for me $$ more efficiently). I imagine that this is also one of the attractions of Arryex Neuroshell 2, with which you are able to extract an all inclusive C routine. It also offers a fine control of the network learning process, which is a benefit if you know what you are doing.

One of my concerns regarding NST (including it's connectors to brokers) is that (as far as I understood) it doesn't provide sufficient flexibility to control money management.
Is that correct? Is it possible for example to program there an "EA" that trades according to Kelly fraction?

Your comments please.








I assume that some of these limitations will be alleviated with the forthcoming MT5, but we aren't there yet.
trendick is offline   Reply With Quote
Old Feb 11, 2010, 11:40pm   #32
Joined Jan 2009
Re: Build Neural Network Indicator in MT4 using Neuroshell

Quote:
Originally Posted by trendick View Post
Thanks for Arryex and the other contributors.
Here are a few more bytes and questions on the subject.

Mt4 is indeed a very accessible system with tons of free data providers, huge community and lots publicly available documented experience.
My own problem with MT4 is its computational and programming limitations. For example, even if you manage to program a very fancy indicator that is heavier on resources, it will be extremely slow to backtest. Try testing an EA that includes Corona or other spectral indicators for example. In such cases you will have to give up the available intra-bar data and do with the lower quality MT4 backtesting options. Communicating with other systems is possible but very tedious.

It seems that many of the other alternatives like open quant and multi-charts aren't as prevalent and don't offer this attractive communal experience.
I therefore expect that it should be much harder to develop systems for them but assume that they offer many advantages (any experience of other members on this regard?)

I got to this thread because recently I've been considering NST. From what I understand this is a closed system in the sense that you can't really extract the internals of a trading strategy including its NN components. To me this is an obstacle (which I'm willing to overcome if I can really be convinced that it can generate for me $$ more efficiently). I imagine that this is also one of the attractions of Arryex Neuroshell 2, with which you are able to extract an all inclusive C routine. It also offers a fine control of the network learning process, which is a benefit if you know what you are doing.

One of my concerns regarding NST (including it's connectors to brokers) is that (as far as I understood) it doesn't provide sufficient flexibility to control money management.
Is that correct? Is it possible for example to program there an "EA" that trades according to Kelly fraction?

Your comments please.


I assume that some of these limitations will be alleviated with the forthcoming MT5, but we aren't there yet.
Hi Arry and trendick,

I believe such combination i.e. NS2 made net + MT4 is not good at all. The biggest disadvantage is lack of multithreading of MT4, lack of real time trade analysis, portfilio sizing and Money management. With this setup is also not possible to make Walk Forward analysis with cluster analysis.

I think the best combination will be to use Multicharts + MSA + Grail system.
Advantage wiil be full multithreading , WF optimizer build in, compatibile trade format wit MSA and compatiblility with Grail system.

FYI MSA - Market system Analyzer - makes real time trade analysis including MonteCarlo
analysis + Equity curve trading on single strategy and portfilio level www.adaptrade.com

Grail - www.thegrailsystem.com - its GO and WF analyzer capable to make cluster WF analysis. Another part called CASB is a genetic rule searcher.

Both those tools are compatibile with TS and MC.

For MC you can get also free FOREX data from forexite so its not a problem with it at all. MC is also capable to work with multiple data streams so it can use NN (dll) from NS2.

Krzysztof
Krzysiaczek99 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Neuroshell Cluster Indicator > Comments? Skyhr Forex 6 Nov 25, 2014 12:25pm
MTFeed Pro Neuroshell MT4 Input Orders Problem eurgbp Trading Software 3 Mar 24, 2010 3:13pm
Neural Network indicator - Any potential users? Flo_UniS Forex 5 Jan 15, 2009 8:27am
Neural Network Trading Models gs2004 Educational Resources 7 Sep 23, 2005 11:40pm

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)