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

Secret Bob's Basket
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3896
Page 1 of 40
Author:  SteveHopwood [ Fri Oct 24, 2014 4:01 pm ]
Post subject:  Secret Bob's Basket

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.
    • The concept of 'basket' trading.
  • Members whose posts show that they are too lazy and stupid to read this and post 2 properly will lose the ability to post at all. There will be no warnings.
I am trading this on my live account.

Intro
Secret Bob's Basket is an attempted automation of of Bob's latest at http://www.stevehopwoodforex.com/phpBB3 ... =38&t=3871. Read his post 1 for the trading method. You need the attached indicator in your Indicators folder, not the one from his thread; up to you whether you have it on any charts to confirm what SBB is getting up to. SBB is an extension of Secret Bob - find it in the 'Thingy Bob EA's' sub-forum.

SBB is a multi-pair trader that offers these features:
  • place SBB on a single chart:
    • can be any chart you choose. Mine is on XAUUSD because I do not trade the pair and the display is not disturbed by trade notifications.
    • make sure the time frame is the tf you wish to trade. SBB does not have the TradingTimeFrame input that my single trading ea's have.
    • use the blank template attached before dragging SBB onto your chart.
  • can trade indi signals in both directions (always in) closing existing trades then reopening whenever a signal is generated.
  • can be made to trade only the trend signals.
  • can be made to trade only the counter-trend signals.
  • can be made to close a trade following an opposite direction signal, or leave it open.
  • can be made to trade only when the market is correctly place relative to the chart tf moving average and Bob's H4 240 LWMA Open.
  • can be restricted to trading only those pairs with an ATR >= a minimum ATR of your choice.
  • can regard the trades as individual trades to be managed in their own right, or as part of an entire-position basket, or both.
  • manage individual pairs as a basket - Mike provided the code for that.
  • baskets have both cash and pips profit targets.
  • can take notice of trade balance rules (UseZeljko etc).
  • highly flexible daily trading hours control.
  • suspend trading of a pair when SBB detects it has an abnormally wide spread.
  • replace SB as a single pair trader.
The inputs
  • Trading style inputs allow you to control opening and closing trades based on the signals you wish to use. The defaults have SBB trading only the chart's 240 MA trend and closing them when the indi generates a CT trade.
  • ShowIndividualCharts: SBB can open individual charts with your own template loaded, so you can check that he is behaving as expected. Our thanks to Arts and his Charts Into Alphabetical Order script that got me started.
    • you MUST drag SBB onto a chart you do not intend to trade for this to work. Mine is on XAUUSD.
    • load a chart - time frame does not matter as SBB will make the necessary adjustment.
    • load the SecretBob indicator so you see the arrows, and anything else you want - 240 moving average etc.
    • save the chart template.
    • input the template's name into the TemplateName input. I have attached SBB to get you started.
    • SBB updates the charts once an hour.
  • EveryTickMode: tells SBB to enter a trade as soon as the indi generates a signal. Disabling it tells SBB to look for a signal at the close of the candle.
  • AlwaysOn defaults to 'true'. A basket trader cannot be reliant upon the chart to which it is attached to trigger an action. Quotes for individual pairs are coming in all the time and the profit picture can change alarmingly quickly. Don't forget to disable experts before unloading SBB or making changes to the inputs. You will discover why the first time you forget.
  • PostTradeAttemptWaitSeconds: the latest crapform jerrybuild from crapperquotes has found ways to defeat Matt's OR code. Once SBB has attempted to send a trade, it should not make another attempt until 5 minutes has passed. It is disgraceful that we have to go to such lengths to protect ourselves, but we do.
  • ATR inputs allow you to use Atr to:
    • limit trading to those pairs with a daily range of at least AtrMinimumForTrading pips - 100 by default. Turn this filter off by setting the value of AtrMinimumForTrading to zero.
    • Use Atr to calculate your take profit or individual trades - AtrTpMultiplier. The default of zero turns this feature off.
  • Basket trade management inputs:
    • TradeAsBasket tells SBB to regard all trades with its magic number as part of a basket and to apply the basket profit targets to them. These are:
      • CashProfitTarget: your 'hard-wired' profit target in cash. You want the position to close at $40 profit, then 40 is the input you use.
      • CashProfitTargetPerTrade is an adaptive target. SBB multiplies this figure by the number of open trades on the platform to calculate the target. 10 trades at the default of 3 wold produce a profit target of $30.
    • The two pips targets work in the same way.
    • You can set both a cash and a pips target and SBB will close the basket when this target is hit.
  • TradesToConstituteBasket: 'basket' traders usually send a batch of trades at the same time. SBB sends individual trades when the indi fires a signal, so this input tells him how many trades need to be open before regarding them all as members of a basket.
  • Trading hours. How to use this input is described in the input text and in any of the gazillion user guides scattered all over this forum. There are inputs for each day of the week, so you can be as flexible as you wish to be. The close trade hour inputs apply to the end of the week and are:
    • FridayCloseTradesHour: Set this to the local time at which you want SB to close all open trades on Friday, so that you can have a restful weekend and not risk your trades being hit by 'the gap'.
      • Remember that in Crapql4, midnight to 12.59 at night is hour 0 not hour 24. Enter in input > 23 to disable this feature.
      • Also make sure your FridayCloseTradesHour is later than your stop trading time, or else SBB will close trades the tick after he opens them.
    • There is an equivalent input for our friends in Upside Down Lands. Disable them with an impossible hour input - 30, for instance.
    • NEVER even give a second of thought to asking questions about trading hours inputs. Questions about time are banned from this thread and anybody flouting this rule faces a bar from contributing at all.
  • IndiIntervalReadSeconds: the indi will be an intense user of the cpu, so set this to an interval that will give your cpu some breathing space - say 5 or 10 seconds. By default it is probably zero as I am developing the code and want up the the moment information on my chart.
  • Bob's H4 240 LWMA Open filter. You can force pure trend trading by enabling this filter. Do this by setting MaPeriod to > 0; it needs to be 240 to work as intended - the default. SBB will only go long when the market is above both the chart 240 MA and Bob's filter - so don't bother enabling it on the H4.
  • Average spread: SBB keeps track of the average spread of each of the pairs in its PairsToTrade list. He will abort a trade if the current spread is MultiplierToDetectStopHunt times the average. For example, by default: average spread = 1; current spread = 3; abort the trade.
  • Trade balance filter. 'Balanced' trading is all about not over-exposing yourself to a particular currency. For example, you buy GJ, GU, GN and sterling goes south; three trades and a lot of money goes with it.
    • UseZeljko: will only allow alternate buy and sell trades for a particular individual currency. So, having just bought GU, SBB will not be prepared to buy another gbpxxx pair. It will be happy to sell gbpxxx, then buy gbpxxx, then sell gbpxxx.
    • OnlyTradeCurrencyTwice limits the exposure of an individual currency to two trades. For example, having bought GJ and sold GU, he will take no more gbpxxx trades.
  • Available Margin checks: I would have to read my own user guide to find out how Scoobs works. I always chose UseForexKiwi. The default FkMinimumMarginPercent prevents new trading once your margin level drops below 400%. It does not prevent a trade that takes your margin below this figure, so always set it about 100 greater than your actual minimum.
  • Mike's individual pair as a basket inputs:
    • magft (Mike) has contributed code to this EA that allows us to treat each pair it is trading as an individual basket. This is different to enabling TradeAsBasket to force SBB to treat all open trades as a basket. Imagine you have 3 GU, 2 EU and 5 GJ trades open. Mikes code allows us to treat each individual pair as a 'basket' and manage each 'basket' individually. The inputs are:
      • BasketCashSl: the individual pairs' basket of trades closes when their combined loss hits this cash total. Enter this input as a positive number - SBB does the conversion to negative.
      • BasketCashSlPercent: the individual pairs' basket of trades closes when their combined loss hits this percentage of balance figure. Enter this input as a positive number - SBB does the conversion to negative.
      • BasketCashTp: the individual pairs' basket of trades closes when their combined profit hits this cash total.
      • BasketCashTpPercent: the individual pairs' basket of trades closes when their combined profit hits this percentage of balance figure.
  • Nanningbob Recovery. SBB includes a simplified form of Recovery. Here is an example of how it works:
    • SBB takes a buy trade. The market plunges and the trade goes into DD by, say, 40 pips.
    • there is another buy signal so SBB takes a second trade. The first is -40, the new one is at 0 (forget the spread for the purpose of the example).
    • the market responds to a stern talking to, pulls itself together and starts to rise.
    • it rises by 20 pips. Trade 1 is -20; trade 2 is +20. The position is at breakeven and can be closed without loss.
    • the inputs are:
      • EnableRecovery: turns Recovery on. Disabled by default.
      • TradesToTriggerRecovery: the number of trades open before the pair needs Recovery. If this is > MaxTradesPerPair then Recovery cannot kick in.
      • RecoveryProfitLockPips: hang on until the pair's upl is at this pips profit before closing the trades. Using the above example: the market rises 25 pips after the second trade is taken; trade 1 is -15; trade 2 is +25; this is a 10 pip profit and is the default for this input. This pays for costs such as swap, spread and commission.
  • The individual trade management Breakeven, Jumping and Trailing Stop features are described in user guides all over this forum.
Changing your inputs
Do not use the F7 key to change your inputs. It is a notoriously unreliable method anyhow, and wreaks havoc when the EA is a always-on multi-pair trader. This is the sequence of events you need to follow to ensure a smooth transition:
  • disable Expert Advisors - button at the top of the chart.
  • delete SBB from the chart.
  • drag a fresh instance of SBB onto the chart:
    • make your changes in the inputs window.
    • save the changes in a setfile for next time.
    • click OK.
  • re-enable Experts. Do a quick F7 and look at the Common tab to ensure they really are enabled - the latest crapform jerrybuilds have played merry hell with them.
Trading methods
There are soooo many for us to play with. Live, I shall:
  • H4 tf.
  • all the features enabled by default supply the nitty gritty details, but basically trading in the direction of the overall trend and closing them on a CT signal, with basket trading enabled to take advantage of fluke runs.
On demo, I shall try all kinds of thingies.

Using SBB as a single pair trader
Leave PairsToTrade empty and SBB will trade as a single pair trader on the chart hosting him.

Stochastic filter
I added this in response to this post by pacinvest: http://www.stevehopwoodforex.com/phpBB3 ... 01#p104001

By default this filter is completely turned off. You have to elect to use it.

There are three Stochastic levels available to you. You turn them on by setting their respective time frame inputs to > 0. For example, set StochTF1 to 15 and it will examine the M15 Stochastic. There are the equivalent StochTF2 and StochTF3 inputs. All three have their own individual settings as suggested by their input names.

If you are confused by all this, then I suggest you leave the inputs alone until the likes of pacinvest start to publish some conclusions. At the basic level, Stochastic when over bought (usually measuread at > 70) means the pair has be bought for a substantial period and is due a retrace. The opposite is oversold at < 30. If it were that simple then all of us here would be filthy-stinking rich. It isn't, so we aren't. It is a useful tool when you know what you are doing.

Required indicator
You will need the attached 240.V.11_ BUY.SELL.NOW.ALERT.ex4 indi in your indicators folder for the EA to work. Read post 2 for a description of how the indi produces its signals.

Just starting out and confused?
Tough. I don't care. That is your problem not mine and if you attempt to clutter up this thread with newbie questions I will delete your registration at SHF. Ask them instead at http://www.stevehopwoodforex.com/phpBB3 ... 57#p102957 where you will find a sympathetic response to your difficulties.

Quick start
Dowloiad Gertje's setfile for the H1 from http://www.stevehopwoodforex.com/phpBB3 ... 10#p104110 if you want something up and running quickly.

This one for the M30: http://www.stevehopwoodforex.com/phpBB3 ... 29#p104129

Remember that live I am on the H4.

In conclusion
Have fun. Every body else is.

:xm:



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:  SteveHopwood [ Fri Oct 24, 2014 4:01 pm ]
Post subject:  Secret Bob's Basket

I have the privilege of having the source code for Bob's indicators. He sent it to me in the hope that I could use the formula in SB and still keep it hidden. I cannot, and so we must continue to use the indicator. Nor can I give any hint as to what that formula is.

What I can do is reassure you all that it makes this method of trading as safe as can possibly be. It is mind-boggling just how safe it is. Just bear in mind:
  • do not overtrade. This is a trading system that will generate trades quickly on the shorter time frames. You will soon have trades in place on all the pairs you trade even on the higher time frames:
    • don't trade lower the M15 time frame.
    • only trade higher than H1 if you have a decent sized account.
    • use the ForexKiwi available margin check. This will be enabled by default in future releases.
I am able to set up a template on my charts that represents the formula used by the indi's. I have spent a happy couple of hours today studying different pairs and time frames, with mounting excitement and pleasure. The way it generates the signals is simplicity itself, yet it takes genius to think of it. Yet again Bob, we applaud you mightily. :clap: :clap: :clap: :clap: :clap:

So, what do the signals represent? They represent the passing of the peak or trough of the market waves. We buy at the passing of a trough (up arrow) and close the buy and open a sell at the passing of a peak (down arrow). For the purposes of SB for the time being, the trade being a trend or counter trend trade is irrelevant. In future we might opt for different lot sizes; we shall see.

This next bit is for the noobs. You may not fully grasp yet that the markets move in waves. They might be trending up or down, or ranging, but they never move in a straight line. Have a look at this chart:
Bare chart.png
Lovely clear downtrend - cherry picked for that lovely steady march downwards from left to right. Can you see the waves though? There were times when the market rose instead of falling. Here is the chart as a line chart:
Line chart.png
Here is the bar chart with the indicators attached:
Bar chart with indi.png
You might want to open it in a new tab so you can see it more clearly. Can you see where the indi's draw their arrows? The large red trend sell arrows come after a peak; the smaller pink up arrows are counter trend buy arrows and come after a trough. Here is the line chart:
Line chart with indi.png
In a range, marked by the yellow lines and with the 240 lwma open added:
Range.png

Brilliant. Stunning. Pips by the umpteen. Will there be losers? Yes. Look at the highlighted rectangle. The four sells would be closed when the ct buy signal appeared; the first sell would have been a loser, although overall the group would have emerged in profit. I am not at liberty to divulge how the formula spots when the peaks and troughs have passed; it is enough for us that it does.

There is a drawback to the indi that only emerged with use. The signals mark the bars where trades could have been opened and closed. The do not mark the market price at which these events would take place. The actual distance in between the signals is much narrower than it looks on the chart, so trades that look like clear winners when eyeballing the chart could easily have been losers. We shall have to wait and see what effect this has on our trading.

So, we need a stop loss, but it must be an emergency sl only and be placed a long way from the trade open price - hence the default of 100 pips. There is an immutable, unavoidable, unbreakable law in trading Forex and it is this: if it can happen and it is bad for you, then it will happen, and sooner rather than later. There will come a time when a trade or group of trades get caught on the wrong side of a 700 pips in 10 minutes movement against you; the stop loss will save your account.

There is a cost to the way SB trades. Every time we trade we pay the spread; those of us lucky enough to be Global Prime clients pay the commission. It might be much more profitable on the higher time frames to hold the trend trades and open/close the ct trades. We shall see.

It could emerge with use that an FB style minimum distance between trades will be helpful. We shall see. My coding is reasonably good these days, so a change to the code is less likely to have LUC inviting his buddies around for a party.

I do not make this next statement lightly. I regard this as the safest trading method I have seen in 8 years of trading. We are all going to make pips, and lots of them. I shall be replacing FB with SB on my live account on Monday; that is how good I think the method is.

Which brings me to the thorny problem of brokers. Those of us fortunate enough to be Global Prime clients are sitting pretty. Anyone reading this who is eligible for an account yet has not yet signed up, do so immediately; go to http://www.stevehopwoodforex.com/phpBB3 ... 762#p35762 and click the link in Jeremy's signature.

If your current so-called 'broker' is a market maker or worse, you will have problems once you start to become profitable. Read http://www.stevehopwoodforex.com/phpBB3 ... =52&t=1475 for definitions of 'market maker' and 'bucket shop' and a description of some of the stuff they get up to. The bad ones will throw every nasty trick in their book at you - and most of the rest are bad. Someone ask Bob whom his broker is; he is a US citizen and so ineligible for a GP account - at least until the next Presidential election. :D Also have a look at ForexNation http://www.stevehopwoodforex.com/phpBB3 ... 890#p67890

One of the most respected members of SHF is boldtrader. Bill appears to be happily using ATCBrokers in this post here according to my reading of his post at: http://www.stevehopwoodforex.com/phpBB3 ... 90#p101990

The next few months are going to be a blast guys. Have fun.

Another note for the noobs. Trading Forex is much more complicated that it first appears and most people need a few thousand hours peering at charts before it makes sense. If any of the above confuses you, then you need to spend some time at Babypips http://www.babypips.com/school. That is not an insult; there will not be many successful members of SHF who did not spend many hours there when we first started. I did. There you can learn all the basics.

:xm:
Author:  patmontes [ Sat Oct 25, 2014 1:29 am ]
Post subject:  Secret Bob's Basket

Will give this a go this week as well side by side with the single pair trader
Author:  mobthehop [ Sat Oct 25, 2014 2:02 am ]
Post subject:  Secret Bob's Basket

Thanks a lot Steve!
Author:  Radar [ Sat Oct 25, 2014 2:16 am ]
Post subject:  Secret Bob's Basket

Hey Steve,

Thanks for this :) I'd been trying to make a multi-pair version of FB, but kept stuffing myself up :( Would have gotten around to this pretty quickly if my head was in the right place (I lost it somewhere a couple of months back).

Loaded on the M15, with individual trade TP set @ 500P, and basket TP set @ 50P, as I figure it'll be easier to nibble away at the market, rather than try and bite a huge chunk out of it ;)

I'll give that a couple of weeks, then add an instance on the M30, H1 & H4.

Take care,

&

Have fun!

Radar =8^)
Author:  SteveHopwood [ Sat Oct 25, 2014 7:29 am ]
Post subject:  Secret Bob's Basket

I still have changes to make to both the ea and to post 1 - that is why I have not placed any 'new toy' messages elsewhere.

The best thing to do is to return to post one about an hour before the markets open after the weekend, catch up with further developments and redownload everything you need.

:xm:
Author:  Gertje [ Sat Oct 25, 2014 9:27 am ]
Post subject:  Secret Bob's Basket

Lovely, just what I was looking for!
:clap:
Author:  burmanfx [ Sat Oct 25, 2014 10:32 am ]
Post subject:  Secret Bob's Basket

Great work! look forward to checking back and testing this 7am monday!
Author:  Jollyroger [ Sat Oct 25, 2014 4:52 pm ]
Post subject:  Secret Bob's Basket

Impressive.....and a hell of a lot of work on your part. Thanks Steve! :clap:
Author:  erikskenne [ Sun Oct 26, 2014 12:17 am ]
Post subject:  Secret Bob's Basket

Thanks Steve this shall be exiting to test, :hi: :hi:
All times are UTC Page 1 of 40