Suggestions for EA (Loosing to Profit) - page 4

 

heres how it looks like on 2 year test, change to 1 lot, change to frame 240, both parameters made in sync with each other=60. (And all those logic taken off, except M60).

Bars in test 13544
Ticks modelled 5961890
Modelling quality 90.00%
Mismatched charts errors 0
Initial deposit 10000.00
Total net profit 30459.02
Gross profit 99716.99
Gross loss -69257.97
Profit factor 1.44
Expected payoff 152.30
Absolute drawdown 1037.97
Maximal drawdown 20707.98 (35.94%)
Relative drawdown 35.94% (20707.98)
Total trades 200
Short positions (won %) 97 (30.93%)
Long positions (won %) 103 (30.10%)
Profit trades (% of total) 61 (30.50%)
Loss trades (% of total) 139 (69.50%)
Largest
profit trade 5833.00
loss trade -3156.00
Average
profit trade 1634.70
loss trade -498.26
Maximum
consecutive wins (profit in money) 6 (14728.00)
consecutive losses (loss in money) 12 (-1587.00)
Maximal
consecutive profit (count of wins) 14728.00 (6)
consecutive loss (count of losses) -9507.00 (5)
Average
consecutive wins 1
consecutive losses 3

 
diostar 2011.10.05 12:37

You misunderstood. MTF is not the reason, or even a problem. The prb is just MA. Let me try to explain, very briefly.

MA tells the past. So when take on MA signal say on a H1, the expectation, E, is that on next frame, say H4, will "agree" with the past of H1. To profit is when H1 past manifest on H4 current. When E occurs, means close the trade, or do whatever the strategy wants.

But in this case, the poster took the reverse. Its pretty basic trade flaws because all the expectations are jumbled up.


Tho Multi-TimeFrame is Not my strong suit. So, please correct my thinking if it's wrong.

In the above Logic you posted:

if((Close[0]<=fastMA30 && Close[0]<=fastMA60 && Close[0]<=fastMA240))

the && which I highlighted in Red tells me that the fastMA240 needs to also agree.

Seeing that the fastMA240 is the Slowest of all the MA. Wouldn't it be reasonable to say that the fastMA240 makes the system slower to change. And that the entire system is bugged down by what the fastMA240 has to say?

Now if we toke your suggestion:

if((Close[0]<=fastMA30 && Close[0]<=fastMA60))

Now it seems to me that by leaving the fastMA240 out the system will respond faster to change. But we still have the problem of MA60 running the Show.

In conclusion: all that matters is the bottom-line of if it's a profitable approach in the long run. IMO there's no way to tell which is better. Your approach or the original author's approach without testing :)

Lastly, things I don't like about the above codes. 1) The use of current bar, as in Close[0] that code is not back-tester friendly. 2) The use of the = sign, as in <=, first, it's very rare that a prices would ever be = because it's of type double. And second, in the rare instance when all MAs are = Close[0] the system becomes direction-less, example: if(xMA>=Close[0]){Buy}_____if(xMA<=Close[0]){Sell}, whats the correct Action when it's =Close[0].

 
diostar:

Judging from the results, i will not recommend any optimization. Until these strategy & logic issues are look at.

First, I didn't have as much time after running that 7 year test on a H1, and so much motivation to look thru all the lines of codes in the EA, but i was certainly struck by the use of 2 magic numbers - for "slow" trades, and "fast" trades. What kind of strategy is this, I thought?

Then, I glance across for coding patterns, try commenting out the slowmagic number. The ea didnt work, as expected.

Then, i commented out the other fast magic number. And surprise, surprise, the ea compiles without error.

So, it seems, the logic is completely incomplete of what is desired? For sure, your EA are only filling based on some slow MA logic, but never on the fast?

Since you are the owner of this EA, you should have better answers to all these, than my simple ways.


I had ideas that were not implemented, hence you see slow and fast magic numbers.


The EA is only using slow magic number for the orders, and it's completely separate from slow and fast MAs that are being scanned by entries

I hope this answers your question

thanks

 
ubzen:
You guys should turn this into a little project of creating a winning system out of this. Everyone starts with the current version of the EA and then add something to it. Then you guys select the strongest coder amongst yall to assemble the best ideas. When yall accomplish the goal then place it into the code base. It'll be quite interesting to see what comes out.

I would love to collaborate in such an effort to build a profitable EA from a basic version of the EA that was posted

 
mbirrell:

I would look for an other way of entering the market. When the signal is given by these indicators it is already too late. I always use limit orders in anticipation of what the market is going to do. Some may laugh at taking this approach but it has worked for me. Remember it is not a sprint it is a marathon.


I definitely agree with your logic, but how would I convert my existing logic to fit the limit order model?
 
danjp:

Interesting idea, If c0d3 is ok with it I would give it a try. I should be able to replace my rules function with the rules mfro his. That would give it rules trading hours, email notification, error checking, stacking, limit and pending orders trailing stop, stop etc. It would probably only take a day ot two to get those rules working in my EA shell. I could then look at tweaking the rules to try an make it more profitable.

I'm definitely OK with this, but would you be ok with sharing your code on this thread?
 
diostar:

if you had seen his "rules", they are something like this (for the case of sell):

Mathematically speaking, this is quite a nonsense. The reason is because the MA on higher frame as expectedly, slower due to longer time required to complete a bar, than lower ones. So, all in all, this logic ends up being primarily determined by this lower condition:

Hence, by that time, MA shows the past from the perspectives of MA240, then 60, then 30, market WAS a sell one. My suggestion can be simply "reverse" this nonsensical rule, so instead of short entry, go long, and vice versa. I am quite positive the result turns out prettier.



Let me explain a short trade, it's vice versa for a long trade:

  • Entry condition 1: If current close price is below MA30(100 samples), MA60(100 samples) and MA240(100 samples) we are in a downtrend
if((Close[0]<=fastMA30 && Close[0]<=fastMA60 && Close[0]<=fastMA240))
   {
      // we are in a downtrend
      //Comment("\n"+"short only");
      shortEntry();
   }
  • Entry condition 2: Wait for close price of entryTF(15M) to be close above MA30(50 samples) and MA60(50 samples)

if(iClose(Symbol(),entryTF,1)>=slowMA30 && iClose(Symbol(),entryTF,1)>=slowMA60)
  • Enter short

The idea: MTF Logic

  • When the price is below MA30 which is based on M30
  • When the price is below MA60 which is based on H1
  • When the price is below MA240 which is based on H4
  • wait for M15 closing prices to be above MA30 which is based on M30
  • wait for M15 closing prices to be above MA60 which is based on M60
  • Enter short: with order parameters


I'll also try to reverse the entries, and see what happens


Hope this answers your question

 
ubzen:

@diostar, interesting ideas and take on the MTF Logics. This is something I've noticed about MTF Logics, One timeframe usually dominate the system.

@danjp, yeah that's probably the fastest way of getting the Rules into a working program you trust. Since most of us already have a Template upon which to plug a logic into. If someone don't feel comfortable giving away their codes, one suggestion would be having who ever assemble the codes use Trusted Libraries from our code base. (Example: OrderReliable.mqh.).

You know what! I kinda like this idea. If I can get 3 people to sign on from here, I'll start a New Thread. We collaborate in the effort of trying to create a profitable EA. It'll be a good test to see if multiple traders could really trade the same system. :)


Please post here the thread, if you start it, i def want to participate
 
danjp:

I would do an optimize run that had (1*std) -> (5*std) and also in on the same run try 0.3 - > 1.5 on both the SL and TP. I would start out on a 12 month run. If you get decent results from some of those runs I would then add into the EA an hours to trade routine and use the values you got from the previous run to see if you can improve it even more without have to trade 24/7.

Good luck, keep posting the results.

Can you recommend any documentation for running a backtest with (1*std) -> (5*std) and (0.3 - > 1.5 on both the SL and TP)
 
diostar:

The forward test totals 156 trades is much much more reliable, than those 39 backtests trades. The whole idea of backtest is to put in as much trades as you can, and get their quick results. What is backtesting for?







backtesting is just to test the strategy, and see that your logic works, but to judge if it will be profitable, only forward tests can determine


There were many times, when you see an EA profitable on backtest, then you run it live, and vola, your EA breaks your bank