Forex Factory (https://www.forexfactory.com/forum.php)
-   Commercial Content (https://www.forexfactory.com/forumdisplay.php?f=158)
-   -   Nanningbob V5: Steve Hopwood's auto-trading robot (https://www.forexfactory.com/showthread.php?t=248297)

SteveHopwood Aug 1, 2010 6:58am | Post# 1

Nanningbob V5: Steve Hopwood's auto-trading robot
 
25 Attachment(s)
SERIOUS WARNING

  1. Most Forex traders lose all their money.
  2. Using the robots posted here in trading Forex does not guarantee success.
  3. Trading these robots could lead to serious financial loss.
  4. Trading these robots without understanding their underlying trading strategies guarantees traders will lose their money.
  5. A trading robot is a maximum of 90% as good as the manual strategy it trades:

    1. just because the manual strategy is profitable does not guarantee the robot will replicate this success.

___________________________________

There is a trading system that complements Bob's. Read about David's method at http://www.forexfactory.com/showthread.php?t=244741. The robot I am coding for David's method is at http://www.forexfactory.com/showthre...56#post3976756.
___________________________________ ____________________
Nanningbog V5 auto-trader

 

  1. NB trades #1, #2, #3, #4, #7. We are indebted to f451 for the #3 code.
  2. #4 trades depend on the market being in a range rather than a trend. The details are in the user guide.
  3. There is a rudimentary 1.1.3.3 recovery system.
  4. NB does not use a magic number. It considers all trades to belong to it. You cannot used another trading robot on the same account at the same time. Not that you should, so this is not a hardship. The exception to this is the robot I am developing for David's system. The two systems complement one another, so the robots do as well.


This robot is under development and must not be used on live accounts.

The purpose of this thread is to develop the robot to the stage where Bob can offer it in his thread. I have opened a separate thread to avoid cluttering up Bob's thread with discussion about the robot.


There is a little more explanation in the user guide; basically, if you understand the system then you can use the robot easily.

New traders, this is a horribly complex robot that is going to become more complex still. There is a user guide but it is not a lot of use. If you understand and can use Bob's trading methods, then you do not need the user guide. So,

 

  1. Go to http://www.forexfactory.com/showthread.php?t=246113 and learn to trade nanningbob's system. It is the simplest to understand that I have seen here at FF.
  2. Download the mptm user guide from http://www.forexfactory.com/showthread.php?t=89371. Incidentally, whilst you are there learn how to personalise ea, script and indicator inputs as described in 'How to edit a script code'. This will make a huge difference in the amount of time you have to spend in the Inputs window.

In the 'posting restrictions' section lower down, I have posted a link to a new thread where newbies can ask for help. I ask more experienced people to bookmark the thread and add a email notification so that you can help out the newbs when they get stuck.

Max's EA
Max is also coding a robot to trade this method. I think he is over-complicating things, but Max is a brilliant and much-valued coder. He could well be right in adding his extra features, and if so I will be the first to dump my version in favour of his.

I include Max's ea in the zip attached here to make sure it does not get lost as the thread grows. Please try them both and see which one works best. There is also his doc describing the extra features.

Cheers Max. You are a star.
________________________________________________________________

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

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.
nb steve sq template.tpl
Nanningbob V5 Auto-trader User Guide.pdf
Nanningbob V5 auto-trader required indicators.zip
Nanningbob V5 auto-trader by Steve and Simon.mq4
Max's EA.zip


f451 Aug 1, 2010 8:25am | Post# 2

Bulge BB Buys and Sells
 
2 Attachment(s)
Steve,

I just realised a possible method for the bulge buys and sells. Bollinger Bands have a couple of related metrics called %B, and Bandwidth indicator (sample indicators attached). These show where price is in relation to the bands, and how wide the bands are in relation to past band activity. Bandwith indicator is used primarily to assist with the famous bollinger bands squeeze trade - breakout after a period of low volatility, which is generally what happens to create NB's BB bulges. I'm sure that Bandwidth indicator can be used once it exceeds a threshold (with the threshold determined perhaps by stochasticization over a period of previous data, much like what Squalou did to MACD).

Bolinger Bands %b can help quantify those elusive conditions like "wait for some price separation from the bollinger bands before turning on EA #2", or even more straightforward things like - inside or outside upper or lower bands by a set percentage, et al.

cheers
f451
Bandwidth Indicator.mq4
Bollinger Bands %b.mq4

SteveHopwood Aug 1, 2010 12:25pm | Post# 3

Steve,

I just realised a possible method for the bulge buys and sells. Bollinger Bands have a couple of related metrics called %B, and Bandwidth indicator (sample indicators attached). These show where price is in relation to the bands, and how wide the bands are in relation to past band activity. Bandwith indicator is used primarily to assist with the famous bollinger bands squeeze trade - breakout after a period of low volatility, which is generally what happens to create NB's BB bulges. I'm sure that Bandwidth indicator can be used once it exceeds...
Classic example of why I share my work with everyone here. 'Give and ye shall receive'.

I have adopted %b to spot the separation.

Bandwidth Indicator has allowed me to code #3 functions. The relevant input is MinimumBulgeWidth; the default is a guess based on seeing that values over 5 usually represent a bulge on the H4.

This function is a bit of a blunt instrument and might not work properly. All it does is say, "Hey, the bandwidth is > MinimumBulgeWidth, so there is a bulge, so I am going into bulge trading mode."

We shall see.


nanningbob Aug 1, 2010 12:34pm | Post# 4

Thanks Steve for all your help. It simply is impossible for me to keep up with all the developments and testing. I appreciate very much your help and the help of all the others. Be neat if all this works out.

SteveHopwood Aug 1, 2010 5:50pm | Post# 5

Got the demo account set up with the ea ready to do its thing.

Fingers crossed.


Tread Aug 2, 2010 12:11am | Post# 6

1 Attachment(s)
Hi Guys

I noticed I was getting a bunch of Zero Divide errors from the Bandwidth Indicator and that it was sometimes unloading. I looked at the coding and noticed the following:-

It calls the:-

mb=iBands(Symbol(),chart.timeframe,period,deviation,bands.shift,applied.price,0,i);

Ibands does not support a 0 buffer, only a 1 and 2 for Upper and Lower.

Anyhow the MB was supposed to refer to the center line of the BBands. I made the change:--

mb=iMA(Symbol(),chart.timeframe,period,bands.shift,0,applied.price,0)


Works like a charm now.

Strangely enuff even tho the indicator was coded with the invalid buffer, it gave the correct values when it worked.

See attached, I have used a v1 for differentiation, but for ease, it may be best to save over the original if you are having the same problem
Bandwidth Indicator_v1.mq4

SwingMan Aug 2, 2010 2:42am | Post# 7

...iBands does not support a 0 buffer, only a 1 and 2 for Upper and Lower.
It's not true, because 0 = MODE_MAIN, and you can check with comments or prints that for example for i=0, mb has correct values.
The cause is at the beginning of the data (i=limit), and the solution is to check the mb value:

Inserted Code
if (mb!=0)
      BWI.Buffer[i]=((ub-lb)/mb)*100;

Tread Aug 2, 2010 2:57am | Post# 8

1 Attachment(s)
It's not true, because 0 = MODE_MAIN, and you can check with comments or prints that for example for i=0, mb has correct values.
The cause is at the beginning of the data (i=limit), and the solution is to check the mb value:

Inserted Code
if (mb!=0)
      BWI.Buffer[i]=((ub-lb)/mb)*100;

Hi Swing

I thought so too, (since it's more like a default), i checked the MQL manual it specifically states 1 and 2.

But the really does work as you indicated... interesting.

Thanks
Click to Enlarge

Name: 2010-08-02_0253.png
Size: 23 KB

SteveHopwood Aug 2, 2010 4:21am | Post# 9

Hi Guys

I noticed I was getting a bunch of Zero Divide errors from the Bandwidth Indicator and that it was sometimes unloading. I looked at the coding and noticed the following:-

It calls the:-

mb=iBands(Symbol(),chart.timeframe,period,deviation,bands.shift,applied.price,0,i);

Ibands does not support a...
Cheers Trend. I have replaced the version in the zip with this one.


SteveHopwood Aug 2, 2010 4:28am | Post# 10

It looks as though merely using Bandwidth as a bulge-spotter is not going to work. I just knew it could not be that simple. Hey ho.


f451 Aug 2, 2010 6:37am | Post# 11

Hi Swing

I thought so too, (since it's more like a default), i checked the MQL manual it specifically states 1 and 2.

But the really does work as you indicated... interesting.

Thanks
MODE_MAIN ("0") is the base indicator line. In the case of Bollinger Bands that's the central moving average band. The upper and lower lines are calculated as that +/- 1 standard deviation. The mql4 documentation is slightly obtuse here.

I think Swingman is right - the check needs to be if (mb==0) BWI = 0 to avoid divide by zero error.

cheers
f451

SteveHopwood Aug 2, 2010 6:44am | Post# 12

I spotted a couple of copy/paste bloops in the bulge-spotting routine, so these are fixed in post 1.

I persuaded Nb to take a bulge trade by turning MinimumBulgeWidth down to 2, so it is now in the audnzd trade that I took live with the #1 ea much earlier today.

I suppose we just have to play with this and see what happens.

Can anyone come up with an algorithm for #4?


SwingMan Aug 2, 2010 6:51am | Post# 13

Hi Steve, can you please change for me in the thread title "autrading" in "autotrading"...? In Google I can not find what this mean...

SteveHopwood Aug 2, 2010 7:19am | Post# 14

Hi Steve, can you please change for me in the thread title "autrading" in "autotrading"...? In Google I can not find what this mean...
'tis done, George, this was a spelling mistake. 'Auto' is short for 'automatic'.


Tread Aug 2, 2010 9:47am | Post# 15

1 Attachment(s)
Been a good day so far, here is what come from not paying attention, some times it goes in your favor.....

Was trying to use the TraderDynamicIndex as a predictor of the bulge.

Thank God!!
Click to Enlarge

Name: 2010-08-02_09401.png
Size: 76 KB

SwingMan Aug 2, 2010 10:18am | Post# 16

'tis done, George, this was a spelling mistake. 'Auto' is short for 'automatic'.
For me is now "autotrading = automatic trading". Thanks Steve!
But what is "autrading", this is the question...?

SteveHopwood Aug 2, 2010 10:52am | Post# 17

Been a good day so far, here is what come from not paying attention, some times it goes in your favor.....

Was trying to use the TraderDynamicIndex as a predictor of the bulge.

Thank God!!
Hehe. You just used all your luck for the entire decade.

SteveHopwood Aug 2, 2010 10:55am | Post# 18

For me is now "autotrading = automatic trading". Thanks Steve!
But what is "autrading", this is the question...?
Hehe. I edited the title then forgot to save it.

I have had another try.


Invisible Aug 2, 2010 12:26pm | Post# 19

Sorry mate, still "autrading here". Anyway, what it does is most important

SteveHopwood Aug 2, 2010 1:26pm | Post# 20

I have added #4 functionality to NB, assuming this to be a range-trading method.

Details in post 1 and the user guide.



© Forex Factory