stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

MACD_Stoch trend trader
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=1431
Page 1 of 1
Author:  SteveHopwood [ Sat Jan 26, 2013 10:30 pm ]
Post subject:  MACD_Stoch trend trader

SERIOUS WARNING
  • Most Forex traders lose all their money.
  • Using the robot posted here in trading Forex does not guarantee success.
  • Trading this robot could lead to serious financial loss.
  • Trading this robot without understanding its underlying trading strategies guarantees traders will lose their money.
  • This is not a set-and-forget ea; there is no such thing and anyone who tries to claim there is, is either stupid or lying. This ea requires frequent manual intervention.
  • At best, a trading robot is only 90% as good as the manual strategy it trades. At best. At worst, it can be much less effective. If the strategy is rubbish, so is the robot.
  • To trade this robot, you have to understand:
    • How to use EA's. Remember to set IsGlobalPrimeOrECNCriminal to 'true' if your crim insists on two-stage order sending.
    • MACD indi - ships with Empty4.
    • Stochastic indi - ships with Empty4.
I am not yet trading this EA on my live account, nor do I expect ever to do so.

Background info
I received this pm from johnlucas last week:
johnlucas wrote:Hello Steve,

please find attached one EA that I've built.
It uses stochs (70,10,10)
MACD (standard settings)
Long when MACD (shift 2) < 0
then MACD (shift 1) > 0 AND stochs < 25

short when MACD (shift 2) > 0
then MACD (shift 1) < 0 AND stochs > 75

Time filter: 9-14 GMT
SL 22 pips, TP: 185 pips
move SL to BE when 22 pips in profit

backtested on EURUSD 15m from 2001-2011 with the Equity curve attached.
Max DD is around 15%; W% above 45%

I would like to ask if someone is interested in improving it.

Possibile ideas:

1) opening more than 1 position at a time and trailing the stops as they become profitable
2) Adding another filter and trying it on lower TF
3) Adding a "time bomb" i.e. closing all positions after a certain period of time has passed.

As a general note, I am not a fan of multiple TF EAs since they cannot be backtested (as far as I know), but only forward tested (and the process seems to me a bit reducing).

If you like, feel free to share it.
I am not a programmer and I've built the EA using a visual tool,

thank you,

bye,

John.
Indicators
The MACD and Stochastic inputs are fully configurable. There are higher and lower time frames for you to play with. Any input beginning 'Htf' refers to a higher time frame. Any input beginning 'Ltf' refers to a lower time frame.

So, to trade exactly as John describes, set HtfMACD and HtfStoch to 0 and they will be ignored. Setting their Ltf equivalents to zero enforces the current chart as the time frame.

All well and good so far, and took about 5 minutes to do the basic stuff. The entertainment began when I started backtesting using inputs that involve the higher time frames.

Only a lunatic trusts back test results in Crapergy Tester, but this particular piece of rancid crap does at least allow the likes of me to test out my code. The first thing I discovered was that using a htf MACD killed trading stone dead.

This was not altogether a surprise. You want both a htf and a ltf macd to cross the zero line at the same time? Dream on.

So, I wondered what would happen if I aimed instead for a htf cross and then looked back over x ltf candles for a cross. This is what LtfCrossDetectionCandles is all about. So:
  • there is a htf macd cross of the zero line:
    • the bot looks back over LtfCrossDetectionCandles to find either:
      • a point where there was a ltf cross in the direction of the htf macd.
      • a point where two consecutive macd values were on the correct side of the zero line.
Stochastic has the same mixture of htf and ltf inputs and responds to zero inputs in the same way as does macd. StochBuyBelow and StochSellAbove allow you to configure these levels in your own experimentation.

OOTB
The ootb settings allow this ea to trade in a quick and dirty open price EU M15 Cowboy IBFX Aussie demo over the last year using all the mtf stuff. That is all they are intended to do; do not expect them to be profitable.

In conclusion
Do I expect this to prove to be a profitable bot? Not a hope.

So, why did I code it? Three reasons:
  • My OCCD was itching and I had a few minutes to kill and figured I was better off simply coding my own version with all the stuff that naturally comes with my ea's as a result of all our work here, then trying to adapt code produced by a code-producing machine. Mind, the programming that lies behind software that can produce an EA is mind-boggling, :lol: but that is a different thingy to what we are discussing here.
  • John has clearly put a lot of work into this and so deserves some support.
  • There is no telling what The Brains here might come up with.
Maybe you guys can find a profitable combination of setting. Have a play on demo and see what you can come up with.

:D


Matters of general interest
Go here to download and run the script that will fill your platform's missing chart history: http://www.stevehopwoodforex.com/phpBB3 ... f=15&t=254
Read this post:
http://www.stevehopwoodforex.com/phpBB3 ... p?f=6&t=78 Newbie traders, read this for inspiration and warning. Those of you who have suffered losses, read it for inspiration.

Masterly summary of hedging: http://www.forexfactory.com/showthread. ... ost4977179

EA coding
I receive may requests to code EA's. Traders, if I code your EA for free, then I will share it here. If you want me to code your EA without sharing, then my fee is $100 payable into my paypal account. I explain why at http://www.stevehopwoodforex.com/phpBB3 ... ?f=15&t=79, at the bottom of the post.

Useful utilities/EA's/scripts
Author:  johnlucas [ Sun Jan 27, 2013 9:38 am ]
Post subject:  Re: MACD_Stoch trend trader

Hello Steve and thank you for your help.

I've tried to backtest the strategy using your improved EA, without the MTF features.
Over a 4 years period (1/1/2008-31/12/2011), I got a total of 20 trades for a profit of 13% (risking 1% per trade), while my original bot traded more than 100 time over the same period, with around 60% profit.

While it is perfectly possibile that I didn't setup your EA properly, I would be interested in knowing if anyone is able to test your bot with results similar to those achieved with my version.

Thank you and have a nice weekend,

John.
Author:  daveM [ Sun Jan 27, 2013 12:30 pm ]
Post subject:  Re: MACD_Stoch trend trader

John

Can you tell me what the walk forward analysis looks to be like..... For how long a period did you use the walk forward analysis.?

Thanks


daveM
Author:  johnlucas [ Sun Jan 27, 2013 3:05 pm ]
Post subject:  Re: MACD_Stoch trend trader

Dave,
I made an optimization on the most recent years (2008-2011), and verified that the parameters made the system 'acceptable' in the previuos years.
A lot has to be done before trading it live, but in my opinion this toddler is at least moving...
Have you played with it?
Bye,
John.
Author:  johnlucas [ Thu Jan 31, 2013 11:38 am ]
Post subject:  Re: MACD_Stoch trend trader

Hello everyone,

I was able to program the same logic with Tradestation.
Please find attached:
- Performance report (max DD is not shown here, but it is 12%, from 2008-2012)
- Equity Curve

Both metrics have been obtained trading a 10.000 $ account, risking a fixed 0,88% per trade (it means that no "compounded growth logic" has been used).

The good news to me is that it works, on TS, the same way it works on Empty4 (even slightly better) :)

If someone is willing to join me in this journey (working for example on the ideas exaplined in my first email to Steve), you are welcome.
I will also explain in details MACD and Stochs settings,

Thank you,

have a nice day,

John.
All times are UTC Page 1 of 1