Dibs method auto trading robot by Steve Hopwood MOD

Post Reply
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: Dibs method auto trading robot by Steve Hopwood MOD

Post by fx800 »

jjgengis wrote:
jjgengis wrote:Hi fx8000,

I would suggest a little modify at the code. I noticed that often the EA doesn't fail a trade with error 130 invalid stop. This because sometimes the stoplevel of some pairs , e.g. audndz, is high and the EA set a price not far enought .

With these two rows I solved the problem:

Code: Select all

   //Long 
   if (direction == up)
   {
      if (!TradeLong) return;
      price = NormalizeDouble(BarHigh + spread + (PlusOne * Point), Digits);
      if (TakeProfit > 0) take = NormalizeDouble(Ask + (TakeProfit * Point), Digits);
      stop = NormalizeDouble(BarLow, Digits);
// ************** modify to avoid stoplevel error ***********************
      double stoplevelprice = Bid -  NormalizeDouble(MarketInfo(Symbol(),MODE_STOPLEVEL)-20, Digits);
      if ( stoplevelprice < stop) stop = stoplevelprice;
// ************** end modify to avoid  stoplevel error ***********************
      type = OP_BUYSTOP;
      SendTrade = true;
   }//if (direction == up)
   

   //Short
   if (direction == down)
   {
      if (!TradeShort) return;
      price = NormalizeDouble(BarLow - spread - (PlusOne * Point), Digits);
      if (TakeProfit > 0) take = NormalizeDouble(Bid - (TakeProfit * Point), Digits);
      stop = NormalizeDouble(BarHigh, Digits);
// ************** modify to avoid  stoplevel error ***********************
      stoplevelprice = Ask +  NormalizeDouble(MarketInfo(Symbol(),MODE_STOPLEVEL)+20, Digits);
      if ( stoplevelprice > stop) stop = stoplevelprice;
// ************** end modify to avoid  stoplevel error ***********************


JJ
I apologize for the mistake, but the "20" must be "0.0002", or "20" must be multplied for point (20*point).

Code: Select all

 stoplevelprice = Ask +  NormalizeDouble(MarketInfo(Symbol(),MODE_STOPLEVEL)+( 20 * point) , Digits);

Sorry!

JJ
Hi JJ

No problem. I will make the correction and update the ea in post 1. The update this morning has not been downloaded by anyone yet.

Thanks again for your help.

Peter
Last edited by Anonymous on Tue Apr 17, 2012 11:34 am, edited 1 time in total.
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: Dibs method auto trading robot by Steve Hopwood MOD

Post by fx800 »

fx8000 wrote:
jjgengis wrote:
jjgengis wrote:Hi fx8000,

I would suggest a little modify at the code. I noticed that often the EA doesn't fail a trade with error 130 invalid stop. This because sometimes the stoplevel of some pairs , e.g. audndz, is high and the EA set a price not far enought .

With these two rows I solved the problem:

Code: Select all

   //Long 
   if (direction == up)
   {
      if (!TradeLong) return;
      price = NormalizeDouble(BarHigh + spread + (PlusOne * Point), Digits);
      if (TakeProfit > 0) take = NormalizeDouble(Ask + (TakeProfit * Point), Digits);
      stop = NormalizeDouble(BarLow, Digits);
// ************** modify to avoid stoplevel error ***********************
      double stoplevelprice = Bid -  NormalizeDouble(MarketInfo(Symbol(),MODE_STOPLEVEL)-20, Digits);
      if ( stoplevelprice < stop) stop = stoplevelprice;
// ************** end modify to avoid  stoplevel error ***********************
      type = OP_BUYSTOP;
      SendTrade = true;
   }//if (direction == up)
   

   //Short
   if (direction == down)
   {
      if (!TradeShort) return;
      price = NormalizeDouble(BarLow - spread - (PlusOne * Point), Digits);
      if (TakeProfit > 0) take = NormalizeDouble(Bid - (TakeProfit * Point), Digits);
      stop = NormalizeDouble(BarHigh, Digits);
// ************** modify to avoid  stoplevel error ***********************
      stoplevelprice = Ask +  NormalizeDouble(MarketInfo(Symbol(),MODE_STOPLEVEL)+20, Digits);
      if ( stoplevelprice > stop) stop = stoplevelprice;
// ************** end modify to avoid  stoplevel error ***********************


JJ
I apologize for the mistake, but the "20" must be "0.0002", or "20" must be multplied for point (20*point).

Code: Select all

 stoplevelprice = Ask +  NormalizeDouble(MarketInfo(Symbol(),MODE_STOPLEVEL)+( 20 * point) , Digits);

Sorry!

JJ
Hi JJ

No problem. I will make the correction and update the ea in post 1. The update this morning has not been downloaded by anyone yet.

Thanks again for your help.

Peter
The above error has been corrected as per JJ's post. Update in post 1.

Peter
Dennis4x
Trader
Posts: 16
Joined: Wed Feb 22, 2012 2:27 pm

Re: Dibs method auto trading robot by Steve Hopwood MOD

Post by Dennis4x »

Hi fx8000 and everyone who is interested in this bot,
If anyone is getting "Market is (0)" in the on-screen display, then I humbly suggest moving the line "GetRsiTrend();" from Steve's Addidtion to just before "//Reread the hi-lo of the ib lines".
Like this:
}//if (OldBars != iBars(NULL, PERIOD_H1)

GetRsiTrend(); <-----new location

//Reread the hi-lo of the ib lines
BarHigh = 0;
BarLow = 0;
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: Dibs method auto trading robot by Steve Hopwood MOD

Post by fx800 »

Dennis4x wrote:Hi fx8000 and everyone who is interested in this bot,
If anyone is getting "Market is (0)" in the on-screen display, then I humbly suggest moving the line "GetRsiTrend();" from Steve's Addidtion to just before "//Reread the hi-lo of the ib lines".
Like this:
}//if (OldBars != iBars(NULL, PERIOD_H1)

GetRsiTrend(); <-----new location

//Reread the hi-lo of the ib lines
BarHigh = 0;
BarLow = 0;

Hi Dennis4x

Thank you for your suggestion. I am afraid I just recently started learning mql and am still at chapter one !

Can you please explain what your modification will do ?

I posted in the Dummies section here initially to ask for help in fixing some error messages and it was not my intention to run a thread as I feel completely unqualified to do so, please forgive me. I am perfectly happy to post my forward tests results, but trying to sort out coding issues is completely beyond me at the moment.

Cheers,
Peter
Dennis4x
Trader
Posts: 16
Joined: Wed Feb 22, 2012 2:27 pm

Re: Dibs method auto trading robot by Steve Hopwood MOD

Post by Dennis4x »

Hi fx8000,
I got "Market is (0)" displayed on my screen instead of Market is (45.9572) or whatever the current RSI value is. Relocating that line as suggested will help fix that.
Unless, of course, I am the only one getting that, as I am really using my previous DIBS setting from July last year.
I was at chapter one last year too, so don't worry, you will be improve. ;)
Don't know why there is not much interest in this bot. This is supposed to be based on a successful manual method after all. Anyway, I'd dropped this bot some time last year and just recently (-2 days ago) took another stab at it after you started this thread. So, keep up the good work! :)
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: Dibs method auto trading robot by Steve Hopwood MOD

Post by fx800 »

Dennis4x wrote:Hi fx8000,
I got "Market is (0)" displayed on my screen instead of Market is (45.9572) or whatever the current RSI value is. Relocating that line as suggested will help fix that.
Unless, of course, I am the only one getting that, as I am really using my previous DIBS setting from July last year.
I was at chapter one last year too, so don't worry, you will be improve. ;)
Don't know why there is not much interest in this bot. This is supposed to be based on a successful manual method after all. Anyway, I'd dropped this bot some time last year and just recently (-2 days ago) took another stab at it after you started this thread. So, keep up the good work! :)
Hi Dennis4x

Thank you for the explanation. I had Market 0 on the screen display as well but the ea was sending trades on H4 TF until Monday. No trades yesterday and today. I have not had time to see if that is because the market is ranging. However, not a single trade on H1 TF since I started the demo last Friday.

Anyway, thanks for your help. I will fix the Market 0 issue later and update the ea in post 1.

Cheers,
Peter

EDIT : Fixed the "Market 0" issue as suggested by Dennis4x. Update in post 1. Thank you, Dennis4x.
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: Dibs method auto trading robot by Steve Hopwood MOD

Post by fx800 »

Hi to all our brilliant coders,

I need a volunteer to help with coding issues here. If I know how to code, I will not be asking for help in the first place. And we cannot expect Steve to step in all the time,.....well, most of the time anyway. You can see the effect of what excessive demands on a person can do from time to time.

Dennis4x, you seem to show a keen interest in this ea, perhaps you may like to volunteer.

There are several coding issues with this ea which I was afraid to mention in case I get told off. For example, the part close function is not working, so I have set the input to 0. Secondly, the ea is coded to close the trade if a new candle opens inside the bands, as in


void LookForTradeClosure()
{

//Close the trade if the new candle opens inside the bands

if (!OrderSelect(TicketNo, SELECT_BY_TICKET) ) return;
if (OrderSelect(TicketNo, SELECT_BY_TICKET) && OrderCloseTime() > 0) return;

bool CloseTrade;

if (OrderType() == OP_BUY)
{

}//if (OrderType() == OP_BUY)


if (OrderType() == OP_SELL)
{

}//if (OrderType() == OP_SELL)

IMHO, I do not think this is the correct way to trade inside bars. The more inside bars there are, the greater the distance price will travel when a breakout occurs.

There is the other issue of the ea failing to sent pending orders when there are valid setups. I have spent hours trying to sort this out but to no avail.

Any help will be most welcome.

Peter
Last edited by Anonymous on Fri Apr 20, 2012 12:35 am, edited 1 time in total.
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: Dibs method auto trading robot by Steve Hopwood MOD

Post by fx800 »

Before anybody ask, yes I did try to comment out the code regarding closing a trade if the new candle opens inside the bands.

The result is more error warnings, all 12 of them ! I have enough error warnings to try to solve for the moment and I don't need anymore.
Dennis4x
Trader
Posts: 16
Joined: Wed Feb 22, 2012 2:27 pm

Re: Dibs method auto trading robot by Steve Hopwood MOD

Post by Dennis4x »

fx8000,
Not sure about the closing errors as this EA has yet to open a trade for me.

As an aside, and I am not sure if you are aware of this or not - looking back at my old notes from last year - this EA, in its first incarnation - Jolly Roger's Inside Bar Trading EA (June 2011), opens lots of trades. Later, in July 2011, it was reborn as DIBs, and did so much less trades.

IMHO, I think we need to figure out whether there was some bug introduced in DIBs (July 2011) before we try anything else. Otherwise, we'll be trying to build new features into a faulty robot.

To confuse things further, the new version introduced in Sept 2011 is called Jolly Roger's Inside Bar Trading EA. I haven't tried that one as by then I had moved on and was playing with some of Steve's newer toys.

I am not a brilliant coder - just know a bit of coding - and will be happy to help out with some coding provided it's do-able for me and doesn't take up too much time.

If anybody wants to get hold of the June 2011 ver, I have the .MQ4 source somewhere with me. I'll like to do it but at the moment, I don't have enough processing power to start another Empty4 demo to visually compare the 2.
fx800
Trader
Posts: 1334
Joined: Sun Dec 04, 2011 4:11 am

Re: Dibs method auto trading robot by Steve Hopwood MOD

Post by fx800 »

Dennis4x wrote:fx8000,
Not sure about the closing errors as this EA has yet to open a trade for me.

As an aside, and I am not sure if you are aware of this or not - looking back at my old notes from last year - this EA, in its first incarnation - Jolly Roger's Inside Bar Trading EA (June 2011), opens lots of trades. Later, in July 2011, it was reborn as DIBs, and did so much less trades.

IMHO, I think we need to figure out whether there was some bug introduced in DIBs (July 2011) before we try anything else. Otherwise, we'll be trying to build new features into a faulty robot.

To confuse things further, the new version introduced in Sept 2011 is called Jolly Roger's Inside Bar Trading EA. I haven't tried that one as by then I had moved on and was playing with some of Steve's newer toys.

I am not a brilliant coder - just know a bit of coding - and will be happy to help out with some coding provided it's do-able for me and doesn't take up too much time.

If anybody wants to get hold of the June 2011 ver, I have the .MQ4 source somewhere with me. I'll like to do it but at the moment, I don't have enough processing power to start another Empty4 demo to visually compare the 2.

Hi Dennis4x

Thanks for your offer of help. I am experiencing the same problem. The ea had been sending trades till last Friday on the H4 TF, but no trades since start of trading this week. On the H1 demo set up last Friday, not a single trade opened till now. I am still using the same DIBS MOD ea plus the two fixes mentioned in post 1. Not sure what the problem is.

If you are able to help out, great. It doesn't matter when that will be possible. In the meantime, my apologies to all those who are experiencing the same problems. To be responsible for running a thread without the requisite coding skill is a great handicap and I had foreseen this before, and am unsure I am the right person to do it.

Cheers,
Peter

EDIT : In the meantime, I would advise all new comers not to download the ea from post 1 until this problem is sorted out.
Last edited by Anonymous on Thu Apr 19, 2012 2:28 pm, edited 1 time in total.
Post Reply

Return to “Automated trading systems”