MQL4 - automated forex trading   /  

Code Base

Code Base  Expert Advisors  Automated Trading System "Сombo" To post a new code, please log in or register

This Expert Advisor is for
MetaTrader 4
Download MT 4 - 5.5 Mb

Mobile trading!
Buy a license and be mobile in your trading!

Name:
Automated Trading System "Сombo" [ ru ]
Author: Reshetov (2008.03.06 10:44)
Rating: 6.5
Downloaded: 11472
Download:
 Combo_Right.mq4 (4.6 Kb) View
The problem is stated for this automated trading system (ATS) as follows:

Let's consider we have a basic trading system - BTS. It is necessary to create and teach a neural network to make it do things that cannot be done with the BTS. This must result in creation of a trading system consisting of two combined and mutually complementary systems: BTS and NN (neural network).

Or, the English of this is: There is no need to discover the continents again, they were all discovered. Why to teach somebody to run fast, if we have a car, or to fly, if we have a plane?

Once we have a trend-following ATS, we just have to teach the neural network in countertrend strategy. This is necessary, because a system intended for trend-based trading cannot trade on sideways trends or recognize market setbacks or reversals. You can, of course, take two ATSes - a trend-following one and a countertrend one - and attach them to the same chart. On the other hand, you can teach a neural network to complement your existing trading system.

For this purpose, we designed a two-layer neural network consisting of two perceptrons in the lower layer and one perceptron in the upper layer.
The output of the neural network can be in one of these three states:

  1. Entering the market with a long position
  2. Entering the market with a short position
  3. Indeterminate state

Actually, the third state is the state of passing control over to the BTS, whereas in the first two states the trade signals are given by the neural network.

The teaching of the neural network is divided into three stages, each stage for teaching one perceptron. At any stage, the optimized BTS must be present for perceptrons to know what it can do.

The separate teaching of perceptrons by a genetic algorithm is determined by the lack of this algorithm, namely: The amount of inputs searched in with the help of such algorithm is limited. However, each teaching stage is coherent and the neural network is not too large, so the whole optimization does not take too much time.

The very first stage, preceding the teaching of an NN, consists in optimization of the BTS.

In order not to lose ourselves, we will record the stage number in the input of the ATS identified as "pass". Identifiers of inputs corresponding with the stage number will and in the number equal to this stage number.

Thus, let's start preparations for optimization and teaching the NN. Let's set the initial deposit as $1000000 (in order not to create an artificial margin call during optimization) and the input to be optimized as "Balance" in Expert Advisor properties on the tab of "Testing" in the Strategy Tester, and start genetic algorithm.

Let's go to the "Inputs" tab of the EA's properties and specify the volume of positions to be opened by assigning the value 1 to the identifier "lots".

Optimization will be performed according to the model: "Open prices only (fastest method to analyze the bar just completed, only for EAs that explicitly control bar opening)", since this method is available in the ATS algorithm.

Stage 1 of optimization. Optimization of the BTS:

Set the value 1 for the input "pass".
We will optimize only inputs that correspond with the first stage, i.e., that end in 1. Thus, we check only these inputs for optimization, and uncheck all others.

tp1 - TakeProfit of the BTS. It is optimized with the values within the range of 10 to 100, step 1
sl1 - StopLoss of the BTS. It is optimized with the values within the range of 10 to 100, step 1
p1 - period of CCI used in the BTS. It is optimized with the values within the range of 3 to 100, step 1

Below are the results of the BTS optimization:


Stage 2. Teaching the perceptron responsible for short positions:

Set the value 2 (according to the stage number) for the input "pass".
Uncheck the inputs checked for optimization in the previous stage. Just in case, save in a file the inputs obtained at the previous stage.

Check the inputs for optimization according to our rule: their identifiers must end in 2:

x12, x22, x32, x42 - weight numbers of the perceptron that recognizes short positions. It is optimized with the values within the range of 0 to 200, step 1
tp2 - TakeProfit of positions opened by the perceptron. It is optimized with the values within the range of 10 to 100, step 1
sl2 - StopLoss of positions opened by the perceptron. It is optimized with the values within the range of 10 to 100, step 1
p2 - the period of the values of price difference to be analyzed by the perceptron. It is optimized with the values within the range of 3 to 100, step 1.

Let's start teaching it using optimization with a genetic algorithm. The obtained results are given below:

Stage 3. Teaching the perceptron responsible for long positions:

Set the value 3 (according to the stage number) for the input "pass".
Uncheck the inputs checked for optimization in the previous stage. Just in case, save in a file the inputs obtained at the previous stage.

Check the inputs for optimization according to our rule: their identifiers must end in 3:

x13, x23, x33, x43 - weight numbers of the perceptron that recognizes long positions. It is optimized with the values within the range of 0 to 200, step 1.
tp3 - TakeProfit of positions opened by the perceptron. It is optimized with the values within the range of 10 to 100, step 1
sl3 - StopLoss of positions opened by the perceptron. It is optimized with the values within the range of 10 to 100, step 1
p3 - the period of the values of price difference to be analyzed by the perceptron. It is optimized with the values within the range of 3 to 100, step 1.

Let's start teaching it using optimization with a genetic algorithm. The obtained results are given below:



Stage 4 (final). Teaching the first layer, i.e., teaching the perceptron that is in the upper layer:

Set the value 4 (according to the stage number) for the input "pass".
Uncheck the inputs checked for optimization in the previous stage. Just in case, save in a file the inputs obtained at the previous stage.

Check the inputs for optimization according to our rule: their identifiers must end in 4:

x14, x24, x34, x44 - weight numbers of the perceptron of the first layer. It is optimized with the values within the range of 0 to 200, step 1.

p4 - the period of the values of price difference to be analyzed by the perceptron. It is optimized with the values within the range of 3 to 100, step 1.

Let's start teaching it using optimization with a genetic algorithm. The obtained results are given below:


That's all, the neural network has been taught.

The ATS has one more non-optimizable input, mn - Magic Number. It is the identifier of positions for a trading system not to mix its orders with the orders opened manually or by other ATSes. The value of the magic number must be unique and not coincide with the magic numbers of positions that have not been opened by this specific Expert Advisor.

P.S.

  • The size of the initial deposit is found as the doubled absolute drawdown, i.e., we consider some safety resources for it.
  • The EA given in the source codes is not optimized.
  • If you need to replace the built-in BTS with the algorithm of another trading system, you must modify the contents of the function basicTradingSystem().
  • In order not to enter the initial and the final values and the values of steps for optimization, you can take the ready file combo.set, place it in the folder \tester MT4, and upload to the EA's properties in Tester.
  • Re-optimization of the EA is to be performed at a weekend, i.e., on Saturday or on Sunday, but only if the results of the preceding week were unprofitable. The presence of losses means that the market has changed, and the re-optimization is necessary. The presence of profits means that the ATS does not need any re-optimization and recognizes market patterns quite well.


30 comments: 1 2 3   To post a new comment, please log in or register

Kudos to you Reshetov. An astonishingly simple and elegant example! Many thanks.


19.02.2010 16:03 monuogbe

Just want to bring attention back to NN.

IT IS PROFITABLE and CAN bring good income:

Check for yourself - IT IS NOT test from the past it is todays data:

Account: YYYYY Name: XXXXX Currency: USD 2009 January 21, 18:17
Closed Transactions:
Ticket Open Time Type Size Item Price S / L T / P Close Time Price Commission Taxes Swap Profit
47063290 2009.01.18 16:14 balance Deposit 1 000.00
47063785 2009.01.18 23:00 buy 0.10 gbpusd 1.4883 1.4819 1.5058 2009.01.19 00:57 1.4819 0.00 0.00 0.00 -64.00
47069756 2009.01.18 23:05 sell 0.10 gbpusd 1.4860 1.4917 1.4791 2009.01.19 07:16 1.4791 0.00 0.00 0.00 69.00
47071636 2009.01.18 23:10 sell 0.10 gbpusd 1.4861 1.4917 1.4792 2009.01.19 07:16 1.4792 0.00 0.00 0.00 69.00
47073173 2009.01.18 23:15 sell 0.10 gbpusd 1.4866 1.4921 1.4796 2009.01.19 07:16 1.4796 0.00 0.00 0.00 70.00
47075212 2009.01.18 23:20 sell 0.10 gbpusd 1.4871 1.4928 1.4805 2009.01.19 01:19 1.4805 0.00 0.00 0.00 66.00
47075908 2009.01.18 23:25 sell 0.10 gbpusd 1.4884 1.4928 1.4805 2009.01.19 01:19 1.4805 0.00 0.00 0.00 79.00
47119503 2009.01.19 03:43 sell 0.10 eurusd 1.3361 1.3413 1.3142 2009.01.19 14:34 1.3142 0.00 0.00 0.00 219.00
47119528 2009.01.19 03:43 sell 0.10 eurusd 1.3361 1.3413 1.3142 2009.01.19 14:34 1.3142 0.00 0.00 0.00 219.00
47119551 2009.01.19 03:43 buy 0.10 gbpusd 1.4891 1.4835 1.5106 2009.01.19 05:34 1.4835 0.00 0.00 0.00 -56.00
47119941 2009.01.19 03:45 sell 0.10 eurusd 1.3362 1.3413 1.3143 2009.01.19 14:34 1.3143 0.00 0.00 0.00 219.00
47120034 2009.01.19 03:45 buy 0.10 gbpusd 1.4892 1.4836 1.5107 2009.01.19 05:33 1.4836 0.00 0.00 0.00 -56.00
47120041 2009.01.19 03:45 buy 0.10 eurusd 1.3363 1.3312 1.3582 2009.01.19 07:15 1.3312 0.00 0.00 0.00 -51.00
47132679 2009.01.19 05:35 buy 0.10 gbpusd 1.4838 1.4777 1.5053 2009.01.19 07:20 1.4777 0.00 0.00 0.00 -61.00
47133754 2009.01.19 05:40 buy 0.10 gbpusd 1.4839 1.4778 1.5054 2009.01.19 07:20 1.4778 0.00 0.00 0.00 -61.00
47152331 2009.01.19 07:20 sell 0.10 eurusd 1.3309 1.3370 1.3090 2009.01.19 21:35 1.3090 0.00 0.00 0.00 219.00
47152371 2009.01.19 07:20 sell 0.10 gbpusd 1.4784 1.4753 1.4678 2009.01.19 08:12 1.4753 0.00 0.00 0.00 31.00
47156771 2009.01.19 07:25 sell 0.10 eurusd 1.3296 1.3359 1.3077 2009.01.19 21:58 1.3077 0.00 0.00 0.00 219.00
47156831 2009.01.19 07:25 sell 0.10 gbpusd 1.4766 1.4753 1.4660 2009.01.19 08:12 1.4753 0.00 0.00 0.00 13.00
47158588 2009.01.19 07:30 sell 0.10 gbpusd 1.4784 1.4753 1.4678 2009.01.19 08:12 1.4753 0.00 0.00 0.00 31.00
47160117 2009.01.19 07:35 sell 0.10 gbpusd 1.4761 1.4753 1.4655 2009.01.19 08:12 1.4753 0.00 0.00 0.00 8.00
47173533 2009.01.19 08:15 sell 0.10 gbpusd 1.4735 1.4699 1.4629 2009.01.19 10:15 1.4699 0.00 0.00 0.00 36.00
47175696 2009.01.19 08:20 sell 0.10 gbpusd 1.4755 1.4722 1.4649 2009.01.19 08:57 1.4649 0.00 0.00 0.00 106.00
47176893 2009.01.19 08:25 sell 0.10 gbpusd 1.4744 1.4709 1.4638 2009.01.19 08:59 1.4638 0.00 0.00 0.00 106.00
47177544 2009.01.19 08:30 sell 0.10 gbpusd 1.4745 1.4710 1.4639 2009.01.19 08:59 1.4639 0.00 0.00 0.00 106.00
47185596 2009.01.19 09:00 sell 0.10 gbpusd 1.4635 1.4600 1.4529 2009.01.19 13:48 1.4529 0.00 0.00 0.00 106.00
47186982 2009.01.19 09:05 sell 0.10 gbpusd 1.4663 1.4627 1.4557 2009.01.19 13:40 1.4557 0.00 0.00 0.00 106.00
47187895 2009.01.19 09:10 sell 0.10 gbpusd 1.4680 1.4645 1.4574 2009.01.19 13:13 1.4574 0.00 0.00 0.00 106.00
47205366 2009.01.19 10:20 sell 0.10 gbpusd 1.4691 1.4655 1.4585 2009.01.19 13:11 1.4585 0.00 0.00 0.00 106.00
47248661 2009.01.19 13:17 sell 0.10 gbpusd 1.4575 1.4539 1.4469 2009.01.19 14:33 1.4469 0.00 0.00 0.00 106.00
47251538 2009.01.19 13:20 sell 0.10 gbpusd 1.4583 1.4548 1.4477 2009.01.19 14:31 1.4477 0.00 0.00 0.00 106.00
47259996 2009.01.19 13:45 sell 0.10 gbpusd 1.4558 1.4522 1.4452 2009.01.19 15:39 1.4522 0.00 0.00 0.00 36.00
47262625 2009.01.19 13:50 sell 0.10 gbpusd 1.4522 1.4486 1.4416 2009.01.19 22:01 1.4416 0.00 0.00 0.19 106.00
47283296 2009.01.19 14:35 sell 0.10 gbpusd 1.4453 1.4431 1.4347 2009.01.19 23:48 1.4431 0.00 0.00 0.19 22.00
47283429 2009.01.19 14:35 buy 0.10 eurusd 1.3141 1.2978 1.3271 2009.01.20 04:34 1.2978 0.00 0.00 -1.12 -163.00
47286553 2009.01.19 14:40 buy 0.10 eurusd 1.3151 1.2991 1.3281 2009.01.20 00:56 1.2991 0.00 0.00 -1.12 -160.00
47286566 2009.01.19 14:40 sell 0.10 gbpusd 1.4471 1.4436 1.4365 2009.01.19 22:18 1.4365 0.00 0.00 0.19 106.00
47286609 2009.01.19 14:40 buy 0.10 eurusd 1.3152 1.2993 1.3282 2009.01.20 00:56 1.2993 0.00 0.00 -1.12 -159.00
47308942 2009.01.19 15:40 sell 0.10 gbpusd 1.4530 1.4503 1.4424 2009.01.19 21:59 1.4424 0.00 0.00 0.00 106.00
47365493 2009.01.19 21:40 sell 0.10 eurusd 1.3094 1.3254 1.3009 2009.01.20 00:39 1.3009 0.00 0.00 0.33 85.00
47371972 2009.01.19 22:00 buy 0.10 gbpusd 1.4422 1.4246 1.4637 2009.01.20 00:56 1.4246 0.00 0.00 0.00 -176.00
47373691 2009.01.19 22:05 buy 0.10 gbpusd 1.4416 1.4240 1.4631 2009.01.20 04:26 1.4240 0.00 0.00 0.00 -176.00
47375406 2009.01.19 22:10 buy 0.10 gbpusd 1.4398 1.4222 1.4613 2009.01.20 04:27 1.4222 0.00 0.00 0.00 -176.00
47378786 2009.01.19 22:20 buy 0.10 gbpusd 1.4364 1.4372 1.4579 2009.01.20 00:28 1.4372 0.00 0.00 0.00 8.00
47392592 2009.01.19 23:49 sell 0.10 eurusd 1.3096 1.3274 1.3011 2009.01.20 00:38 1.3011 0.00 0.00 0.00 85.00
47408075 2009.01.20 00:30 buy 0.10 gbpusd 1.4327 1.4161 1.4542 2009.01.20 05:03 1.4161 0.00 0.00 0.00 -166.00
47418378 2009.01.20 00:40 sell 0.10 eurusd 1.3013 1.3162 1.2928 2009.01.20 08:04 1.2928 0.00 0.00 0.00 85.00
47421046 2009.01.20 00:45 sell 0.10 eurusd 1.3009 1.3156 1.2924 2009.01.20 08:05 1.2924 0.00 0.00 0.00 85.00
47429902 2009.01.20 01:00 buy 0.10 gbpusd 1.4270 1.4121 1.4485 2009.01.20 07:52 1.4121 0.00 0.00 0.00 -149.00
47429986 2009.01.20 01:00 sell 0.10 eurusd 1.3005 1.3145 1.2920 2009.01.20 12:56 1.2920 0.00 0.00 0.00 85.00
47432222 2009.01.20 01:05 sell 0.10 eurusd 1.3019 1.3161 1.2934 2009.01.20 07:52 1.2934 0.00 0.00 0.00 85.00
47476526 2009.01.20 04:30 sell 0.10 gbpusd 1.4199 1.4340 1.4093 2009.01.20 05:56 1.4340 0.00 0.00 0.00 -141.00
47479467 2009.01.20 04:35 sell 0.10 gbpusd 1.4186 1.4327 1.4080 2009.01.20 05:55 1.4327 0.00 0.00 0.00 -141.00
47481704 2009.01.20 04:40 sell 0.10 gbpusd 1.4199 1.4340 1.4093 2009.01.20 05:56 1.4340 0.00 0.00 0.00 -141.00
47491526 2009.01.20 05:05 sell 0.10 eurusd 1.2985 1.3119 1.2900 2009.01.20 15:01 1.2900 0.00 0.00 0.00 85.00
47512715 2009.01.20 06:00 sell 0.10 gbpusd 1.4265 1.4230 1.4159 2009.01.20 07:21 1.4159 0.00 0.00 0.00 106.00
47514251 2009.01.20 06:05 sell 0.10 gbpusd 1.4254 1.4221 1.4148 2009.01.20 07:44 1.4221 0.00 0.00 0.00 33.00
47515645 2009.01.20 06:10 sell 0.10 gbpusd 1.4270 1.4234 1.4164 2009.01.20 07:21 1.4164 0.00 0.00 0.00 106.00
47544861 2009.01.20 07:25 sell 0.10 gbpusd 1.4182 1.4146 1.4076 2009.01.20 08:28 1.4076 0.00 0.00 0.00 106.00
47547445 2009.01.20 07:30 sell 0.10 gbpusd 1.4189 1.4154 1.4083 2009.01.20 08:25 1.4083 0.00 0.00 0.00 106.00
47552079 2009.01.20 07:45 sell 0.10 gbpusd 1.4212 1.4176 1.4106 2009.01.20 08:03 1.4106 0.00 0.00 0.00 106.00
47557960 2009.01.20 07:52 sell 0.10 eurusd 1.2932 1.3074 1.2847 2009.01.20 23:16 1.2847 0.00 0.00 0.33 85.00
47560638 2009.01.20 07:55 sell 0.10 gbpusd 1.4125 1.4089 1.4019 2009.01.20 09:07 1.4019 0.00 0.00 0.00 106.00
47569092 2009.01.20 08:05 sell 0.10 eurusd 1.2936 1.3081 1.2851 2009.01.20 23:16 1.2851 0.00 0.00 0.33 85.00
47569140 2009.01.20 08:05 sell 0.10 gbpusd 1.4102 1.4068 1.3996 2009.01.20 09:13 1.3996 0.00 0.00 0.00 106.00
47574084 2009.01.20 08:10 sell 0.10 eurusd 1.2938 1.3078 1.2853 2009.01.20 23:16 1.2853 0.00 0.00 0.33 85.00
47582408 2009.01.20 08:30 sell 0.10 gbpusd 1.4062 1.4029 1.3956 2009.01.20 09:21 1.3956 0.00 0.00 0.00 106.00
47583684 2009.01.20 08:35 sell 0.10 gbpusd 1.4059 1.4029 1.3953 2009.01.20 09:21 1.3953 0.00 0.00 0.00 106.00
47599008 2009.01.20 09:10 sell 0.10 gbpusd 1.4015 1.4009 1.3909 2009.01.20 10:13 1.4009 0.00 0.00 0.00 6.00
47601506 2009.01.20 09:15 sell 0.10 gbpusd 1.3974 1.3938 1.3868 2009.01.20 13:18 1.3868 0.00 0.00 0.00 106.00
47607542 2009.01.20 09:25 sell 0.10 gbpusd 1.3942 1.3934 1.3836 2009.01.20 13:41 1.3934 0.00 0.00 0.00 8.00
47609338 2009.01.20 09:30 sell 0.10 gbpusd 1.3970 1.3947 1.3877 2009.01.20 13:17 1.3877 0.00 0.00 0.00 93.00
47626644 2009.01.20 10:15 sell 0.10 gbpusd 1.4015 1.3985 1.3909 2009.01.20 12:10 1.3985 0.00 0.00 0.00 30.00
47664656 2009.01.20 12:15 sell 0.10 gbpusd 1.3975 1.3939 1.3869 2009.01.20 13:18 1.3869 0.00 0.00 0.00 106.00
47679700 2009.01.20 12:56 sell 0.10 eurusd 1.2921 1.3107 1.2836 2009.01.21 17:04 1.2836 0.00 0.00 0.33 85.00
47691419 2009.01.20 13:20 sell 0.10 gbpusd 1.3872 1.4074 1.3766 2009.01.21 08:22 1.3766 0.00 0.00 0.19 106.00
47693190 2009.01.20 13:25 sell 0.10 gbpusd 1.3887 1.4087 1.3781 2009.01.21 08:07 1.3781 0.00 0.00 0.19 106.00
47694783 2009.01.20 13:30 sell 0.10 gbpusd 1.3883 1.4082 1.3777 2009.01.21 08:07 1.3777 0.00 0.00 0.19 106.00
47699955 2009.01.20 13:45 sell 0.10 gbpusd 1.3916 1.3888 1.3810 2009.01.20 23:34 1.3888 0.00 0.00 0.19 28.00
47875814 2009.01.20 23:35 sell 0.10 gbpusd 1.3874 1.4091 1.3768 2009.01.21 08:22 1.3768 0.00 0.00 0.00 106.00
0.00 0.00 -0.38 3 531.00
Closed P/L: 3 530.62
Open Trades:
Ticket Open Time Type Size Item Price S / L T / P Price Commission Taxes Swap Profit
47734794 2009.01.20 15:05 sell 0.10 eurusd 1.2903 1.3087 1.2818 1.2871 0.00 0.00 0.33 32.00
47872016 2009.01.20 23:20 sell 0.10 eurusd 1.2855 1.3066 1.2770 1.2871 0.00 0.00 0.00 -16.00
47872918 2009.01.20 23:25 sell 0.10 eurusd 1.2862 1.3072 1.2777 1.2871 0.00 0.00 0.00 -9.00
47874379 2009.01.20 23:30 sell 0.10 eurusd 1.2878 1.3084 1.2793 1.2871 0.00 0.00 0.00 7.00
48258086 2009.01.21 17:31 buy 0.10 eurusd 1.2864 1.2633 1.2994 1.2869 0.00 0.00 0.00 5.00
48258129 2009.01.21 17:31 sell 0.10 gbpusd 1.3677 1.3921 1.3571 1.3730 0.00 0.00 0.00 -53.00
48261450 2009.01.21 17:35 sell 0.10 gbpusd 1.3709 1.3950 1.3603 1.3730 0.00 0.00 0.00 -21.00
48264270 2009.01.21 17:40 sell 0.10 gbpusd 1.3699 1.3943 1.3593 1.3730 0.00 0.00 0.00 -31.00
48267060 2009.01.21 17:45 sell 0.10 gbpusd 1.3750 1.3985 1.3644 1.3730 0.00 0.00 0.00 20.00
0.00 0.00 0.33 -66.00
Floating P/L: -65.67
Working Orders:
Ticket Open Time Type Size Item Price S / L T / P Market Price
No transactions
Summary:
Deposit/Withdrawal: 1 000.00 Credit Facility: 0.00
Closed Trade P/L: 3 530.62 Floating P/L: -65.67 Margin: 800.00
Balance: 4 530.62 Equity: 4 464.95 Free Margin: 3 664.95
Details:
Gross Profit: 5 630.98 Gross Loss: 2 100.36 Total Net Profit: 3 530.62
Profit Factor: 2.68 Expected Payoff: 44.69
Absolute Drawdown: 82.00 Maximal Drawdown: 1 602.36 (42.99%) Relative Drawdown: 42.99% (1 602.36)
Total Trades: 79 Short Positions (won %): 64 (95.31%) Long Positions (won %): 15 (6.67%)
Profit Trades (% of total): 62 (78.48%) Loss trades (% of total): 17 (21.52%)
Largest profit trade: 219.00 loss trade: -176.00
Average profit trade: 90.82 loss trade: -123.55
Maximum consecutive wins ($): 27 (2 722.90) consecutive losses ($): 10 (-1 602.36)
Maximal consecutive profit (count): 2 722.90 (27) consecutive loss (count): -1 602.36 (10)
Average consecutive wins: 12 consecutive losses: 3

Sorry the picture did not come up well.

To make it even more real: here is the same EA runs from adifferent broker platform:

Account: ffffffffff

Name: ccccccccc

Currency: USD

2009 January 21, 17:04

Closed Transactions:

Ticket

Open Time

Type

Size

Item

Price

S / L

T / P

Close Time

Price

Commission

Taxes

Swap

Profit

58463032

2009.01.20 05:56

balance

Deposit

1 000.00

58464689

2009.01.20 06:11

sell

0.10

gbpusd

1.4276

1.4258

1.4170

2009.01.20 06:58

1.4209

0.00

0.00

0.00

67.00

58465143

2009.01.20 06:16

sell

0.10

gbpusd

1.4281

1.4258

1.4175

2009.01.20 06:58

1.4209

0.00

0.00

0.00

72.00

58465807

2009.01.20 06:20

sell

0.10

gbpusd

1.4270

1.4258

1.4164

2009.01.20 06:58

1.4209

0.00

0.00

0.00

61.00

58466851

2009.01.20 06:25

sell

0.10

gbpusd

1.4262

1.4258

1.4156

2009.01.20 06:58

1.4209

0.00

0.00

0.00

53.00

58469293

2009.01.20 06:30

sell

0.10

22.01.2009 02:02 StraightTrader
waigua2 wrote:
warrismrazvi wrote:

i tried this combo for two weeks, pretty impressive in the beginning, many trades, but in last high floating account and then it just wipe out my demo account.

but i noticed that, every deals that were open on the evening and before the next morning was very good.

maybe you have a good ea, but it can make extreme losses on the bull and bear periods.

can you program a starttime and stoptime for trading on the ea and a automatic trailing stop?

This is exactly what shows in the backtest if you changed the Close[0] to Open[0]. And it should happen because the Close[0] can't be obtained. The patten should look like a zigzag line with a some good ups and many bad downs, in the best bet for a long run, the balance should be back to the original balance if not worse and it needs to be trained periodically.

Waigua2 and Warrismrazvi,

Combo has to be "trained" quite often, I found that it does fairly well for it's simplicity in programming, but it does need some improvement.  It seemed to work best when it was trained often and using short time periods (1 to 2 weeks max).  The longer the time period used to train it, the more erratic it became.

I think this same priniciple applied to indicators instead of price action has a better chance of being successful.  Price action is too random at times to be lerned (in my humble opinion).  Indicators have more "legible" patterns (crosses, distances, etc).

Waigua2, combo is "learning" the relationship between current price (Close[0]) and previous opens.  It's basically making it's decision based on the position of current price in relationship to several previous opens.  It's not predicting (Close[0]).  It's trying to predict direction based on Close[0]'s position relative to past Open's.  Close[0] exists and is a very useful piece of data if you don't want to make decisions using Ask and Bid everytime you want to establish current price.  I know it exists, because I have used it extensively in my programming.  If you simply look on your chart at any given moment and see the price line moving up and down, that is Close[0].  You can know when Close[0] is above, below or equal to any value and make a decision based on the position of Close[0] (or current price).

I suspect one of us may not be understanding the other, because this is a simple and basic concept as far as I know. It has been my experience that when two people over-discuss a simple concept, usually they are saying the same thing in different ways, or they are not understanding what each other is saying.

Again, I truly hope this helps in some way.

13.11.2008 06:56 lerned1
warrismrazvi wrote:

i tried this combo for two weeks, pretty impressive in the beginning, many trades, but in last high floating account and then it just wipe out my demo account.

but i noticed that, every deals that were open on the evening and before the next morning was very good.

maybe you have a good ea, but it can make extreme losses on the bull and bear periods.

can you program a starttime and stoptime for trading on the ea and a automatic trailing stop?

This is exactly what shows in the backtest if you changed the Close[0] to Open[0]. And it should happen because the Close[0] can't be obtained. The patten should look like a zigzag line with a some good ups and many bad downs, in the best bet for a long run, the balance should be back to the original balance if not worse and it needs to be trained periodically.
13.05.2008 20:50 waigua2

i tried this combo for two weeks, pretty impressive in the beginning, many trades, but in last high floating account and then it just wipe out my demo account.

but i noticed that, every deals that were open on the evening and before the next morning was very good.

maybe you have a good ea, but it can make extreme losses on the bull and bear periods.

can you program a starttime and stoptime for trading on the ea and a automatic trailing stop?

13.05.2008 08:09 warrismrazvi
peen wrote:

Hi,

Which TimeFrame is best for this EA??

TIA

This EA can't be used in real trading, as I said, you will probably loose money for trading using this system. So it does not matter whichever time frame is going to use.

07.05.2008 00:36 waigua2

Hi,

Which TimeFrame is best for this EA??

TIA

06.05.2008 08:10 peen
lerned1 wrote:

Waigua2,

Close[0] is simply current price.  It's price without the spread.  He's not actually trying to predict the future.  He's simply checking the relationship between opening price and current price at any given tick.  My bet is that you are not familiar with Reshetov.  The odds of him making that basic of a mistake are very slim.  Hope this helps.

Have you read the link I gave in my first post? When I check the code from Close[0] to Open[0], the result is aweful. The reason why nobody can get Close[0] used for EA is that when using forward testing, EA can't make a decision when the bar is just opened in start(). The warning is that if "Close[0]" is predicted from Open[0] using whatever method outthere, the test by Reshetov gives the best performance possible IF Close[0] is correctly predicted.

So maybe you are right if this is the intention of the author of this system. So this EA is lack of a prediction component which "foresees" Close[0] accurately for real trading, but this system illustrates very well the idea of using feed forward NN in trading. For short term trading it seems that lagged price difference can be used. I only read some papers talking about using price percentage for trading long term with NN.

So, if anything needs to be added, one good regression method is needed to be added to replace Close[0] to finish the EA for real trading.

05.05.2008 22:35 waigua2

Was anybody successful in using this EA ? I have to admit that my results are not looking pretty. I might have missed something here. Can you use it on any pairs?

Anybody could explain further? Thanks P.

04.05.2008 21:01 avarrephil
waigua2 wrote:

Reshetov,

Thanks for the effort, but I notice in the code, you have made a big mistake, that in every perceptron, you have "Close[0]".

You CAN'T use Close[0] in the code, because you can't get it when "start()" is called when a new bar is opened. This is a serious mistake that will make the system only work in backtest, and loose real money in trading. So please don't use this system for living trading.

You can't see the future, because close[0] is in the future.

When Close[0] is changed to Close[1] or Open[0], the result is very bad. But if any correction is made, please let me know. Thanks!

There is a discussion about Close[0], which can be found here. Hope this helps.

Waigua2,

Close[0] is simply current price.  It's price without the spread.  He's not actually trying to predict the future.  He's simply checking the relationship between opening price and current price at any given tick.  My bet is that you are not familiar with Reshetov.  The odds of him making that basic of a mistake are very slim.  Hope this helps.

04.05.2008 16:49 lerned1