If contributors want me to re-open the thread they only have to pm me and ask, but I shall not be developing this robot further. What follows is the original thread.
___________________________________________________________________________
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.
- To trade this robot, you have to understand NanningBob's V1 Trend trading system. To learn how to do this you need to learn NanningBob's V5 trading system, so go to http://www.forexfactory.com/showthread.php?t=274194
Do not use this EA on live accounts yet.
The bot attempts to fulfil two functions:
- to replace the 1.0 5x5 buy/sell waiting ea's in Bob's thread, along with the Close ea's. The intention is to provide the functionality of the auto-trader to the manual traders.
- auto-trade Bob's V1 as I understand it. It is a simple system, so I should not have misunderstood anything, but we shall see.
Attached are two robots. They are identical. Their code is identical; their inputs are identical. The only difference between the two attached versions is that the manual trader is dragged onto your chart once you have identified a setup and looks for the trade trigger. The auto-trader attempts to identify the setup for you, then looks for the trade trigger.
You drag the manual trading version onto your chart once you have identified the setup. You do not have to worry about a buy or sell ea. If the trend is up, the bot will look for a buy trigger. If down, it will look for a sell trigger.
You can use either bot for both purposes but setting the appropriate input to true - as described further down. I am simply trying to make life easy for those who are either confirmed manual or robot traders.
Once a trade is sent, both versions of the bot manage it in the same way.
Once a trade is closed for whatever reason, the manual version should shut itself down. I have included the safety feature from the original buy/sell bots, so users should receive warnings that they are familiar with.
Once a trade is taken by either robots:
- Take profit is the opposite TMA line (or a TakeProfit input)
- Stop loss is either:
- the high/low of the previous swing (depending on trade direction) +- PipsAddToStopLoss. The bot uses Fractals to identify the hi-low. There is a minimum-stop check to ensure the stop is allowable by the criminal. MinStopLoss is the lowest stop you are prepared to accept - defaults to a wild guess of 50. I have added a multiplication factor for this input - HiddenSwingStopLossMultiplier. This allows you to adjust the swing sl to suit your own requirements, so play with it to see which setting suits yourself.
- the distance between the TMA outer and inner lines multiplied by HiddenTmaStopLossMultiplier
- The bot draws green take profit and red stop loss lines. Selecting these and moving them will make the bot adjust the stop/tp to reflect the line; If you want to drag and drop the TP line manually, be sure to set the MoveTpLineWithTMA to false or you will just be happily moving your TP all night and not understanding why it jumps back to the original TMA line. You can change the colour of the lines to suit yourself. Note that these lines will not appear for 1 minute after the trade is sent. The bot goes to sleep for 1 minute after a trade-send to give the trade time to appear in the platform's order history. Without this restriction, trades can be sent multiple times (coders, there are other safety features in place as well - you can see them for yourselves).
- The bot also draws a red, dashed line that represents the stop loss that we hide from the criminal. This hidden stop is also displayed in the screen feedback, next to the open trade message. Adjust the hidden stop line and the bot will adjust the hidden stop to reflect the new value.
Open trade management
The bot includes some of the more often used mptm management features. By default:
- Breakeven is set to Bob's recommendation of +3 at +15. This might be too close for some pairs and may generate some errors.
- Jumping stop is set to 30
Follow the link in my signature to download the mptm user guide if you are not familiar with it. All pip entries are made as 'proper' pips and the bot adjusts for x digit crims.
Platform re-starts (only applies to auto-trading)
The bot should restart where it left off in the event of a platform shutdown and restart. It does this by using Global Variables. Global variables are small files stored on your hard drive and can be viewed by pressing the F3 key. Globals set by this bot will have the prefix, "NV V1 trend " and the symbol as the suffix. Each one will hold the value 0, or 1:
- 0 means the trend is up and the bot is waiting for a long trade trigger.
- 1 means the trend is down and the bot is waiting for a short trade trigger.
Global variables can be deleted, edited or added.
Inputs
Other inputs that might need explanation:
- EA use inputs:
- AutoTrader: makes the bot act as an auto-trader - it looks for the setup and then the trade trigger
- NB_V1_Trend_Waiting_EA: makes the bot act as a 'waiting' ea in the style of the 1.0 5x5 buy/sell waiting ea's in Bob's thread.
- VisualStopLoss is the 'hard' stop loss sent with the trade, to hide our true stop from the criminal. You might want to make this much larger than the wild-guess default of 100.
- TouchBufferPips: only applies to auto-trading. The distance from the outer TMA lines to consider the market to have made a touch and prepare to send a trade.
- The 'true' stop loss is hidden from the criminal. The bot will attepmt to close losing trades at a hidden stop loss that the crim cannot see. Stop loss inputs are:
- Previous swing inputs:
- UseSwing: make the bot take the high/low of the previous swing (depending on trade direction) +- PipsAddToStopLoss. The bot uses Fractals to identify the hi-low.
- MinStopLoss is the lowest stop you are prepared to accept - defaults to a wild guess of 50. There is a minimum-stop check to ensure the stop is allowable by the criminal.
- TMA
- UseTma nakes the bot use the TMA to calculate the stop. It uses the distance between the TMA outer and inner lines.
- HiddenStopLossMultiplier multiplies TMA pip calculation by this figure. The default leaves the calculation alone. 0.75 would make the stop three quarters of the calculation; 1.25 would be one and a quarter etc
- Previous swing inputs:
- Trading hours: it can be crucial to trading success to send trades during periods when the pair's market is most active. The defaults allow 24 hour trading, so you may want to alter these. They work in your own computer's local time. For example, if you only want to trade the London session but live in Tokyo, then you have to enter start_hourm etc at the hours that London is open from your point of view in Tokyo. Don't even think about asking questions about this; sort it out for yourself.
- UseConvergenceFilter: only applies to auto-trading. This allows the bot to use the rudimentary convergence filter. If the TMA middle and 240 MA are moving towards one another, the bot will not trade. Leave this set to false for now, as it is far too basic a filter to have any value.
- The "Trading Allowed" inputs afford you control over whether or not to trade at all, or in which direction. Trading when the 240/TMA are converging might not be a good idea - the trend might be about to change. You might not want to trade in one direction if the criminal's swap rates will crucify trades in that direction.
- TakeProfit: a tp in pips if you want to try to trade this bot as a true trend trader, rather than a daily scalper in the direction of the trend. Turn off MoveTpLineWithTMA if you wish to do this.
- MoveTpLineWithTMA: set this to true and the bot will move the tp line when the TMA lines move, then adjust the tp accordingly. The bot needs 'ticks' to make this work, so events will take a few seconds in a slow-moving market. If you want to drag and drop the TP line manually, be sure to set the MoveTpLineWithTMA to false or you will just be happily moving your TP all night and not understanding why it jumps back to the original TMA line.
- CriminalIsECN: set this to 'true' if your crim is a 2 stage crim. If you do not even know what this is, then your crim is probably not a 2 stager. IBFX are, even though they do not say so.
- Moving averages and Fractals inputs. I am not going to explain these because: those who know how to use them do not need explanation; if you do not know how to use them, you will non understand the explanation so leave them alone. They offer inveterate tinkerers the freedom to experiment at will.
Convergence
There is an input that stops trading when the TMA middle and 240MA are converging: UseConvergenceFilter. It works like this, when set to 'true':
- Uptrend: looks at the TMA middle line 1 candle ago, and disables long trading it this is higher than the current middle line, indicating that it is falling, and so converging on the 240MA.
- Downtrend: looks at the TMA middle line 1 candle ago, and disables long trading it this is lower than the current middle line, indicating that it is rising, and so converging on the 240MA.
By default, this is set to 'false'. There is no point in disabling trading when the lines are converging but still gazillions of points apart. It is up to users to decide when to turn on this filter.
Coders: the code for this is in the bool GetConvergence() and returns a true/false decision based on whether convergence is occurring or not (called from ReadIndicatorValues() ). This makes it easy to play around with the code and add your own little tweaks.
Indicators
The bot does not need the indicators to be on the screen in order to work; you can use Bob's template with the bot added to show the figures it is working with.
There is no such animal as a set-and-forget trading EA
Describing this robot as an 'auto-trader' is true only to a certain extent. It is still up to users to monitor the charts regularly (i.e. obsessively) to decide whether to continue to allow trading on the pair. Checking that stops and tp's have been set/moved correctly is your responsibility. The more effective, knowledgeable and experienced a trader you are, the better this EA will trade for you. Do Not expect it to do your thinking for you.
Setting up the EA
Close down your MT4 platform.
- download 'NanningBob V1 Trend auto trading robot by Steve Hopwood.mq4' to your platform's Expert's folder.
Restart your platform.
- if on demo, start as many charts as you want (don't trade live until you understand the behavior of the bot).
- Use H1 charts
- load the ea onto each chart.
If this is a newly downloaded demo, you need to make sure Expert Addvisors are enabled. MT4 defaults to a neat little trick; ea's are disabled and you can stare at one for days wondering why it is refusing to works. So:
- click Tools|Options and select the Expert Advisors tab.
- put ticks in the boxes next to:
- Allow Expert Advisors
- Allow live trading
- Allow DLL imports
- Allow external experts imports
- remove ticks from all other boxes
- click the OK button
- if EA's are now enabled, yours will be showing a smiley face in the top right corner of your chart. Previously, it would have been wearing a frown.
Changing inputs
Changes to inputs do not always work immediately, so always follow this procedure:
- make your changes
- save them
- reload the robot, using the set file you just saved
Have fun guys
___________________________________ ____________________________
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
There, 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.