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

Bob and Jem and Shelley's Pivot Basket auto-trader
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=658
Page 1 of 28
Author:  SteveHopwood [ Sat Jun 30, 2012 3:16 pm ]
Post subject:  Bob and Jem and Shelley's Pivot Basket auto-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 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:

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

Background
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.

Along came Jemook and ran with this idea. Read his Uber thread at http://www.stevehopwoodforex.com/phpBB3 ... f=37&t=640.


Jem's PM
Here is the text of Jem's pm to me a few days ago. It explains the method the EA uses to trigger trades and close positions:
"This is based on 10.2a and baskets.

If you want a simple and easy to code EA (not too many crazy processes) that would absolutely smash it in my experience this would be it:

D1 Slope must be >= 0.6 for buy or <= -0.6 for sell

- for buys:
- weekly pivot > monthly pivot
- H4 chart. Market must close below the daily pivot (retrace) and then close above (trigger)

- for sells:
- weekly pivot < monthly pivot
- H4 chart. Market must close above the daily pivot (retrace) and then close below (trigger)

Triggered trades would be what goes in the basket. Launch the basket when a % of the basket meeting the requirements. Once the basket is triggered then close any pair (at a loss) that closes on the other side of the pivot.

ie;

- in a buy if it closes below the daily pivot shut the positionat a loss
- in a sell if it closes above the daily pivot shut the positon at a loss.


Include all your awesome TP/SL options and you are good to go. Wow it's so simple and would be crazy good.

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

Inputs that might need explanation
  • - PairsToTrade: your list of potential trade pairs. If you leave this blank, bjs will insert the current chart and become a single-trading ea using Slope and pivots to trigger an individual trade.
    - MinimumPercentOfBasket: the percentage of potential trades required to trigger sending the basket.
    - AllowAdditionsToBasket: this allows bjs to add fresh trades to the basket as they are triggered by a retrace beyond, then cross back over the daily pivot. The effect of this is to override MinimumPercentOfBasket and allow bjs to build baskets trade-by-trade rather than as all-in-at-once.
    - OnlyAddToOpenBasket: this combines with AllowAdditionsToBasket but will only allow additional trades once there is a basket in place. if 'true', it will not allow the basket to start at all until the required percentage of crosses have taken place.
    - CriminalHasSundayCandle: set this to true if your crim has a Sunday candle, so that Monday's daily pivot is based on Friday's movement, not Sunday's. This is enabled by default.
    - SendAlertNotTrade: tells bjs to show an alert and send an email when a trade is triggered, but not actually send the trade.
    - SendAlertWithTrade: tells bjs to show an alert and send an email when a trade is sent.
    - SlopeTimeFrame: time frame for Slope, defaulting to the D1.
    - SlopeBuyLevel: prepare to buy at and above this level.
    - SlopeSellLevel: prepare to sell at and below this level.
    - PivotCrossTimeFrame: your trading chart time frame. Defaults to the H4.
    - EnforceTripleAlignment: if 'true' (the default) all three pivots must line up to allow a trade.
    - Stop loss and take profit inputs described below.
    - EndlessLoop: you will find the profit level of a large basket of trades changes rapidly, and it is desirable to have this calculated more often than by waiting for the next tick on the chart hosting bjs. To achieve this, bjs goes into an endless loop that checks the position twice a second. It turns out that this causes an EA freeze on some machines, so EndlessLoop allows you to cancel this feature. If your EA does not read the table once a minute, then set EndlessLoop to false.
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.
    - 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 left over from previous incarnations of Shelleyxxx EA's and is probably redundant.

BJS recognises the trades it 'owns' by the MagicNumber input. If you use no magic number, that equates to a zero mn. Manual trades have a zero mn. Therefore, BJS owns the trade, whether that was your intention or not, so do not mix manual and BJS trades without setting a >0 MagicNumber first..

Chart display
Only those pairs that fulfil the first two criteria for trading are shown on the chart. These are:
  • - Buy: Slope >= SlopeBuyLevel. W1 pivot > M1 pivot.
    - Sell: Slope <= SlopeSellLevel. W1 pivot < M1 pivot.
If "Daily pivot cross" reads "Waiting for a pivot cross.", then there has not yet been a retrace beyond, then recross of, the D1 pivot.

Chart bar count
It is essential to the Slope calculation that there are sufficient bars in your chart history. Go to http://www.stevehopwoodforex.com/phpBB3 ... 189#p14189, download and run the script you find there.

BJS cycles through your trade pair list at startup, and checks that each chart has at least 100 bars (does not check the MN1 chart). If it finds a chart with insufficient bars, it shows a screen message telling you to carry out the step in the previous paragraph.

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:  monkeh [ Sat Jun 30, 2012 3:27 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

another gem, thank you steve!

why is monday so far away!
Author:  blazko [ Sat Jun 30, 2012 5:16 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Can't wait for monday open :)
Thanks a lot!
Author:  Armen [ Sat Jun 30, 2012 6:18 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Thank you Bob, Steve, Jem, Shelley, et all. :)
Me too. Can't wait till Monday

Steve what about shortening the name to BJeS Pivot Basket auto-trader ?
Author:  garyfritz [ Sat Jun 30, 2012 6:24 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Very cool. Great for those of us who tend to be asleep during the London session!
Author:  SteveHopwood [ Sat Jun 30, 2012 6:45 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

garyfritz wrote:Very cool. Great for those of us who tend to be asleep during the London session!
Like me, mentally at least - and I live in the UK. Anything that replaces my brainpower is A Good Thingy. :lol:
Author:  Armen [ Sat Jun 30, 2012 7:13 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Hi Steve, Jem and all

I just thought it would be interesting to make a kind of a competition between BJeS basket auto-trader and manually traded basket. What I suggest is to let one instance of basket to be traded by BJeS auto-trader and the other one traded manually with 10.2A Jem's rules.
Then we can compare the results for the next week.
Sorry for my bad English. There was no luck to attend such a good English school like Bob's one in Guangxi, China.
Author:  Armen [ Sat Jun 30, 2012 8:12 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Steve,
Just one question to avoid misunderstanding.
In case of 5 digit criminal shall we put number of pipets or number of real pips.
For ex. if I want to put 40 real pips what should be the input for AdaptiveTakeProfit 40 or 400 ?
Thank you.
Author:  SteveHopwood [ Sat Jun 30, 2012 8:22 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Armen wrote:Steve,
Just one question to avoid misunderstanding.
In case of 5 digit criminal shall we put number of pipets or number of real pips.
For ex. if I want to put 40 real pips what should be the input for AdaptiveTakeProfit 40 or 400 ?
Thank you.
Thanks to the incomprehensible nagging of Gary, and the Janet and John Big Print contributions of Lifesys, you can Officially Forget about pipets/points/Christ-knows-what-the-pathetic-turdbrained-crims-will-come-up-with-next.

As of two weeks ago, points do not exist so far as newly-created EA's are concerned. We are firmly back to Proper Pips and will remain so for ever.

:D
Author:  Armen [ Sat Jun 30, 2012 8:32 pm ]
Post subject:  Re: Bob and Jem and Shelley's Pivot Basket auto-trader

Nice and clear Steve. :lol:
Thanks a lot.
Have a great weekend.
SteveHopwood wrote:
Armen wrote:Steve,
Just one question to avoid misunderstanding.
In case of 5 digit criminal shall we put number of pipets or number of real pips.
For ex. if I want to put 40 real pips what should be the input for AdaptiveTakeProfit 40 or 400 ?
Thank you.
Thanks to the incomprehensible nagging of Gary, and the Janet and John Big Print contributions of Lifesys, you can Officially Forget about pipets/points/Christ-knpw-what-the-pathetic-turdbrained-crims-will-come-up-with-next.

As of two weeks ago, points do not exist so far as newly-created EA's are concerned. We are firmly back to Proper Pips and will remain so for ever.

:D
All times are UTC Page 1 of 28