- 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.
Welcome to my latest experimental robot. Please remember that it is experimental and is not to be used on live accounts. We have vinesh to thank for the memorable name.
Not many of you will remember, but a couple of years ago a trader called T101 posited a basket trading method that some of us adopted for a while. T101 is no longer here at FF. I did not use his method for long; it demanded a lot of screen time and my own understanding was limited at the time; T101 was inclined to hissy-fits and frequently closed his thread; it all became a little tiresome. I thought about it again earlier today.
For those of you unfamiliar with the concept, basket trading involves this:
- take out a number of trades on a variety of pairs - a 'basket' of trades.
- the fate of an individual trade does not matter. What matters is the profit of the overall basket.
- when the upl of the whole basket reaches a pre-determined point, the basket is closed and we start again.
We need to decide on the direction of each individual trade; T101 had a neat method of doing this:
- on demo, take out a whole basket of buy trades. Some will be winners, some will be losers. This does not matter. I will call this the Master Basket.
- click the Profit column, so the platform displays the trades in descending order of profitability.
- leave these trades alone for a few hours whilst the markets sort out the direction in which they are going to move.
- after a few hours have elapsed, take out a basket of trades on a separate demo account, or your live account (but not yet, guys). Buy in the direction of the successful trades in the Master Basket; sell in the direction of the losers.
- close the basket when you are happy with the upl.
That is what this robot does. When you drag it onto the chart, it simulates a trading basket internally by taking a reading of the Ask for each pair and storing this in global variables stored in your mt4 folders. Once a second, it compares the Ask with this price, and displays 'up' if the trade is a winner and 'down' if it is a loser.
There is a brilliant feature new to my programming, sent me earlier this week by gspe and added to my mptm; it checks the state of the market once a second independently of ticks received by the individual chart; mine is set up on a xauusd chart. There is a counter on the display that shows the robot is running; if this stops, the robot has stopped.
Setting up the robot
There is an input that stops the bot sending trades - StopTrading:by default, this is set to true because we need to give the robot time for the market direction for each pair to emerge. So:
- download Basket With Balls to your Expert's folder.
- download the template to your Template folder.
- close down and restart the trading platform.
- drag the robot onto a chart and leave it for a few hours. Any chart. Time frame does not matter. Only one chart. Loading the template instead of dragging the robot onto a chart has the same effect, except that it blanks out the candles that otherwise get in the way of the display.
- after a few hours, re-drag the robot onto the chart, setting up your inputs to suit yourself and setting StopTrading to 'false'. The bot will immediately start to send trades - one per pair.
Inputs: these are pretty straight-forward:
- PairsToTrade are the pairs you wish to have in your basket. Remove pairs by deleting them and their associated comma. Add pairs by including them and adding a comma.
- Lot is your order size. Make sure this is acceptable to your criminal; there is no idiot-checking.
- PipsTakeProfitTargetPerTradeis a profit target per individual trademBWB multiplies this figure by the number of open trades to arrive at a basket tp. To make baskets close more frequently, lower the default; to hold them longer, increase it. BWB automatically compensates for 5 digit criminals, so enter 'proper' pips.
- PipsStopLossTargetPerTrade is the stop loss.
- SleepHoursAfterBasketClosure tells the robot to sleep for this number of hours after closing a basket at tp or sl. If you want immediate re-entry, set this to zero.
- Trade hours: go on. Be brave. Take a guess.
- UseRsi: Set to 'true' this forces the robot to send trades only if they are in favour of the G1 Rsi. This is a trick taught me by scooby-doo in the BOJ thread. The D1 Rsi can be used to show the overall trend of a pair, given that the D1 chart us the most influential for us small-time retail traders. I use a 20 period D1 Rsi, as this represents a month of actual trading. The results it gives are these:
- D1 Rsi >= 55: market is trending upwards.
- D1 Rsi <= 45: market is trending downwards.
- In between these two figures, market is ranging.
- BWB also checks that yesterday's D1 Rsi was in the right direction as well, trying to avoid Rsi 'chop' at the boundaries.
- If you have not the faintest idea what this is all about, do some research and find out. Google 'Relative Strength Index'.
The rest of the inputs are all about the screen display, so play with them to suit yourself.
Immediate action labels
These are the 'Close all trades' and the stop/start the expert labels. To activate them, you double-click the label and move it somewhere else. Take care with the 'Close all trades' lable; this is intended for use when you want instant basket closure and BWB does not ask for confirmation.
YOU MUST ONLY TRADE THIS ROBOT ON THE ACCOUNT. You cannot trade other methods/systems at the same time. The robot has no way of recognising that there are trades it does not own, and will regard any open trade as belonging to its basket.
Once the bot has opened its first basket, click the Profit column in the trades window; it is fascinating to see the winners lining up at the top and the losers at the bottom.
squalou's upgrades
From sq's email:
"Steve,
I worked this w-e on BWB.
I made the following changes: - added a "TargetsInCash" option, and related "CashProfit" and "CashStopLoss" inputs, so you can set overall targets in account cash instead of pip counts;
defaults are +30/-120;
- updated default pip targets to +5/-10 (per pair) to stick to dryclean current settings;
- updated also the sleeping time to 30 min instead of 120;
- added inputs for the RSI settings with default H1 / 20 bars, so anyone can play with the "trend" detector;
- added "RefreshTradePriceEveryMinutes" (10) which will refresh the trade prices every 10 minutes so price limit for opening new trades won't fly too far current price (otherwize price limits were only setup when loading the robot or when the basket was being closed);
- cosmetic changes:
- colored "status" area based on current basket profit(green)/loss(red),
- display a "Sleeping countdown" when sleeping after closure
- display upl and DD in cash or pips depending on your trading option;
- code changes:
- i rearranged the code to clarify the logic: i coded the trading logic in the start() loop as a clean "state machine", to remove various "colliding" variables...
- i coded the RSI "trend" filter into a separate "get_trend()" function invoked by the start() loop, so changing the filter is easy -- function at the end of the file, easy to find. "
Many thanks, sq.
Future development:
It would be lovely if the screen pairs display could line up with winners at the top and losers at the bottom. This is only a cosmetic thingy, but I cannot sort it out. If any of you clever coders out there could do so, I would appreciate it.
More useful would be coming to conclusions about what to do with the inevitable losers at the bottom of the basket. Do we:
- close them at a certain loss point?
- hedge them at a certain loss point?
ATR might be a useful tool here. We shall see.
In conclusion
Bot's and trading systems do not come much more basic or simple than this one. I have no idea whether it can be a long, or even medium-term success. It is not going to eat much demo space, so no harm sticking it on one and seeing.
Have fun.
_______________________________________________________________
Traders familiar with my work need read no further.
Posting restrictions
I have restricted the ability to post in this thread to: traders with at least 1 voucher; and traders on my 'buddy' list. I have done this because I do not want the thread cluttered with 'newbie' questions about the basics. New/inexperienced traders, this is not intended as a direct insult. What I want here is discussion with traders who fully understand what it is they are doing; when you newbs have been around a while, you will come to understand what a difference experience makes to the posts a member writes and shudder at the recollection of some of the questions you asked. I do. http://cdn.forexfactory.com/images/s..._the_floor.gif Go to your profile page; there is a link to the FF page that describes the voucher process.
Do not attempt to get around this by sending me pm's asking for help with your basic problems. Doing so will earn you an automatic ban from all of my threads.
I have set up a partner thread to this one and Nanningbob's at http://www.forexfactory.com/showthre...66#post3948666
Here, you can post the questions that you cannot post here, about anything you need to know. Someone with the knowledge and experience you need will answer. I opened it for Nanningbob traders, but feel free to ask about this robot as well.
Traders/coders with experience who have not yet been vouched for, can get around this restriction be being added to my 'buddy' list; all you have to do is pm me to ask me to do this.