simple ea? - page 2

 
engcomp:

Not quite, Phillip


I'm just going by the description given by the OP:

gts_sven:

it should buy when eurusd 5min crosses over eurusd 30min and sell when eurusd 5min crosses under eurusd 30min. should be very simple....


If the auto-generated code itself does not adhere to the author's desired strategy then that is a whole other issue/topic.
 
1005phillip:


If the auto-generated code itself does not adhere to the author's desired strategy then that is a whole other issue/topic.

I wonder if the experts on this forum would find the time to analyze this auto-generated code.

For example, the routine for closing open positions is in this for-loop...

   for (int i = 0; i < Total; i ++) {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if(OrderType() <= OP_SELL &&  OrderSymbol() == Symbol()) {

Shouldn't it be from last to first?

   for ( int i = Total; i >=0; i-- ) {
...
I think many members would be interested in the expert's comments.
 

I think if the auto-generator has mis-interpreted gts_sven's instructions, it may be one of those magical discoveries.

For example, the mighty 807 pip swing from a high of 1.333 on Mon, May3 to Thu, May 6 has produced a profit of $5,706.

This is 71% of the swing value of $8,070. I am extremely happy if I can catch 33% of a swing value from highest to lowest.

I wonder if someone can test the same period with a M5/M30 crossover EA on M1 chart. Here is the report...

Bars in test 6687
Ticks modelled 181823
Modelling quality 25.00%
Mismatched charts errors 0
Initial deposit 5000.00
Total net profit 5705.83
Gross profit 10364.35
Gross loss -4658.52
Profit factor 2.22
Expected payoff 101.89
Absolute drawdown 56.52
Maximal drawdown 1094.08 (11.90%)
Relative drawdown 12.55% (1060.16)
Total trades 56
Short positions (won %) 38 (68.42%)
Long positions (won %) 18 (22.22%)
Profit trades (% of total) 30 (53.57%)
Loss trades (% of total) 26 (46.43%)
Largest
profit trade 591.48
loss trade -308.52
Average
profit trade 345.48
loss trade -179.17
Maximum
consecutive wins (profit in money) 6 (1745.88)
consecutive losses (loss in money) 4 (-858.08)
Maximal
consecutive profit (count of wins) 1881.11 (4)
consecutive loss (count of losses) -858.08 (4)
Average
consecutive wins 3
consecutive losses 2

 
Well we are making great progress. From automation of poor trading practices to automation of poor programming practices. I'm avoiding putting ANY effort into rectifying generated code UNLESS perhaps it's for the programmer of the generation tool. Otherwise no one is benefiting in terms of MQL learning. CB
 

"I think many members would be interested in the expert's comments."

Not really! These guys have much better use for their time than to Analyze (newbie-robot) auto generated code. However since we're both new maybe we can have some fun with this one :). The example's I'm used to seeing looks like the auto-generator "for (int i = 0; i < Total; i ++)". Your version "( int i = Total; i >=0; i-- )" does the same thing. (lots of ways to milk a cow I guess). But what happens if "Total" changes during the loop?

 

I'm new to programming so I could be Very-Very wrong, in that case Sorry for my mis-interpretation of code.

 
ubzen:

[..]Your version "( int i = Total; i >=0; i-- )" does the same thing. (lots of ways to milk a cow I guess). But what happens if "Total" changes during the loop?


What's important is what happens to the array indexes when you close an order. Closing an order reults in orders with a higher index being re numbered to fill the gap. If you count up and close an order, it means that orders that you have yet to check get re numbered... and 1 will get renumbered the index for the odrer you just closed. when i increments, you miss checking that order. Counting down means any renumbering happens to orders that have already been checked and i-- results in correctly checking the next unchecked order.
 

Thank you, ubzen and Viffer,

Yes, let's have some fun. This crazy EA is full of surprises.

Even in the choppy month of April, which started in the 1.35s, swung between 1.37 and 1.31, and ended in the 1.33s, it showed a profit of $1,440!

I hope someone has an EA to test M5/M30 crossover on M1 so we have a benchmark. Phillip seems to know a lot about sexy MA crosses.

Here is the report for April...

Bars in test 2053
Ticks modelled 636557
Modelling quality n/a
Mismatched charts errors 51972
Initial deposit 5000.00
Total net profit 1440.14
Gross profit 20385.13
Gross loss -18944.99
Profit factor 1.08
Expected payoff 8.05
Absolute drawdown 936.01
Maximal drawdown 3014.63 (32.97%)
Relative drawdown 32.97% (3014.63)
Total trades 179
Short positions (won %) 102 (49.02%)
Long positions (won %) 77 (31.17%)
Profit trades (% of total) 74 (41.34%)
Loss trades (% of total) 105 (58.66%)
Largest
profit trade 591.48
loss trade -325.95
Average
profit trade 275.47
loss trade -180.43
Maximum
consecutive wins (profit in money) 8 (2274.79)
consecutive losses (loss in money) 8 (-1421.97)
Maximal
consecutive profit (count of wins) 2274.79 (8)
consecutive loss (count of losses) -1421.97 (8)
Average
consecutive wins 2
consecutive losses 3

 
Could you attach your modified .mq4 version so I could back-test it. I'm not sure why you're interested in a system with constant draw-downs above 20%. But I have nothing better to do, so it'll make a good case study for me especially if I'm working with someone else at my level.
 
gts_sven:

hi i created this simple ea with an eacreator .... http://sufx.core.t3-ism.net

it should buy when eurusd 5min crosses over eurusd 30min and sell when eurusd 5min crosses under eurusd 30min. should be very simple....

while compilating no errors where shown.

can anyone please advise?

many thanks!

regards

gts_sven


Hi,

Use it in live first, and if nothing happens, you have to desactivate sl, tp and ts .

Joe

 
ubzen:
Could you attach your modified .mq4 version so I could back-test it. I'm not sure why you're interested in a system with constant draw-downs above 20%. But I have nothing better to do, so it'll make a good case study for me especially if I'm working with someone else at my level.

The tests so far use the original code with no filtering.

What happens after filtering may kill the EA or enhance it.

Attached is the file with the essential minor changes I made.

The originator of this discussion seems to have lost interest.

Thank you for your interest, Helmut.

Files:
simple2.mq4  9 kb
Reason: