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

Holy Graily Bob's Candle Power
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5272
Page 11 of 36
Author:  SWG123 [ Sat Sep 23, 2017 8:44 pm ]
Post subject:  Holy Graily Bob's Candle Power

SteveHopwood » Sat Sep 23, 2017 3:17 pm wrote:Ye Gods folks. I have the intellect of a low-flying dumpling. The code to enforce a minimum distance between trades is the simplest in the world. I cannot even begin to work out why I made it so complicated.

Here is the really worrying thingy: I was sober at the time. :oops:

:xm:
Oh dear....best keep imbibing.

And taking baths :lol:
Author:  ArtVandelay [ Sun Sep 24, 2017 12:46 am ]
Post subject:  Holy Graily Bob's Candle Power

Draw down got as high as -$900. Currently at -$415.
Using TJF's set file in post one.
Author:  SteveHopwood [ Sun Sep 24, 2017 2:06 pm ]
Post subject:  Holy Graily Bob's Candle Power

V 1d is in post 1. I have worked a lot on the bot this weekend and the details are in the new user guide. I have:
  • added simple and complex offsetting as a trade closure option.
  • added features to deal with the potential leaky toilet (noobs, you will read about this in the UG):
    • added a way to define a position as unbalanced.
    • added simple and complex offsetting to help CP return to a balanced position.
    • added two 'nuclear option' closure functions when the position becomes unbalanced.
I have tested the code in Crapergy Tester and it appears to be fine but bugs sometimes emerge when an EA is loaded onto demo when the markets open. We shall see. Maybe hold off using the new features live until we have run them on demo for a day? They are disabled by default.

:xm:


I have just had an idea. If you want to leave 1c running on your live accounts whilst we test the new features, copy this over the top of the existing bool EnoughDistance(int type, double price):

Code: Select all

bool EnoughDistance(int type, double price)
{
   //Returns false if the is < MinDistanceBetweenTradesPips
   //between the price and the nearest order open prices.
   
   double pips = 0;
   
   //No market order yet
   if (type == OP_BUY)
      if (!BuyOpen)
         return(true);
      
   if (type == OP_SELL)
      if (!SellOpen)
         return(true);
      
   for (int cc = OrdersTotal() - 1; cc >= 0; cc--)
   {
      if (!BetterOrderSelect(cc, SELECT_BY_POS, MODE_TRADES) ) continue;
      if (OrderSymbol() != Symbol() ) continue;
      if (OrderMagicNumber() != MagicNumber) continue;
      if (OrderType() != type) continue;

      pips = MathAbs(price - OrderOpenPrice() ) * factor;
      if (pips < MinDistanceBetweenTrades)
         return(false);
   }//for (int cc = OrdersTotal() - 1; cc >= 0; cc--)

 
   //Got here, so OK to trade
   return(true);

   
   
}//End bool EnoughDistance(int type, double price)
This is accurate code to calculate that there is sufficient distance between the proposed new trade and the nearest existing ones.
Author:  TraderJoeForex [ Sun Sep 24, 2017 2:37 pm ]
Post subject:  Holy Graily Bob's Candle Power

This is great. Thanks Steve :good:
Author:  szfxtrader [ Sun Sep 24, 2017 6:27 pm ]
Post subject:  Holy Graily Bob's Candle Power

Thanks so much, Steve! Really appreciate your effort!
Author:  rapple [ Sun Sep 24, 2017 11:13 pm ]
Post subject:  Holy Graily Bob's Candle Power

Thanks for the update Steve

I nuked all my trades at the end of last week and now the EA is making rapid gains again.

I have set the new version so that TJF setfile 'Nukes' all trades when the BUY:SELL unbalance hits 10.

Lets see how it goes

Thanks Richard
Author:  SteveHopwood [ Sun Sep 24, 2017 11:35 pm ]
Post subject:  Holy Graily Bob's Candle Power

rapple » Sun Sep 24, 2017 11:13 pm wrote:Thanks for the update Steve

I nuked all my trades at the end of last week and now the EA is making rapid gains again.
Excellent. Just the sort of thingy I love to hear.

I forgot to explain folks, that I still have not solved the 'invalid stops' thingy. I have quietened it down a little by telling CP to sleep for 10 seconds after generating the error. Eventually it goes away. The problem is in the jumping stop function. Buggered if I know where. :arrrg:

Let's try a few more in case it knocks some sense in: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: :arrrg: ..............................


Nope. Hasn't helped.


:xm:
Author:  firewight [ Mon Sep 25, 2017 1:56 am ]
Post subject:  Holy Graily Bob's Candle Power

Awesome, thanks for the new update!

This week I have decided to run some fresh tests on M15 and H1, just to see how they compare.
Author:  firewight [ Mon Sep 25, 2017 7:08 am ]
Post subject:  Holy Graily Bob's Candle Power

Hi Steve, a question if I may regarding the anti bunching distances.

Does that nullify any differences between timeframes? As 20 pips is 20 pips, regardless of M5 or H1, etc.

Just curious.

Cheers!

EDIT: I guess the candle opens could be vastly different, and the anti bunching only prevents a new trade if it is too close (most probably effecting the lower timeframes) but has no effect if candle opens farther than 20 pips away...
Author:  Wavegarrick [ Mon Sep 25, 2017 2:06 pm ]
Post subject:  Holy Graily Bob's Candle Power

Hi Steve,

I have much faith in the latest additions and especially with the offsetting functions.
Besides, my ambition is to create an EA that friends and relatives can open a $500 account, load up the EA and watch the account grow.
These words mean alot to me and speak volumes of the things you are trying to create for the greater community here at SHF. Never an easy task, I know, and will not be achieved easily, but sure as hell, an edge. :hi: :good:

Thanks Steve and Tjf.

Cheers
Leon
All times are UTC Page 11 of 36