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

ShelleyJem. Fantastic collision of accident and analysis
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=610
Page 1 of 20
Author:  SteveHopwood [ Wed Jun 06, 2012 3:09 pm ]
Post subject:  ShelleyJem. Fantastic collision of accident and analysis

*******************************************************************************
IMPORTANT NOTICE
There is much in this thread that will inform you, but the focus of Jem's work has shifted to his own thread at http://www.stevehopwoodforex.com/phpBB3 ... f=37&t=640 I suggest you proceed there immediately.
*******************************************************************************

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:
My apologies for what is about to happen, but the ridiculous, lazy and stupid here make it essential that I batter you over the head with what seems to me like a really simple point.

Ready?

Here goes:
Listen, you pathetic, pea-brained, dim-witted cretin: even begin to consider using this robot without understanding 10.2 and you will lose all your money.

Sorry about that, but I needed to make a point. Are you a pathetic, pea-brained, dim-witted cretin? No? Then do the reading required to trade successfully.

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

Shelley does not need any of the indicators from 10.2. Thanks to Paul (Baluda), the code for them is subsumed within the EA. Paul's contribution here is monumental.

Trading
Upside-down Shelley had a lucky blast early on in her 10.2 experience, by entering a basket of trades just before going out to work, and leaving mptm to do a global close of the entire basket once it hit +400 pips. She took buys when the D1 Slope was >= 0.8 and D1 Woh > 0, and sells when <= -0.8 and D1 Woh < 0. You can find the thread at http://www.stevehopwoodforex.com/phpBB3 ... f=37&t=583. This thread is a follow-on and development of that.

It was not long before I coded Shelley the EA and the rest of us were having a blast as well. Some of the more analytical traders were pointing out that a retrace of any decent proportions would do our fun some damage, and so it has proven to be.

Apart from Bob, one of the traders with the best understanding of all this is Jemook, and it is from Jem that ShelleyJem derives the rest of um her, erm his, ummmm its, got it - their name. :lol: Tell you what; let's stick with 'her' because us guys only ever potter along in the wake of Those Who Must Be Obeyed. :lol:

Here is my understanding of what Jem is doing with his Shelley basket trading. It is open to correction:
  • - 10.2 TMA Slope signals either a buy-and-hold (+0.8), or Sell-and-hold (-0.8) during an 'active session'. An 'active session' is whatever you consider it to be, but we have been looking at the open of London, New York and Asia.
    - instead of sending the basket at a fixed time, Jem looks at lower timeframes for the basket trigger:
    • - H1 and/or H4: looks for a touch/break of the lower Tma True (not to be confused with the 10.2 Tma Slope) lower line for a buy trade, upper line for a sell - at any time within about the last 8 hours. This confirms a retrace has taken place and we are not trading on the wrong side of it. Philippe is one of the best coders in this forum; he has adapted Tma True to show both time frames on a single chart to make visual confirmation that SJ is behaving as intended easier. Find this at http://www.stevehopwoodforex.com/phpBB3 ... 672#p15672.
      - H4: looks for a touch of the 5.1 moving average - this confirms that the market has started to move back in the direction of the trend. There is no guarantee that this movement will continue; Forex will do as Forex does. The 5.1 (SMA, period 5 shift 1) is the blueish moving average you see on Bob's templates.
    - Once H1/H4 TMA True and H4 5.1 ma have lined up on roughly half of the potential trades signalled by the Slope, he uses Shelley to fire the basket.
If you want to experiment with TMA True and the 5.1 by disabling any combination, turn the relevant timeframe (TmaTrueTimeFrame1/2, MaTimeFrame) to zero. The chart field will automatically show the Slope reading instead of the filter's individual reading.

ShelleyJem attempts to combine the original Shelley with Jem's filters.

Trading sessions
There are three of these, named to coincide with the three major markets: London; New York, Asia.
All three have an open and a close time:
  • - use a 24 hour clock.
    - enter these times as decimals. For example 3.30 pm would be 15.3
    - use your clock's local time. Supposing you want your first session to coincide with London opening. When you know London has just opened, look at your clock and enter that time into LondonOpen.
    • A gentle word of warning. I know from grim experience what happens to a thread when contributors are allowed to ask questions along the lines of, "What time do I have to enter for....." These are not allowed here and will be deleted, along with any answers anyone is daft enough to give. If you cannot yet tell the time, hire someone to teach you.
Notice there are none of the time-limited basket features contained by Shelley. I can add these if they appear to be necessary.

24 hour trading, adding to the basket and non-basket trading
To keep SJ looking for baskets throughout the trading day, set the session inputs so that the end of one and the start of the next are the same. This is the default.

Once a basket was sent, that was it for Shelley. SJ has an extra input - AllowAdditionsToBasket. If set to 'true', this should allow SJ to send extra trades if a pair reaches a tradable condition. Not sure if LUC might prevent this, but I cannot see anything in the code to stop it - does not mean it is not there and I might simply not be able to see it.

Gary is speculating that all this might be better if SJ takes single trades and forgets the basket stuff. I think the following will allow this:
  • - AllowAdditionsToBasket = true.
    - 24 hour trading.
    - disable all basket tp and sl inputs.
    - set MinimumPercentOfBasket to 0.
    - use mptm to manage the individual trades.
Basket closure
There are PipsTakeProfit and PipsStopStopLoss inputs. Also a breakeven function. All of this is adaptive, so look for these inputs:
  • - AdaptivePipsTakeProfit: multiplies the number of open trades by this input to create a take profit that grows and shrinks with the size of the basket.
    - AdaptivePipsStopLoss: multiplies the number of open trades by this input to create a stop loss that grows and shrinks with the size of the basket.
    - AdaptiveBreakEvenProfitPips: creates a breakeven point by multiplying the number of open trades by this input.
    - AdaptiveBreakEvenProfitPipsLock: the profit to lock in at breakeven. Number of trades multiplied by this input creates the profit.
    - AdaptiveJumpingStopPips: multiplies the number of open trades by this input to create a jumping stop that grows and shrinks with the size of the basket.
Those were all part of Shelley. Added to ShelleyJem are:
  • CashTakeProfit: you can specify a cash profit target instead of a pips target. Note that the integer declaration is deliberate - no need to muck around with pence
    RewardPercentageTakeProfit; this is the percent of balance to use as cash tp. This multiplies the account balance by RewardPercentageTakeProfit% to auto-calculate CashTakeProfit. Leave set to zero to disable this feature.
    CashStopLoss and RiskPercentageStopLoss; as for cash take profit but for the stop loss.
There is no adaptive cash tp/sl as there is with the pips functions. I can always add these if there is sufficient demand.

Once a basket closes, S will sleep for (user choice) 90 minutes to ensure that an opened basket that hits tp within a few minutes will not open again immediately. This is loef over from Shelley and is probably redundant..

Editing your inputs
The trading method is as simple as can be. The EA is not, and the inputs are complicated; getting them wrong is disastrous.
  • - assume nothing. Check everything. OOTB may well not work. Here in post 1, I sometimes write that xxx is the default, forgetting that I changed the default during coding and forgot to change it back.
    - go through every input and make sure it reflects what you want to do.
    - save your edited inputs as set files. I have three, for London, New York and Asia.
Chart display
Only those pairs that fulfil all the criteria for trading are shown on the chart. A lot of this can come off, once we are sure everything is correct. The chart display is updated once a minute. If the H4/H1 filters are met by a pair, the chart will display 'Buy' or 'Sell', not the numeric value of the lines that have to be touched/crossed.

Using ShelleyJem as a manual trade manager
Turn the StopTrading input to 'true' to stop SJ trading. She will still indicate which pairs are ripe for trading but you are able to decide for yourself whether to pull the trigger on individual trades.

You can use ShelleyJem purely as a trade-indicator without her managing open trades by using a magic number in the EA, then no or different magic numbers when you trade. SJ recognises her own trades by the magic number, so if this is different to that of the trade then she will ignore it.

In conclusion
There are a number of thing for us to consider as we move forward. For example:
  • - do we need a basket time limit?
    - should the filters in addition to Slope need an on/off switch, so users can experiment?
    - do the ltf filters want addition inputs so users can experiment?
    - do we ditch the sessions thingy and trade 24/5? You can emulate this with the session times.
    - it would be great to have the risk/reward calculations also produce the lot sizes required to achieve total automation of this. Devising the formula is way, way beyond my capability, so over the the Maths geeks.
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.forexfactory.com/showthread. ... ost4431794, 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:  celte83 [ Wed Jun 06, 2012 3:48 pm ]
Post subject:  Re: ShelleyJem. Fantastic collision of accident and analysis

Hi,
So here we are. It will become probably the best of the best EAs ... :idea:

Thanks
jf
Author:  Jemook [ Wed Jun 06, 2012 3:59 pm ]
Post subject:  Re: ShelleyJem. Fantastic collision of accident and analysis

First of all, massive thanks to Steve for coding this up. And of course to Shelley + Bob. I had a read through the explanation of SJ EA and it sounds great, pretty much exactly what I've been doing.

I think we should ditch the session times and trade 24/5. When the ducks are lined up I'd like to be in the trade. I'm happy to keep them in but I'm not sure how to change the session times to ensure that it is always on. Any tips?

Also, after a basket is triggered then does SJ immediately trigger again at start of next session? After a basket is triggered SJ should reset and wait for price to retrace again. I'm thinking the reset could be when price moves (with trend) to the other H1 TMA. After this happens we can wait for another retrace to opposite TMA.

I agree with the risk:reward calculations, that would be awesome if we could work this one out. I'll have a think about it. I'll keep my trading discussion in here so follow along and let's see how we go!

Cheers.
Author:  garyfritz [ Wed Jun 06, 2012 4:02 pm ]
Post subject:  Re: ShelleyJem. Fantastic collision of accident and analysis

Jemook wrote:I think we should ditch the session times and trade 24/5. When the ducks are lined up I'd like to be in the trade. I'm happy to keep them in but I'm not sure how to change the session times to ensure that it is always on. Any tips?
I'd go for that too. I did some preliminary testing with my Shelley backtester and it did seem to work well to open another basket as soon as the last one closed. (Though it turned out I had "issues" with that backtester so I'm not 100% trusting the results yet.) With the additional Jem filter it should be much more intelligent about re-entering.

My only question is the one I've had with Shelley all along: should this be traded as a basket? Or should we trigger on individual pairs when their TMA/WOH/Jem line up? They're likely to set up at different times so I'm not sure a basket is the best way to trade them.
Author:  juliank [ Wed Jun 06, 2012 4:07 pm ]
Post subject:  Re: ShelleyJem. Fantastic collision of accident and analysis

garyfritz wrote:
Jemook wrote:I think we should ditch the session times and trade 24/5. When the ducks are lined up I'd like to be in the trade. I'm happy to keep them in but I'm not sure how to change the session times to ensure that it is always on. Any tips?
I'd go for that too. I did some preliminary testing with my Shelley backtester and it did seem to work well to open another basket as soon as the last one closed. (Though it turned out I had "issues" with that backtester so I'm not 100% trusting the results yet.) With the additional Jem filter it should be much more intelligent about re-entering.

My only question is the one I've had with Shelley all along: should this be traded as a basket? Or should we trigger on individual pairs when their TMA/WOH/Jem line up? They're likely to set up at different times so I'm not sure a basket is the best way to trade them.

..... looking forward to that also :)
Author:  phil_trade [ Wed Jun 06, 2012 4:08 pm ]
Post subject:  Re: ShelleyJem. Fantastic collision of accident and analysis

As usual Steve...great great job !

Thanks
Author:  SteveHopwood [ Wed Jun 06, 2012 4:11 pm ]
Post subject:  Re: ShelleyJem. Fantastic collision of accident and analysis

To set up SJ to trade 24/5, for now set each session to end at the start of the new one so there is a seamless overlap.

I think the first change I will make is to remove the variable (BasketSent) and allow SJ to take additional trades whilst the basket is open, if fresh ones become available.

:D
Author:  alex_forex [ Wed Jun 06, 2012 4:13 pm ]
Post subject:  Re: ShelleyJem. Fantastic collision of accident and analysis

Awesome :D
These NB10.2 EAs are addictive :lol:

Thanks to all contributors

Alex
Author:  Jemook [ Wed Jun 06, 2012 4:15 pm ]
Post subject:  Re: ShelleyJem. Fantastic collision of accident and analysis

garyfritz wrote:My only question is the one I've had with Shelley all along: should this be traded as a basket? Or should we trigger on individual pairs when their TMA/WOH/Jem line up? They're likely to set up at different times so I'm not sure a basket is the best way to trade them.
You'd be amazed at how they all set up at the same time. I think you can trade each one seperately but it's more fun to watch the uberbasket go green almost like magic :)

I think we might be experiencing a trend change atm. We are down to only 3 tradable pairs now!
Author:  effluvium [ Wed Jun 06, 2012 4:40 pm ]
Post subject:  Re: ShelleyJem. Fantastic collision of accident and analysis

SteveHopwood wrote:Oops. Left behind a couple of lines of code to help me ensure the risk/reward stuff is working correctly ..... :D
Some quick questions:
1) This EA does not need any other chart with 10.2 template and correspondant indis. Just attach it to a simple chart. Correct ?
2) Why there are only 23 pairs in the first extern variable of the EA instead of 28 pairs ?

3) When attaching the EA, "no active session is displayed", because time is outside NY, London & Tokyo sessions. To get rid of that, (for tests) what settings to do ? (put all time sessions = 0) ?

4) Why displaying properties of this EA is disabled? Try urself to right click on the chart , ExpertAdvisors/Properties ====> NOTHING there. Why ? (it's not solution to remove EA completly then reattach it, You agree ?)

Thanks in advance.
All times are UTC Page 1 of 20