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

Follow My Leader auto-trading EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=502
Page 1 of 4
Author:  SteveHopwood [ Sun Apr 22, 2012 5:57 pm ]
Post subject:  Follow My Leader auto-trading EA

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 tells you there is, is either a liar or an idiot. This EA will need manual intervention when NoOfTrades buys and sells are open, and the only recourse from there is to manage the basket manually.
    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.
      - Basket trading
DO NOT TRADE THIS EA ON A LIVE ACCOUNT. IT IS EXPERIMENTAL.

Ehup all

Intro
This thread has a double genesis:
  • 1) Read Bob's comments at http://www.stevehopwoodforex.com/phpBB3 ... 668#p10668.
    2) Being stuck with long-term GJ and GChf trades so deep in the hole that it will take me an age to trade my way through them has left me watching these pairs a lot. I see time and again that if one moves in one direction, other GBPxxx pairs often follow.
Experimenting with this seems like a good idea. Follow My Leader is a basket trader (see below if you are unfamiliar with this). It works thus:
  • - We enter a group of pairs into PairsToTrade - you can see how to separate pairs by a comma. No need to enter pair suffixes such as Cowboy IBFX 'm' - the ea does this for you.
    - Choose a timeframe and enter this into TimeFrame; default is H1.
    - Choose a threshold and enter this into Threshold; default is 30.
The ea cycles through the group of pairs. If one of them moves by Threshold in TimeFrame, then it sends a basket of trades in the direction of the move. Using the default inputs:
  • - at the open of each M1 candle on the host chart, the ea looks at the close price of the M1 candle 60 minutes ago.
    - if the market now has moved by 30 pips or more in this time, the basket is triggered.
Trade exit
There are three trade exit methods:
  • 1) basket upl hits CashTakeProfit.
    2) basket upl hits CashStopLoss.
    3) opposite direction signal i.e. stop and reverse.
SleepMinsAfterBasketClosure tells FML how long to sleep for after closing a profitable basket. If the basket is profitable, then there will probably be one or more pairs over the threshold for trading, so best to give some time for the markets to cool down.

Chart and time frame
Matters not a jot. Stick the bot on anything you want. Once the chart receives a tick, the bot goes into an endless loop that repeats every half-second. You cannot use the F7 key to change inputs. You cannot use the Expert Advisors button on your platform to stop the bot. The only way to stop it is to remove it from the chart. The only way to change the inputs is to drag a fresh instance onto the chart.

Basket trading
The principle of basket trading is simple: take a number of trades and close the lot when a basket take profit or stop loss is hit. The fate of an individual trade is irrelevant. Basket stop losses have an inbuilt disadvantage; the basket opens in instant drawdown because of the spread. A tp = sl will probably kill the account; stop loss usually needs to be uncomfortably large.

EA development
The default pairs are all GBPxxx. I shall also start demos for EURxxx and AUDxxx (might allow buys only on AUD because of the swap on sells).

We also need to find which combo of TimeFrame and Threshold works, if any. To this end, I have set up the 'Testers and results' section. I invite members to pick a combination of: PairsToTrade; TimeFrame; Threshold; CashTakeProfit; CashStopLoss and post here which one you are going to test; I can add the details to the table. Please leave the demo running for this week and report results after markets close at the end of the week. In time for Friday night, I will produce a script or something to do the pips profit/loss calculation on your History tab. If you trade multiple instances of the bot as I shall, remember to change the magic number for each instance.

From there, we can take stock and see what needs to be the next step.

In conclusion
No idea if this little doggie has a tail to wag. All we can do is see.

:D

Testers and results
Member: SteveHopwood
Pairs: All GBP, EUR and AUD pairs
TimeFrame: 60
Threshold: 30
CashTakeProfit: 20
CashStopLoss: 20
Result:

Member: youcrazykids
Criminal: FXCM
Pairs: All GBP, EUR and USD pairs
TimeFrame: 15
Threshold: 20
CashTakeProfit: 40
CashStopLoss: 20
Note: GBPNZD, GBPAUD and GBPCAD aren't available on FXCM.
Result:

Member: jboy
Criminal: MB Trading
Pairs: All GBP pairs
TimeFrame: 60
Threshold: 30
CashTakeProfit: 60
CashStopLoss: 30
Result:

((see http://www.stevehopwoodforex.com/phpBB3 ... 315#p11315 for reasons behind these settings)

Member: jboy
Criminal: MB Trading
Pairs: All EUR pairs
TimeFrame: 60
Threshold: 25
CashTakeProfit: 100
CashStopLoss: 50
Result:


Matters of general interest

Read this post:
http://www.forexfactory.com/showthread. ... ost4923611 Newbie traders, read this for inspiration and warning. Those of you who have suffered losses, read it for inspiration. There is a thread devoted to Sam's trading method at http://www.forexfactory.com/showthre...25#post5118825

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 ... p=803#p803, at the bottom of the post.

Useful utilities/EA's/scripts
Matt's chart-population script at http://www.stevehopwoodforex.com/phpBB3 ... 5733#p5733. Use this every time you start a fresh platform.
MaryJane has posted a fabulous utility to allow us to resize EA input windows: http://www.forexfactory.com/showthread.php?t=299017
Multi purpose trade manager: http://www.forexfactory.com/showthread.php?t=89371
Account equity analyser: http://www.forexfactory.com/showthread. ... ost4693716 Also at http://www.forexfactory.com/showthread. ... ost4709098, which includes a template for both USD and the Euro.
Past-trades display indi by squalou; shows a graphical display of the success/failure of trades in your History tab. Breathtaking piece of work. http://www.forexfactory.com/showthread. ... ost3830610
My shell EA – the code I use to produce EA's so quickly. http://www.stevehopwoodforex.com/phpBB3 ... p?f=5&t=15
Author:  garyfritz [ Sun Apr 22, 2012 6:38 pm ]
Post subject:  Re: Follow My Leader auto-trading EA

Steve, not having tried to fully decipher your trading logic, I'm not sure if this would be useful, but...

I just posted a Hanover-like currency-strength indicator. No sooner did I post it than I saw your new EA -- it's Kismet. Might that be a useful addition to your "which currencies are moving" logic? Or do you think it's so similar to the Hanover module that it doesn't add value, and if you thought a currency-strength filter would be useful, you'd have used Hanover?

Just a thought...
Author:  youcrazykids [ Sun Apr 22, 2012 6:41 pm ]
Post subject:  Re: Follow My Leader auto-trading EA

Member: youcrazykids
Criminal: FXCM
Pairs: All GBP, EUR and USD pairs
TimeFrame: 15
Threshold: 20
CashTakeProfit: 40
CashStopLoss: 20

Note: GBPNZD, GBPAUD and GBPCAD aren't available on FXCM.
Author:  SteveHopwood [ Sun Apr 22, 2012 8:43 pm ]
Post subject:  Re: Follow My Leader auto-trading EA

youcrazykids wrote:Member: youcrazykids
Criminal: FXCM
Pairs: All GBP, EUR and USD pairs
TimeFrame: 15
Threshold: 20
CashTakeProfit: 40
CashStopLoss: 20

Note: GBPNZD, GBPAUD and GBPCAD aren't available on FXCM.
Cheers. Duly added to post 1.

:D
Author:  SteveHopwood [ Sun Apr 22, 2012 9:16 pm ]
Post subject:  Re: Follow My Leader auto-trading EA

garyfritz wrote:Steve, not having tried to fully decipher your trading logic, I'm not sure if this would be useful, but...

I just posted a Hanover-like currency-strength indicator. No sooner did I post it than I saw your new EA -- it's Kismet. Might that be a useful addition to your "which currencies are moving" logic? Or do you think it's so similar to the Hanover module that it doesn't add value, and if you thought a currency-strength filter would be useful, you'd have used Hanover?

Just a thought...
The trading logic is simple and I describe it in post 1. No need to plow through the code to find it. The relevant code is in void GetPrices().

Do you fancy coding a variant the replaces the logic in void GetPrices() with yours?

All you have to do is use your indi to set the variable Direction to either of the constants 'buy' or 'sell' and the remaining code will take care of the rest.

This will also give me a template for using your indi in my own code, which will save me having to work it out for myself and losing the will to live - a feeling I gather you are now familiar with. :lol:

:D
Author:  garyfritz [ Mon Apr 23, 2012 12:04 am ]
Post subject:  Re: Follow My Leader auto-trading EA

Steve, I'm sorry, but I really can't. I honestly intended to work all day today (Sunday) because I'm so far behind on my consulting project. I really need to quit larking about with Empty4 and get some paying work done, or my clients might get disgusted with me and take their business elsewhere. Sadly I have not yet found the Holy Grail that can replace my income with trading :( so I need to keep working for a living. Or rather, START working for a living, since too much of my time lately has been the "fun" trading stuff...
Author:  jboy [ Mon Apr 23, 2012 2:06 am ]
Post subject:  Re: Follow My Leader auto-trading EA

Steve,

I'm game. Let me do some thinking, and I'll come back to with my settings.
Author:  Smoochie88 [ Mon Apr 23, 2012 2:12 am ]
Post subject:  Re: Follow My Leader auto-trading EA

Hi, wanted to post my settings and test this EA out. One little problem though.. EA keeps opening orders and then close them all in a loop till all money is gone. :lol:

broker: FXOpen
settings: OOTB

any ideas what I'm doing wrong? I'd like to contribute with some results!
Author:  jboy [ Mon Apr 23, 2012 2:26 am ]
Post subject:  Re: Follow My Leader auto-trading EA

Member: jboy
Criminal: MB Trading
Pairs: All GBP pairs
TimeFrame: 60
Threshold: 30
CashTakeProfit: 60
CashStopLoss: 30

Member: jboy
Criminal: MB Trading
Pairs: All EUR pairs
TimeFrame: 60
Threshold: 25
CashTakeProfit: 100
CashStopLoss: 50

These threshold settings were selected based on ATR on the 1HR timeframe. The Cash targets were chosen based on the number of pairs and the daily ATR. And the stop was basically just 1/2 of the targets because I always want to have a 2:1 profit:loss ratio to stack the odds my way.

Disclaimer: I want to apologize in advance if my demo stops because MB Trading is not that great on their demos. I have had many instances of not being able to close certain pairs on their demo account. Their demo server is quite unreliable. We'll just have to see how it goes because I trade with them live, and they don't have these kind of problem on their live server. US based, so no hedging.
Author:  jboy [ Mon Apr 23, 2012 5:44 am ]
Post subject:  Re: Follow My Leader auto-trading EA

I trade 0.10 EURUSD to see if the demo is working, and it is ready and tradeable. Now all we have to do is wait for the movement.

And MB Trading does not have GBPNZD.
All times are UTC Page 1 of 4