• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 5:11am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 5:11am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Nanningbob 4h trading system ver. 5.0 4,432 replies

Nanningbob 60x90 EA 3,920 replies

Help regarding NanningBob EA 27 replies

Nanningbob 4H trading system 2,017 replies

Help to improve profitable EA - 1H NanningBob 40MA 200 BB 10 replies

  • Commercial Content
  • /
  • Reply to Thread
  • Subscribe
  • 415
Attachments: Nanningbob V5: Steve Hopwood's auto-trading robot
Exit Attachments
Tags: Nanningbob V5: Steve Hopwood's auto-trading robot
Cancel

Nanningbob V5: Steve Hopwood's auto-trading robot

  • Last Post
  •  
  • 1 5051Page 525354 82
  • 1 51Page 5253 82
  •  
  • Post #1,021
  • Quote
  • Sep 29, 2010 2:05am Sep 29, 2010 2:05am
  •  odysseus11
  • | Commercial Member | Joined Feb 2009 | 128 Posts
Im running Max's EA v 66 and STILL getting tons of those blasted error 130s (invalid stops). Is there a fix?

Odysseus
forexfusiondotcom
 
 
  • Post #1,022
  • Quote
  • Sep 29, 2010 3:21am Sep 29, 2010 3:21am
  •  Beastie Boy
  • | Joined Sep 2010 | Status: Member | 73 Posts
Quoting Tread
Disliked
So why the heck am I am making money on this? 1,2 and 3 has earned some good pips
Ignored
And long may it continue. After all that is the point of a robot. What is required is for all users to check that the EA continues to enter the correct trades at the correct times.

Cheers, Beastie.
 
 
  • Post #1,023
  • Quote
  • Sep 29, 2010 3:39am Sep 29, 2010 3:39am
  •  macman
  • Joined Jan 2009 | Status: Member | 844 Posts
Quoting maxou888
Disliked
I tried to add a Trix divergence mode in the Ea using THV tread rule and indic "THV3 Trix called".

I writed the following code in my ea in order to draw an arrow and nothing happens. Does someone have an idea why?
Thanks in advance
if (iCustom(Symbol(), 0, "THV3 Trix called", 20, 35, 1, 4, 0) != EMPTY_VALUE)
{
Arrow="A"+DoubleToStr(TimeCurrent(), 0);
ObjectCreate(Arrow,OBJ_ARROW,0,TimeCurrent(), Bid - 0.0001 );
ObjectSet(Arrow,OBJPROP_ARROWCODE,SYMBOL_ARROWUP); }
if (iCustom(Symbol(), 0, "THV3 Trix called", 20, 35, 1, 5, 0) != EMPTY_VALUE)...
Ignored
Max,

The expert on THV indicators is http://www.forexfactory.com/misspips - also a really nice person.

Best of luck -
 
 
  • Post #1,024
  • Quote
  • Sep 29, 2010 4:14am Sep 29, 2010 4:14am
  •  maxou888
  • | Joined Nov 2009 | Status: Member | 468 Posts
here ar ethe correct mod for buy sell mode I think :
Inserted Code
void Mode1Buy()
{ 
   RefreshRates();
   if (Bid < BbLower) { Buy("#1 BUY"); } 
}
void Mode1Sell()
{  
   RefreshRates();
   if (Ask > BbUpper) { Sell("#1 SELL"); }
}
void Mode2Buy()
{  
   RefreshRates();
   double  Var1, Var2;
   Var1 = iMA(NULL, 0,  1, 0, MODE_LWMA, PRICE_MEDIAN,  1);
   Var2 = iBands(NULL, 0,  25, 2, 0, PRICE_CLOSE, MODE_LOWER, 1);
   BbLower = iBands(NULL, 0,  25, 2, 0, PRICE_CLOSE, MODE_LOWER, 0); 
   RefreshRates();
   if (Bid > BbLower && Var1 < Var2) { Buy("#2 BUY"); }
}
void Mode2Sell()
{  
   RefreshRates();
   double  Var1, Var2;
   Var1 = iMA(NULL, 0,  1, 0, MODE_LWMA, PRICE_MEDIAN,  1);
   Var2 = iBands(NULL, 0,  25, 2, 0, PRICE_CLOSE, MODE_UPPER, 1);//mod
   BbUpper = iBands(NULL, 0,  25, 2, 0, PRICE_CLOSE, MODE_UPPER, 0);
   if( Bid < BbUpper && Var1 > Var2) { Sell("#2 SELL"); }
   RefreshRates();
}
void Mode3Buy()
{  
   double  Var1, Var2;
   Var1 = iMA(NULL, 0, 1, 0, MODE_LWMA, PRICE_MEDIAN,  0);
   Var2 = iMA(NULL, 0, 4, 0, MODE_LWMA, PRICE_HIGH,  0);//mod
   BbLower = iBands(NULL, 0,  25, 2, 0, PRICE_CLOSE, MODE_LOWER, 0); 
   RefreshRates();
   if(Bid < Var2 && Var1 > BbLower) { Buy("#3 BUY"); }    
}
void Mode3Sell()
{ 
   double  Var1, Var2;
   Var1 = iMA(NULL, 0, 1, 0, MODE_LWMA, PRICE_MEDIAN,  0);
   Var2 = iMA(NULL, 0, 4, 0, MODE_LWMA, PRICE_LOW,  0);//mod
   BbUpper = iBands(NULL, 0,  25, 2, 0, PRICE_CLOSE, MODE_UPPER, 0);
   RefreshRates();
   if(Bid  > Var2 && Var1 < BbUpper) { Sell("#3 SELL"); }
}
void Mode4Buy()
{ 
   BbLower = iBands(NULL, 0,  25, 2, 0, PRICE_CLOSE, MODE_LOWER, 0); 
   double Var1 = iMA(NULL, 0,  1, 0, MODE_LWMA, PRICE_MEDIAN,  0);
   double Var2 = iMA(NULL, 0,  3, 1, MODE_LWMA, PRICE_MEDIAN,  0);
   RefreshRates();
   if (Bid  < BbLower || (Bid > Var2 && Var1 < Var2)) { Buy("#4 BUY"); }
}
void Mode4Sell()
{  
   BbUpper = iBands(NULL, 0,  25, 2, 0, PRICE_CLOSE, MODE_UPPER, 0);
   double Var1 = iMA(NULL, 0,  1, 0, MODE_LWMA, PRICE_MEDIAN,  0);
   double Var2 = iMA(NULL, 0,  3, 1, MODE_LWMA, PRICE_MEDIAN,  0);
   RefreshRates();
   if(Bid  > BbUpper || (Bid < Var2 && Var1 > Var2)) { Sell("#4 SELL"); }
}
void Mode7Buy()
{ 
   double  Var1, Var2;
   Var1 = iMA(NULL, 0, 1, 0, MODE_LWMA, PRICE_MEDIAN, 1);
   Var2 = iBands(NULL, 0,  25, 2, 3, PRICE_CLOSE, MODE_LOWER, 1); 
   BbLower = iBands(NULL, 0,  25, 2, 3, PRICE_CLOSE, MODE_LOWER, 0); 
   RefreshRates();
   if (Bid > BbLower && Var1 < Var2) 
   { Buy("#7 BUY");} 
}
void Mode7Sell()
{  
   double  Var1, Var2;
   Var1 = iMA(NULL, 0, 1, 0, MODE_LWMA, PRICE_MEDIAN, 1);
   Var2 = iBands(NULL, 0,  25, 2, 3, PRICE_CLOSE, MODE_UPPER, 1); // mod
   BbUpper = iBands(NULL, 0,  25, 2, 3, PRICE_CLOSE, MODE_UPPER, 0);
   RefreshRates();
   if( Bid < BbUpper && Var1 > Var2)
   {  Sell("#7 SELL");}
}
 
 
  • Post #1,025
  • Quote
  • Sep 29, 2010 6:38am Sep 29, 2010 6:38am
  •  Beastie Boy
  • | Joined Sep 2010 | Status: Member | 73 Posts
I have started reading through the code as promised and have found an error in this function. It currently reads

Inserted Code
 
else if (tradedirection == buy) // BUY
{
if (UseSixthsTp) // use Sixths
{
if ( MathAbs(Ask-TopGreenLine) < (Point*MinimumTargetinPips) ) { target = TopGreenLine; }
else { target = TopGreenLine; }
which I think should be
Inserted Code
 
else if (tradedirection == buy) // BUY
{
if (UseSixthsTp) // use Sixths
{
if ( MathAbs(Ask-[b]BottomGreenLine[/b]) < (Point*MinimumTargetinPips) ) { target = TopGreenLine; }
else { target = [b]BottomGreenLine[/b]; }

Cheers, Beastie.
 
 
  • Post #1,026
  • Quote
  • Sep 29, 2010 7:52am Sep 29, 2010 7:52am
  •  Beastie Boy
  • | Joined Sep 2010 | Status: Member | 73 Posts
The possible error is around the use of Bollinger Band %b indicator. The text in the code states:

"Bollinger Bands %b measures the market distance from BB Upperline, so a value of 1 means the
market is equal the top line; 0 = bottom line; 0.5 = middle line etc. This indi can be used
to show if there is a decent separation between BB and market"

The vaule of %b is assigned to the variable BbSeparation, so if the market price is at the bottom band for example, BbSeparation will equal zero.

Part of the code that tests for TradeDirection = up, (ie testing we have the conditions to take a long trade) has a line which reads:

if (BbSeparation < MinSepFromBB) TradeDirection = none;

MinSepFromBB is hard coded to 0.1, therefore if I am reading this correctly, long trades will only be taken if the current price is more than 10% of the way up between the BB. This will miss all #1 trades which rely on a BB touch, and possibly many others.

Will someone please check my thinking on this, as that line may be there for a reason. As I am not sure what the check is there for, I can't offer any suggestions.

Cheers, Beastie.
 
 
  • Post #1,027
  • Quote
  • Sep 29, 2010 7:59am Sep 29, 2010 7:59am
  •  maxou888
  • | Joined Nov 2009 | Status: Member | 468 Posts
This is le last version

- Bug corrected (last steve mod trendstatus)
- rewiew buy sell modes
- included H4 Trendline
- Include a new mode : trix divergence. For moment only testing, ie draw arrows, not yet trade. You must load in indic folder : "THV4 Trix called"

Works better on H1
You must use MasterEa 006
Use the template info master 6 in a chart like GbpJpy M15, you have to load the indics _i_xxx to indics folders
Enjoy !
Attached Image
Attached File(s)
File Type: ex4 THV4 Trix called.ex4   28 KB | 240 downloads
File Type: mq4 _i_account2.mq4   < 1 KB | 209 downloads
File Type: mq4 _i_TotalLots.mq4   < 1 KB | 192 downloads
File Type: mq4 _i_margin.mq4   < 1 KB | 198 downloads
File Type: tpl info master6.tpl   18 KB | 219 downloads
File Type: mq4 NBv5-19082010-mx071c.mq4   128 KB | 241 downloads
 
 
  • Post #1,028
  • Quote
  • Sep 29, 2010 8:14am Sep 29, 2010 8:14am
  •  macman
  • Joined Jan 2009 | Status: Member | 844 Posts
Quoting maxou888
Disliked
This is le last version

- Bug corrected (last steve mod trendstatus)
- rewiew buy sell modes
- included H4 Trendline
- Include a new mode : trix divergence. For moment only testing, ie draw arrows, not yet trade. You must load in indic folder : "THV4 Trix called"

Works better on H1
You must use MasterEa 006
Use the template info master 6 in a chart like GbpJpy M15, you have to load the indics _i_xxx to indics folders
Enjoy !
Ignored
Thanks for this Max -

Can you post MasterEa 006 - the latest I have is version 003?

Cheers
 
 
  • Post #1,029
  • Quote
  • Sep 29, 2010 8:37am Sep 29, 2010 8:37am
  •  maxou888
  • | Joined Nov 2009 | Status: Member | 468 Posts
oups, forgot it !
i have to say that althought trend lines are not always drawn correctly, it perform very well in 4H mode
Note that Nb trades are taken before i included the last mod (Mode#Buy/Mode#sell function, GetTradeDirection function). We will see if it's better
Attached Image (click to enlarge)
Click to Enlarge

Name: Image4.jpg
Size: 425 KB
Attached File(s)
File Type: mq4 Master EA_006.mq4   45 KB | 213 downloads
 
 
  • Post #1,030
  • Quote
  • Sep 29, 2010 8:46am Sep 29, 2010 8:46am
  •  maxou888
  • | Joined Nov 2009 | Status: Member | 468 Posts
this is 4 days trading with version 066 without mode4HTrenline, on H1 Tf
Attached Image
 
 
  • Post #1,031
  • Quote
  • Sep 29, 2010 4:06pm Sep 29, 2010 4:06pm
  •  scooby-doo
  • Joined Jul 2009 | Status: Member | 2,158 Posts
How many times have you gone to bed only to re-awake and find your Metatrader has shut down.

Well, help is at hand. Please find attached a little windows program I wrote that will check every 5 seconds to see if terminal.exe is running. if not then it will start Metatrader for you.

It doesnt matter where you put the program. When you first run it you will need to tell it where your Metrader root directoty is installed.

Scoobs.

PS. IT WONT HELP IF YOUR PC IS RE-BOOTED!!!!!!!!!!!!!!!!!!!!!!!!!
Attached File(s)
File Type: zip Keep MT4 Running.zip   279 KB | 310 downloads
 
 
  • Post #1,032
  • Quote
  • Sep 29, 2010 4:50pm Sep 29, 2010 4:50pm
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Quoting Beastie Boy
Disliked
I have started reading through the code as promised and have found an error in this function. It currently reads

Inserted Code
 
else if (tradedirection == buy) // BUY
{
if (UseSixthsTp) // use Sixths
{
if ( MathAbs(Ask-TopGreenLine) < (Point*MinimumTargetinPips) ) { target = TopGreenLine; }
else { target = TopGreenLine; }
which I think should be
[code]
else if (tradedirection == buy) // BUY
{
if (UseSixthsTp) // use Sixths
{
if ( MathAbs(Ask-BottomGreenLine) < (Point*MinimumTargetinPips) ) { target = TopGreenLine; }
else { target = BottomGreenLine;...
Ignored
Thanks again Beastie. Fantastic proof-reading. I have made the required changes and the fix is in post 1.

 
 
  • Post #1,033
  • Quote
  • Sep 29, 2010 4:53pm Sep 29, 2010 4:53pm
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
Quoting Beastie Boy
Disliked
Will someone please check my thinking on this, as that line may be there for a reason. As I am not sure what the check is there for, I can't offer any suggestions.

Cheers, Beastie.
Ignored
I am sure it made sense at the time.

Looking at the code now, I cannot work out what it is intended to achieve.

What we need is a check that the market has separated from BB by MinSepFromBB. I have a couple of really busy days coming up and will not be able to do any coding. If you can rewrite the code, then great. If not, I will look at this over the weekend.

Cheers Beastie. You are a star of incalculable brightness.

 
 
  • Post #1,034
  • Quote
  • Sep 29, 2010 5:09pm Sep 29, 2010 5:09pm
  •  SteveHopwood
  • | Commercial Member | Joined Apr 2007 | 8,331 Posts
One more change in response to this pm from Beastie earlier:

Steve, in one of my NB posts, I suggested a change to the #2 trade trigger, which you quite rightly left out. I just wanted to point out that that the change to the #2 trade mode setup is in the current code. The original line was

if (Ask >= BbUpper)

The current version has

double Var1 = iMA(NULL, 0, 1, 0, MODE_LWMA, PRICE_MEDIAN, 1);
double Var2 = iBands(NULL, 0, 25, 2, 0, PRICE_CLOSE, MODE_UPPER, 0);
if (Var2 < Var1)

I mention this because I wasn't sure if you pasted this into the code inadvertantly. My change was designed to only trigger if there is seperation between 1MA and the BB whereas the original version is far more likely to trigger.

I don't want to end up breaking something that already works.

Cheers, Beastie.


This seems a bit more straightforward to me, so I have made this change.

Sorry about all the changes, guys. Blame Beastie and his attention to detail.

 
 
  • Post #1,035
  • Quote
  • Sep 29, 2010 5:15pm Sep 29, 2010 5:15pm
  •  Invisible
  • | Joined Nov 2009 | Status: Member | 469 Posts
@ Scooby

Thanks for that program.

Presumably you could set your MT4 terminal to be one of the programs that windows automatically starts when it boots. If the PC / VPS rebooted then it would be started, and then your program would keep an eye on things while the computer was running.

Invisible
 
 
  • Post #1,036
  • Quote
  • Sep 29, 2010 5:20pm Sep 29, 2010 5:20pm
  •  macman
  • Joined Jan 2009 | Status: Member | 844 Posts
Quoting scooby-doo
Disliked
How many times have you gone to bed only to re-awake and find your Metatrader has shut down.

Well, help is at hand. Please find attached a little windows program I wrote that will check every 5 seconds to see if terminal.exe is running. if not then it will start Metatrader for you.

It doesnt matter where you put the program. When you first run it you will need to tell it where your Metrader root directoty is installed.

Scoobs.

PS. IT WONT HELP IF YOUR PC IS RE-BOOTED!!!!!!!!!!!!!!!!!!!!!!!!!
Ignored
Thanks Scooby - interesting

I guess we need a separate instance of the program for each Metatrader we are running?
 
 
  • Post #1,037
  • Quote
  • Sep 29, 2010 5:48pm Sep 29, 2010 5:48pm
  •  scooby-doo
  • Joined Jul 2009 | Status: Member | 2,158 Posts
Quoting macman
Disliked
Thanks Scooby - interesting

I guess we need a separate instance of the program for each Metatrader we are running?
Ignored
Yes, however I dont know what the impact would be on resources.

Scoobs
 
 
  • Post #1,038
  • Quote
  • Sep 29, 2010 7:38pm Sep 29, 2010 7:38pm
  •  rfking2
  • | Joined Apr 2010 | Status: That One Guy | 127 Posts
Quoting scooby-doo
Disliked
Yes, however I dont know what the impact would be on resources.

Scoobs
Ignored


That would help me immensely!!
 
 
  • Post #1,039
  • Quote
  • Edited Sep 30, 2010 12:05am Sep 29, 2010 11:50pm | Edited Sep 30, 2010 12:05am
  •  f451
  • | Joined Mar 2010 | Status: Member | 281 Posts
Quoting Beastie Boy
Disliked
I have started reading through the code as promised and have found an error in this function. It currently reads

Inserted Code
 
else if (tradedirection == buy) // BUY
{
if (UseSixthsTp) // use Sixths
{
if ( MathAbs(Ask-TopGreenLine) < (Point*MinimumTargetinPips) ) { target = TopGreenLine; }
else { target = TopGreenLine; }
which I think should be
[code]
else if (tradedirection == buy) // BUY
{
if (UseSixthsTp) // use Sixths
{
if ( MathAbs(Ask-BottomGreenLine) < (Point*MinimumTargetinPips) ) { target = TopGreenLine; }
else { target = BottomGreenLine;...
Ignored
Yes, that is a correct fix.

I've been using this code because it's more robust and will accomodate with trend trades if anyone wants to take them

someone will need to adjust my TopSixth, TopThird, BottomSixth and BottomThird to correspond to Bob's Green and Gold lines if you want to include it

double SetTarget(string tradedirection)
{
int BarHigh = iHighest(Symbol(),Period(),MODE_HIGH,BarCount,1);
int BarLow = iLowest(Symbol(),Period(),MODE_LOW,BarCount,1);
double value = High[BarHigh] - Low[BarLow]; //value top of the chart - value bottom
double sixth = value/6;
double valueS = (value*(MathPow(10,Digits)));
double sixthS = (sixth*(MathPow(10,Digits)));

double BottomSixth = NormalizeDouble(Low[BarLow]+sixth, Digits);
double BottomThird = NormalizeDouble(Low[BarLow]+sixth+sixth, Digits);
double TopThird = NormalizeDouble(Low[BarLow]+sixth+sixth+sixth+sixth, Digits);
double TopSixth = NormalizeDouble(Low[BarLow]+sixth+sixth+sixth+sixth+sixth, Digits);

double target = 0;
if (tradedirection == sell) // SELL
{
if (UseSixthsTp) // use Sixths
{
target = TopThird;
if (target > Bid) { target = BottomThird; }
if (target > Bid) { target = BottomSixth; }
if (target > Bid) { target = Bid; }
if ( MathAbs(Bid-target) < (Point*MinimumTarget) ) { target = target - (Point*MinimumTarget); }
}
if (UseBollingerTp) // use Bollinger Bands
{
target = BbMedian;
if (target > Bid) { target = BbLower; }
if (target > Bid) { target = Bid; }
if ( MathAbs(Bid-target) < (Point*MinimumTarget) ) { target = target - (Point*MinimumTarget); }
}
}
else if (tradedirection == buy) // BUY
{
if (UseSixthsTp) // use Sixths
{
target = BottomThird;
if (target < Ask) { target = TopThird; }
if (target < Ask) { target = TopSixth; }
if (target < Ask) { target = Ask; }
if ( MathAbs(Ask-target) < (Point*MinimumTarget) ) { target = target + (Point*MinimumTarget); }
}
if (UseBollingerTp) // use Bollinger Bands
{
target = BbMedian;
if (target < Ask) { target = BbUpper; }
if (target < Ask) { target = Ask; }
if ( MathAbs(Ask-target) < (Point*MinimumTarget) ) { target = target + (Point*MinimumTarget); }
}
}
return (NormalizeDouble(target,Digits));
}
 
 
  • Post #1,040
  • Quote
  • Sep 29, 2010 11:53pm Sep 29, 2010 11:53pm
  •  f451
  • | Joined Mar 2010 | Status: Member | 281 Posts
Quoting Beastie Boy
Disliked
The possible error is around the use of Bollinger Band %b indicator. The text in the code states:

"Bollinger Bands %b measures the market distance from BB Upperline, so a value of 1 means the
market is equal the top line;...
Ignored
Beastie,

That was very old code that must have made it's way back into the latest EAs.

I have: (1-BbSeparation) < MinSepFromBB for Sells

//Check for short direction trade setup
if (Ask > target)
{
// check for BB huggie trend trade
if ( (StochWhite > 85) && ( StochBlue > 85) && (MacdVal > OverBought) && (BbUpper > TopGreenLine) &&
((1-BbSeparation) < MinSepFromBB) )

cheers
Simon
 
 
  • Commercial Content
  • /
  • Nanningbob V5: Steve Hopwood's auto-trading robot
  • Reply to Thread
    • 1 5051Page 525354 82
    • 1 51Page 5253 82
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023