A quick and free library for MT4, much to the delight of neuralnetworkers - page 3

 

Let me ask a few small questions to the professionals:

1. what do the AnnsNumber, AnnInpit, delta parameters affect (in general ).

2. what are the limits of changing them.

3. Does it make sense to optimize them.

Also, for some unknown (to me) reason, in some cases, after the training of a neural network in the NeuroMACD-fixed.mq4 Expert Advisor

checking the results of training using the obtained filter on the training set does not give any visible results.

To be more exact, the results before and after applying the filter are absolutely identical.

What may be the reason?

Sorry for the taffalogy :).

 

Reworked the EA, cleaned up the bugs. Posted it to codebase. After verification by the moderator, will be available at: https://www.mql5.com/ru/code/9386

 
Reshetov >> :


Reworked the EA, cleaned up the bugs. Posted it to codebase. After review by the moderator, it will be available at: https://www.mql5.com/ru/code/9386

Done.

 
Rosh >> :

Done.

Thank you for your promptness!

 

Server: Alpari-Demo

Login: 2033582

Investment password: hfti6op (view only)


I am testing the Expert Advisor https://www.mql5.com/ru/code/9386 on demo, here are the first results:


Alpari NZ Limited

Account: 2033582 Name: Reshetov Currency: USD 2009 December 11, 07:18
Closed Transactions:
TicketOpen TimeTypeSizeItem PriceS / LT / PClose Time PriceCommissionTaxesSwapProfit
616947582009.12.10 06:37buy0.10eurusd1.470651.463151.478152009.12.10 06:441.471330.000.000.006.80
617093202009.12.10 09:00buy0.10gbpusd1.623411.614411.632412009.12.10 12:251.632410.000.000.0090.00
617420382009.12.10 13:00buy0.10gbpusd1.631301.622301.640302009.12.10 16:441.622300.000.000.00-90.00
617325472009.12.10 12:00buy0.10gold1125.821116.721134.922009.12.11 01:081134.920.000.00-0.6291.00
617492792009.12.10 14:00buy0.10usdjpy88.29387.69388.8932009.12.11 07:0588.8930.000.00-0.1067.50

0.00 0.00 -0.72 165.30
Closed P/L: 164.58
Open Trades:
TicketOpen TimeTypeSizeItem PriceS / LT / P
PriceCommissionTaxesSwapProfit
617241982009.12.10 11:00sell0.10audusd0.915790.922390.90919
0.916880.000.00-1.21-10.90
616968862009.12.10 07:00buy0.10eurusd1.470311.462811.47781
1.473760.000.00-0.0534.50
617720392009.12.10 17:00buy0.10gbpusd1.625381.616381.63438
1.632720.000.00-0.0773.40
617183092009.12.10 10:00buy0.10nzdusd0.728660.719460.73786
0.727670.000.000.28-9.90
617420802009.12.10 13:00sell0.10usdcad1.050381.060181.04058
1.051400.000.00-0.07-9.70
617493372009.12.10 14:00buy0.10usdchf1.026201.017401.03500
1.025640.000.00-0.09-5.46
618080662009.12.11 02:00buy0.10gold1135.931126.831145.03
1137.870.000.000.0019.40

0.00 0.00 -1.21 91.34

Floating P/L: 90.13
Working Orders:
TicketOpen TimeTypeSizeItem PriceS / LT / PMarket Price
No transactions

Summary:
Deposit/Withdrawal: 0.00 Credit Facility: 0.00
Closed Trade P/L: 164.58 Floating P/L: 90.13 Margin: 248.40
Balance: 5 264.49 Equity: 5 354.62 Free Margin: 5 106.22
 

Hello Yuri.

Please explain why two separate optimisations of your EA,

If I'm using the same period, the same data, the same optimization settings,

produce completely different results.

All the network training files were deleted and re-created during the new optimization.

I thought the results should be the same or similar and should vary only if some optimization conditions are changed (for example, lengthening the period by one day).

Does it turn out that the network is trained differently each time when the conditions and data are the same? Is it normal?

How can I use it, if the result is different each time?

Or I have not done something according to the instruction?

Expert Advisor: FANN-EA

I have made settings for optimization:

Currency: EURUSD

Period: 1M

Interval: 01/10/09 - 09/12/09

StopLoss: 10 to 100 step 1

x: 1 to 5000 step 1

Briefly the results of optimizations (sorted by maximal profit):

1st optimization.

Optimization Report
FANN-EA


Pass Profit Total trades Profitability Expected payoff Drawdown $ Profit %
24 880.85 168 1.26 5.24 287.04 30.80
27 788.82 168 1.23 4.70 299.13 29.24
26 696.82 168 1.20 4.15 287.04 34.28
25 696.82 168 1.20 4.15 287.04 34.28
48 696.79 168 1.20 4.15 287.04 29.69
9 696.79 168 1.20 4.15 299.13 36.02
7 696.79 168 1.20 4.15 299.13 36.02
6 696.79 168 1.20 4.15 299.13 36.02
86 696.76 168 1.20 4.15 299.16 31.95
3 696.76 166 1.20 4.20 299.13 36.08
29 696.73 166 1.20 4.20 287.04 32.56

2nd optimization (carried out as new)

Optimization Report
FANN-EA


Pass Profit Total trades Profitability Expected payoff Drawdown $ Profit %
54 1036.25 38 1.86 27.27 300.99 48.67
53 1036.25 38 1.86 27.27 300.99 48.67
50 1036.25 38 1.86 27.27 300.99 48.67
48 1036.25 38 1.86 27.27 300.99 48.67
42 1036.25 38 1.86 27.27 300.99 48.67
38 1036.25 38 1.86 27.27 300.99 48.67
36 1036.25 38 1.86 27.27 300.99 48.67
32 1036.25 38 1.86 27.27 300.99 48.67
29 1036.25 38 1.86 27.27 300.99 48.67
28 1036.25 38 1.86 27.27 300.99 48.67
25 1036.25 38 1.86 27.27 300.99 48.67
23 1036.25 38 1.86 27.27 300.99 48.67
17 1036.25 38 1.86 27.27 300.99 48.67
10 1036.25 38 1.86 27.27 300.99 48.67
4 1036.25 38 1.86 27.27 300.99 48.67
 
mgribachev писал(а) >>

Hello Yuri.

Please explain why there are two separate optimisations of your EA,

If I wanted to use this EA for the same period of time, for the same data, with the same optimization settings,

produce completely different results.

Every time you run the neuronet it is fine tuning it, that is the difference in the results, that is right...

 

Can someone explain something in the examples from FANN? In particular, the cascade_train.c file has this stuff written in it:

    struct fann_train_data *train_data, *test_data;

    ...

    train_data = fann_read_train_from_file("../benchmarks/datasets/two-spiral.train");
    test_data = fann_read_train_from_file("../benchmarks/datasets/two-spiral.test");
    train_data = fann_read_train_from_file("../benchmarks/datasets/parity13.train");
    test_data = fann_read_train_from_file("../benchmarks/datasets/parity13.test");
    train_data = fann_read_train_from_file("../benchmarks/datasets/building.train");
    test_data = fann_read_train_from_file("../benchmarks/datasets/building.test");
I probably don't understand something, but it seems that each subsequent pair of training and test file uploads will overwrite the previous ones. Why is this happening? Moreover, there is a memory leak because fann_destroy_train(data) is not called between loads;

Then there's more:

	fann_set_activation_function_output(ann, FANN_LINEAR_PIECE);
	fann_set_activation_function_output(ann, FANN_LINEAR_PIECE_SYMMETRIC);
	fann_set_activation_function_output(ann, FANN_SIGMOID_SYMMETRIC);
	fann_set_activation_function_output(ann, FANN_LINEAR);

	fann_set_train_error_function(ann, FANN_ERRORFUNC_TANH);
	fann_set_train_error_function(ann, FANN_ERRORFUNC_LINEAR);
What's the point?
 
Figar0 писал(а) >>

Each run of the neural network finishes it off, that's the difference in results, all right...

The 2nd optimization run was done from "0" on the same data with the same parameters.

The files in ANN directory from the first optimization were removed before running the 2nd optimization.

There is nothing to "learn" there as this is a new training, but it gives completely different results.

 
mgribachev писал(а) >>

The 2nd optimisation run was done from "0" on the same data with the same parameters.

There is nothing to "learn", as it is a new training, but it gives completely different results.

It's OK too, initially the network is initiated with random weights, and adjusts them during optimization, training. Different initial weights - different final results.

Z.I. though my EA didn't get such drastically different results, but it could depend on a lot of conditions.