stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Dibs method auto trading robot by Steve Hopwood MOD
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=462
Page 3 of 8
Author:  fx800 [ Mon Apr 16, 2012 5:13 pm ]
Post subject:  Re: Dibs method auto trading robot by Steve Hopwood MOD

A rather disappointing day for DIBS MOD with Rsi. It was up 5.6% of equity in the morning, only to fall back in the afternoon, and ended the day unchanged i.e. 3% gain.

The DIBS SUPDEM EA has not yet taken any trades for both the H1 and H4 demo.
Author:  jjgengis [ Mon Apr 16, 2012 8:26 pm ]
Post subject:  Re: Dibs method auto trading robot by Steve Hopwood MOD

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
Author:  SteveHopwood [ Mon Apr 16, 2012 10:01 pm ]
Post subject:  Re: Dibs method auto trading robot by Steve Hopwood MOD

fx800, this thread is in the wrong place.

I shall give it a couple of days to let late-comers/sleepyheads catch up with my pm (otherwise they whinge at me about the link being broken), then move it up a notch to where it really belongs in the Automated trading section.

Ok with you?

:D
Author:  fx800 [ Mon Apr 16, 2012 10:52 pm ]
Post subject:  Re: Dibs method auto trading robot by Steve Hopwood MOD

SteveHopwood wrote:fx800, this thread is in the wrong place.

I shall give it a couple of days to let late-comers/sleepyheads catch up with my pm (otherwise they whinge at me about the link being broken), then move it up a notch to where it really belongs in the Automated trading section.

Ok with you?

:D

Absolutely fine, boss.

Peter.
Author:  fx800 [ Mon Apr 16, 2012 11:06 pm ]
Post subject:  Re: Dibs method auto trading robot by Steve Hopwood MOD

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
Hi Jjgengis,

Thanks for your suggestion. I have very very limited knowledge of coding and besides, this is still Steve's ea. I shall leave it to Steve to decide whether your suggestion should be implemented.

I think you are referring to the Dibs ea mod which Steve has helped to add Rsi filter to i.e the second post on page 1.

Cheers,
Peter.
Author:  SteveHopwood [ Mon Apr 16, 2012 11:31 pm ]
Post subject:  Re: Dibs method auto trading robot by Steve Hopwood MOD

fx8000 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
Hi Jjgengis,

Thanks for your suggestion. I have very very limited knowledge of coding and besides, this is still Steve's ea. I shall leave it to Steve to decide whether your suggestion should be implemented.
How the hell should I know?

You might have missed from some of my other posts in this forum and so have missed that I am in a foul mood tonight - mostly caused by trying to stay afloat in the quicksands of some other dipstick's constantly changing demands, so sorry if I am not as sympathetic as normal.

You made the mods that you have published - all I did was sort out some of the resulting chaos.

After reading about your successful ventures, I decided to set up my own demo but then found out that I did not know which version of the bot to use - yours in post 1 of my subsequent fix. In the end, I went with my fix because it was exactly that. For all I know, yours in post 1 has surpassed that, but there is nothing in this thread that I saw to say yay or nay to this.

I have directed others here. How are they supposed to know which version to download? Yours? Mine? Someone elses? Tossing a coin? Ritually sacrificing a few more of Whip's chickens - boy but they must hate knowing there is activity in this forum.

Get a grip fella. You started this thread and so have some responsibility for the direction it takes. Do something with your post 1 that tells visitors what you are up to. And sort out some of the code for yourself instead of waiting for others to do it for you.
Author:  fx800 [ Tue Apr 17, 2012 4:40 am ]
Post subject:  Re: Dibs method auto trading robot by Steve Hopwood MOD

SteveHopwood wrote:
fx8000 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
Hi Jjgengis,

Thanks for your suggestion. I have very very limited knowledge of coding and besides, this is still Steve's ea. I shall leave it to Steve to decide whether your suggestion should be implemented.
How the hell should I know?

You might have missed from some of my other posts in this forum and so have missed that I am in a foul mood tonight - mostly caused by trying to stay afloat in the quicksands of some other dipstick's constantly changing demands, so sorry if I am not as sympathetic as normal.

You made the mods that you have published - all I did was sort out some of the resulting chaos.

After reading about your successful ventures, I decided to set up my own demo but then found out that I did not know which version of the bot to use - yours in post 1 of my subsequent fix. In the end, I went with my fix because it was exactly that. For all I know, yours in post 1 has surpassed that, but there is nothing in this thread that I saw to say yay or nay to this.

I have directed others here. How are they supposed to know which version to download? Yours? Mine? Someone elses? Tossing a coin? Ritually sacrificing a few more of Whip's chickens - boy but they must hate knowing there is activity in this forum.

Get a grip fella. You started this thread and so have some responsibility for the direction it takes. Do something with your post 1 that tells visitors what you are up to. And sort out some of the code for yourself instead of waiting for others to do it for you.


Steve, I am very sorry to have upset you. I have attached the modified ea in post 1.

Peter
Author:  fx800 [ Tue Apr 17, 2012 4:41 am ]
Post subject:  Re: Dibs method auto trading robot by Steve Hopwood MOD

SteveHopwood wrote:
fx8000 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
Hi Jjgengis,

Thanks for your suggestion. I have very very limited knowledge of coding and besides, this is still Steve's ea. I shall leave it to Steve to decide whether your suggestion should be implemented.
How the hell should I know?

You might have missed from some of my other posts in this forum and so have missed that I am in a foul mood tonight - mostly caused by trying to stay afloat in the quicksands of some other dipstick's constantly changing demands, so sorry if I am not as sympathetic as normal.

You made the mods that you have published - all I did was sort out some of the resulting chaos.

After reading about your successful ventures, I decided to set up my own demo but then found out that I did not know which version of the bot to use - yours in post 1 of my subsequent fix. In the end, I went with my fix because it was exactly that. For all I know, yours in post 1 has surpassed that, but there is nothing in this thread that I saw to say yay or nay to this.

I have directed others here. How are they supposed to know which version to download? Yours? Mine? Someone elses? Tossing a coin? Ritually sacrificing a few more of Whip's chickens - boy but they must hate knowing there is activity in this forum.

Get a grip fella. You started this thread and so have some responsibility for the direction it takes. Do something with your post 1 that tells visitors what you are up to. And sort out some of the code for yourself instead of waiting for others to do it for you.


Steve, I am very sorry to have upset you. I have attached the modified ea in post 1.

Peter
Author:  fx800 [ Tue Apr 17, 2012 7:36 am ]
Post subject:  Re: Dibs method auto trading robot by Steve Hopwood MOD

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

Hi JJ

Further to my last post regarding the above subject, I have added your modification to the ea to avoid stoplevel error.

Update in post 1.

Thanks.

Peter
Author:  jjgengis [ Tue Apr 17, 2012 11:02 am ]
Post subject:  Re: Dibs method auto trading robot by Steve Hopwood MOD

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
All times are UTC Page 3 of 8