Flying Slope auto-trading EA

Post Reply
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Flying Slope auto-trading EA

Post by SteveHopwood »

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.
    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.
      - How to use the Slope indi from Nanningbob's 10.2 system:
      • - first visit Jemook's thread at http://www.stevehopwoodforex.com/phpBB3 ... 562#p17562 Here you will find where to start reading about Nanninbob's 10.2 and learn to trade. Bob's stuff is the best thing to arrive during my time trading Forex. It is massive. Jem's thread will help you get started if this is new to you. I once stated that Recovery may well turn out to be Bob's lasting legacy to us retail Forex traders. I was wrong; this is actually going to be Slope, and it will have a part to play in everything we do from now on.
DO NOT TRADE THIS EA LIVE YET. It has some problems

Background
We have the generosity of chonghm for this EA. Chong commissioned me a few months ago to code a privately paid for EA, based on trading 'Flying Buddhas'.

A Flying Buddha (FB) is a candle that trades entirely above or below a moving average. The attached smFlyingBuddha Signals_v2 shows these by displaying an up or down arrow, so place it in your Indicators folder and drag it onto a chart to see the display. This indi was coded by SwingMan, best known at FF. I don't know if SwingMan is a member here; our warmest appreciation to him for making his indi freely available. The indi draws two moving averages on your chart; the relationship of one to the other is irrelevant here. All that matters is that the candle should trade entirely above or below them.

FB's are strong reversal signals, so an up arrow follows an extended down move and indicates a strong possibility of a buy trade succeeding.

Chong does not contribute often, but when he does is well worthwhile listening to. He is one of the better thinkers available to us. He noticed that a trade was more likely to be successful if it was taken in conjunction with a previous FB on a higher time frame, so we evolved a system of trading only when the H4 and H1 FB's agreed.

We further evolved a Recovery system, Martingaling our lot sizes if the market continued to move against us, allowing a new trade following a lower time frame FB so long as the market moved against us by a minimum number of pips. I traded the EA live on GU successfully for several weeks. A decent move against my trades were always followed by a sufficient retrace to allow Recovery to kick in and rescue the situation.

Bob has a wonderful description of a market that continues to move against the trades, albeit slowly but steadily - he calls it a 'leaking toilet'. Wonderful. Said leaking toilet took possession of GU a few weeks ago, around about the time that Bob introduced 10.2. Slope et al indicated that this leak was set to continue for a while, so I closed out the trades and dumped the EA. There is an unbreakable, unshakable, unavoidable principle in Forex trading: if it is bad for you, and it can happen, then it will happen - and probably sooner rather than later. The original EA fell foul of the leaking toilet once, and would continue to do so.

Chong contacted me last week, asking me to combine FB with Slope and to share it with you guys here. Sharing is enlightened self-interest, as we want the Brains Trust here to weigh in to see if this one can be turned into a long-term winner. It is a combo of Flying Buddha and Slope, hence the name Flying Slope.

Chong's basic trading rules are these:
  • - trade long when:
    • - there is an up FB on the H4 chart.
      - D1 Slope >= 0.6
    - go short when:
    • - there is a down FB on the H4 chart.
      - D1 Slope <= -0.6
Guys, you really need to understand what the Slope indi tells you, so do not take this brief summary as The Definitive Statement. Basically, Slope tells us this:
  • - >= 0.4: look to buy and take profit somewhere along the line.
    - >= 0.8: look to buy and hold the trade, and add to the position as the market continues to rise.
    - <= -0.4: look to sell and take profit somewhere along the line.
    - <= -0.8: look to sell and hold the trade, and add to the position as the market continues to fall.
Added to Chong's basic rules, I have added the ability to use multiple time frames so:
  • - Slope beginning with Htf are the primary Slope inputs. I leave you to work out for yourself what HtfBuyLevel and HtfSellLevel refer to - look at the defaults. If you want to use a lower time frame Slope to confirm the trade direction a la 10.2, the set LtfTimeFrame to a > 0 value, because LtfTimeFrame = 0 disables this filter.
    - Flying Buddhas also have two available time frames:
    • - LowerTimeFrame is the trading time frame. By default, this is the H4 tf because this is what Chong asked me to trade.
Since coding as described in the previous paragraph, Chong sent this. Imagine there is already a sell trade open:
  • - market crosses the moving average downwards.
    - at the opening of a new candle, there is an up FB arrow at the previous candle.
    -set a pending trade a few pips below the low of the signal candle. Provided the slope on the LTF signal is also bearish and not ranging
    - rinse and repeat, subject to a minimum pips distance between the trades.
    - close all cumulative trades when HTF slope goes ranging and not on HTF FB. Closing via FB on HTF tend to be hasty and not catching the trend..
The inputs for stacking trades are:
  • - StackDistancePips: the minimum distance between trades. Set this to 0 to disable trade stacking.
    - HiLoBuffer: the buffer to add to/subtract from the high/low of the signal candle.
Slightly confusing all this so, take the two elements here separately:
  • - Slope:
    • - always use D1 (HtfTimeFrame=1440) until you know what you are doing.
      - use LtfTimeFrame=240 if you want trend confirmation a la 10.2
    - FB:
    • - LowerTimeFrame is the trading time frame, defaulting to the H4.
      - HigherTimeFrame demands that the higher time frame should have generated a previous FB in the same direction.
Trade exit
There are the usual suspects available - tp, sl and mptm thingies. In addition, there are options to close trades on opposite direction FB signals (CloseOnLtfSignal/CloseOnHtfSignal) and when Slope moves into ranging values.

If you enable CloseOnHtfSignal, you are telling FS to close a buy trade if there is a down arrow on the higher time frame chart (vice-versa for a sell). You need a value in the HigherTimeFrame Flying Buddha inputs section. To stop FS from using the Htf FB as part of the trading decision, set UseHigherTimeFrame to false.

It iw well worthwhile reading Tebis' post at http://www.stevehopwoodforex.com/phpBB3 ... 883#p20883. Find the trade copier at http://www.mt4i.com/appstore/category.a ... popularity.

'Rogue' trades and the safety features
Sometimes a concatenation of unexpected/unforseen combinations of inputs plus a bit of coding logic failure, creates a sequence of trades that open and close immediately - often only a tick apart. What is happening is this:
  • - the EA is detecting trade opening conditions.
    - at the same time, there are trade exit conditions in place, so the bot:
    • - obediently opens a new trade because the conditions are in place for opening.
      - at the next tick, obediently closes the trade because the conditions are in place for closing.
      - at the next tick, obediently opens a new trade because the conditions are in place for opening.............
Well brunged up, my bots. Exceptionally obedient, but somewhat thick. :lol:

For convenience, I have elected to call these trades 'rogue' trades. Whenever I refer to rogue trades, I am discussing those I just described.

There are a couple of safety features intended to prevent accounts from being drained by a sequence of rogue trades kicking in:
  • 1) I have introduced a minimum time between trades:
    • - MinMinutesBetweenTrades (minimum time allowed to elapse between the closing of one trade and the opening of the next).
      • - when an attempt is made to trade too soon after the close of a previous one, the EA will display the message that it is unable to trade, at the head of the chart feedback display..
    2) I have added code that will detect when a trade has closed, and shuts the ea down if the open and close are less than 5 minutes apart. The chart will have an eye-catching flashing message warning you of a possible rogue trade, and that it has suspended itself. It will email you with the same message, if you have your platform set up to send emails.
Be warned that there is no way of permanently disabling an ea. We can stop it temporarily, but it will restart as soon as you restart the platform. If your chart shows either of the warning messages:
  • - immediately turn off Expert Advisors by clicking the Expert Advisors button at the top of your chart.
    - remove the ea from your chart(s).
    - report what happened in this thread, preferably with a picture. The safety features are intended to protect your account from being drained by a long sequence of rogue trades. They are not a patch for faulty code, so any rogue behaviour needs reporting
When suspended, FS will continue to manage open trades.

Shell user guide
This is for coders to adapt and distribute if they have used my shell code to create their own EA's, so much of it does not apply here. I add it so that you can look up the meaning of inputs such as UseZeljko etc.

In conclusion
I have traded an earlier incarnation of this EA. I rely on Slope for my current live trading. FS is a combination of the two and I regard it as highly promising.

Have fun.

:D



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=803#p803
You do not have the required permissions to view the files attached to this post.
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
pacinvest
Trader
Posts: 150
Joined: Tue May 15, 2012 10:24 am
Location: Whangarei, New Zealand

Re: Flying Slope auto-trading EA

Post by pacinvest »

Thanks Steve this looks promising indeed will get it going this week.
Amit
Trader
Posts: 40
Joined: Wed Jul 04, 2012 8:55 am

Re: Flying Slope auto-trading EA

Post by Amit »

Thanks . Q here. There's two files . Is one for the slope/ buddha combo and the other just slope? or do we need both to test the EA.

thanks.
ffxbettor
Trader
Posts: 12
Joined: Thu Feb 02, 2012 12:08 pm
Location: France

Re: Flying Slope auto-trading EA

Post by ffxbettor »

Amit wrote:Thanks . Q here. There's two files . Is one for the slope/ buddha combo and the other just slope? or do we need both to test the EA.

thanks.
You need both files, as the EA use iCustom() to get signals from the flying buddha indicator.
Larryk
Trader
Posts: 31
Joined: Wed May 30, 2012 7:39 am

Re: Flying Slope auto-trading EA

Post by Larryk »

Hi Steve

Just to let you know the link to your shell EA no longer exists.

Looking forward to testing this baby though

Larry
Amit
Trader
Posts: 40
Joined: Wed Jul 04, 2012 8:55 am

Re: Flying Slope auto-trading EA

Post by Amit »

Ok ..have put the first into the experts folder , it appears as the EA ...and the 2nd I have put under experts/ indicators folder...

Back tested it under first model ( every tick) and h4 selected... completed. Took 2 min 25 seconds. Nothing happened . This is all it said. " 2012.07.08 14:03:35 There were 1 passes done during optimization, 1 results have been discarded as insignificant "

Lost here.


thanks
ffxbettor wrote:
Amit wrote:Thanks . Q here. There's two files . Is one for the slope/ buddha combo and the other just slope? or do we need both to test the EA.

thanks.
You need both files, as the EA use iCustom() to get signals from the flying buddha indicator.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Flying Slope auto-trading EA

Post by SteveHopwood »

Larryk wrote:Hi Steve

Just to let you know the link to your shell EA no longer exists.

Looking forward to testing this baby though

Larry
Cheers Larry - the reorganisation caused that. Fixed now.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
Alpenkorps
Trader
Posts: 213
Joined: Thu Dec 15, 2011 4:03 am

Re: Flying Slope auto-trading EA

Post by Alpenkorps »

Hey Steve, Thanks for the new EA, it looks golden.

I am backtesting possible settings on different pairs, I'll post my results on results sections.

I was getting the "Creting Alert" with Alpari NZ backtester (Demo account). I thought I would try to fix it without bugging you. Here is the fixed version if anyone face the same problem.

Cheers.
You do not have the required permissions to view the files attached to this post.
Take my love, take my land, Take me where I cannot stand
I don't care, I'm still free, You can't take the sky from me
User avatar
Xeroforex
Trader
Posts: 35
Joined: Fri May 25, 2012 12:23 am
Location: Melbourne, Australia

Re: Flying Slope auto-trading EA

Post by Xeroforex »

Amit wrote:Ok ..have put the first into the experts folder , it appears as the EA ...and the 2nd I have put under experts/ indicators folder...

Back tested it under first model ( every tick) and h4 selected... completed. Took 2 min 25 seconds. Nothing happened . This is all it said. " 2012.07.08 14:03:35 There were 1 passes done during optimization, 1 results have been discarded as insignificant "

Lost here.


thanks
ffxbettor wrote:
Amit wrote:Thanks . Q here. There's two files . Is one for the slope/ buddha combo and the other just slope? or do we need both to test the EA.

thanks.



You need both files, as the EA use iCustom() to get signals from the flying buddha indicator.
:idea:

Hi Amit,

I note it's a Sunday when you posted this, some indi's EA's etc need tick data to function. If you've loaded them on the weekend and your crim's trading platform isn't currently live then that's a possible reason. I haven't used this particular Ea, Indi combo, but maybe wait until Monday morning trade opens and then see, also you may need to reload them when live ticks are being generated.


Cheers...Ted
“If you want to make an apple pie from scratch, you must first create the universe.”
User avatar
Xeroforex
Trader
Posts: 35
Joined: Fri May 25, 2012 12:23 am
Location: Melbourne, Australia

Re: Flying Slope auto-trading EA

Post by Xeroforex »

[quote="SteveHopwood"]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.
    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.
      - How to use the Slope indi from Nanningbob's 10.2 system:
      • - first visit Jemook's thread at http://www.stevehopwoodforex.com/phpBB3 ... 562#p17562 Here you will find where to start reading about Nanninbob's 10.2 and learn to trade. Bob's stuff is the best thing to arrive during my time trading Forex. It is massive. Jem's thread will help you get started if this is new to you. I once stated that Recovery may well turn out to be Bob's lasting legacy to us retail Forex traders. I was wrong; this is actually going to be Slope, and it will have a part to play in everything we do from now on.

DO NOT USE THIS EA ON A LIVE ACCOUNT. IT IS EXPERIMENTAL.

Background
We have the generosity of chonghm for this EA. Chong commissioned me a few months ago to code a privately paid for EA, based on trading 'Flying Buddhas'.....

- go short when:
- there is an up FB on the H4 chart.
- D1 Slope <= -0.6

Is that meant to be;

- go short when:
- there is an down FB on the H4 chart.
- D1 Slope <= -0.6

Cheers...Ted
“If you want to make an apple pie from scratch, you must first create the universe.”
Post Reply

Return to “Automated trading systems”