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

Slopey Peaky Bob
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5389
Page 52 of 84
Author:  SteveHopwood [ Wed Jan 23, 2019 9:28 pm ]
Post subject:  Slopey Peaky Bob

V 1z is in post 1. Here is the pm I received from Thomas earlier, followed by my reply:
tomele wrote:Hi Steve.

Attached is a version of SPB where I replaced all occurrences of

CloseMarketTradesOnOppositeColour and DeletePendingTradesOnOppositeColour with

CloseMarketTradesOnOppositeSignal and DeletePendingTradesOnOppositeSignal

due to an incompatibility with FXTestify. If users had changed the values of these inputs, they must apply their changes again.

Background:

As all databases, FXTestify must optimize space and bandwith. We want to store all relevant input settings for all test setups, but filter out the irrelevant ones automatically. Therefore a list exists that is used to identify irrelevant settings by their name. This list looks like this:

comment, chart, draw, display, show, hide, color, colour, arrow, text, font, snapshot, picture, alert, write, output, magicnumber, reservedpair, templatename, tradeline, eventtimer, isglobalprime, scalex, scaley, email, notify, notification

All inputs that contain one of the above strings in their name get filtered out. Therefore inputs that are relevant to the trading result should not contain these strings. Otherwise these inputs will not show up and differentiate setups in FXTestify.

Hence the change of the two SPB inputs.

Cheers
Thomas
SteveHopwood wrote:Ehup Thomas

This makes more sense from a coding perspective as well - an opposite colour is an opposite signal even if it conflicts with Peaky and so does not trigger an opposite direction trade.

I will post this later.

Cheers
This also reflects the changes Thomas has made to his 100,000 challenge version _ http://www.stevehopwoodforex.com/phpBB3 ... 45#p165845

Easy DIY folks. Do a file-wide search-and-replace for the variables in Thomas' post, with, "Match whole word only" disabled and, "Match case" enabled. This will catch the various time frames that have, say, "Htf" as their prefix.

Thomas, a lot of us are running the tests on a VPS so we do not have to reload 8 platforms every time Crapdows goes on strike. A VPS is mercilessly slow and doing anything more than something really basic is next to impossible if we want to retain some semblance of sanity. There will not be a lot of changes made before the weekend.

:xm: :rocket:
Author:  tomele [ Thu Jan 24, 2019 9:48 pm ]
Post subject:  Slopey Peaky Bob

SteveHopwood wrote:Thomas, a lot of us are running the tests on a VPS so we do not have to reload 8 platforms every time Crapdows goes on strike. A VPS is mercilessly slow and doing anything more than something really basic is next to impossible if we want to retain some semblance of sanity. There will not be a lot of changes made before the weekend.
Thanks a lot, Steve.

That is totally fine.

Cheers
Thomas
Author:  Gertje [ Fri Jan 25, 2019 9:24 am ]
Post subject:  Slopey Peaky Bob

Thomas,

What kind of EA is SMA-SPB?
Author:  SteveHopwood [ Sat Feb 02, 2019 6:56 pm ]
Post subject:  Slopey Peaky Bob

Here is an amazing thought for you folks: SPB is only a few days away from his first birthday.

He must be one of the best-tested bots of all time. For sure, it is the longest period of time that I have ever tested one. Those of us who are testing Thomas' variants at http://www.stevehopwoodforex.com/phpBB3 ... 63#p162363 have discovered the joys of a whole basket TP of 10,000 pips. I tested basket TP's of 50, 500 and 10,000 pips:
  • 50 pips TP: did ok but painfully slowly. I abandoned the test a few weeks ago.
  • 500 pips TP: excellent. Account up over 11% with absolutely no stress trading 0.01 lots on a $10,000 USD account.
  • 10,000 pips TP: run-away success. Account up over 40% with absolutely no stress trading 0.01 lots on a $10,000 USD account. Thomas, TDesk was the only way you could have excelled yourself after coming up with this beauty. :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap: :clap:
I have revamped post 1. There are three versions available:
  • Slopey Peaky Bob Latest Version: this is just SPB renamed. It is the bells and whistles version. There is a new version with a fix to a bug that Thomas spotted, but I will describe this later.
  • Slopey Peaky Bob 10000 pips: this is FXT-SPB-1 from Thomas' thread renamed. There is one more input allowing the user to chose his/her own lot size but otherwise retains Thomas' simplicity. It is the version I recommend for noobs.
  • The 1w version that I have left in place simply because a number of you liked it.
I have come to some firm conclusions re lot size related to account size. Details in the updated user guide. I was hoping to develop a bot that would allow noobs to start trading with a tiny starter account. The summer showed that SPB ain't it.

I put SPB 10000 on my live account last week. Here is a snapshot of the open live position late in the day on Friday:
XAUUSDH1.png
Encouraging, to say the least. :D

Slopey Peaky Bob Latest Version is up to V2 now. Thomas emailed with this on Thursday:
I noticed that SPB deleted trades where it shouldn't. I have made some changes to LookForTradeClosure() in the hope they will fix it.
V2 incorporates his fix. It is an easy DIY:
Do a search for, "bool LookForTradeClosure(int ticket, int PairIndex)" and copy this over the top of the existing function:

Code: Select all

bool LookForTradeClosure(int ticket, int PairIndex)
{
   //Close the trade if the close conditions are met.
   //Called from within CountOpenTrades(). Returns true if a close is needed and succeeds, so that COT can increment cc,
   //else returns false
 
 
   if (!BetterOrderSelect(ticket, SELECT_BY_TICKET) ) return(true);
   if (BetterOrderSelect(ticket, SELECT_BY_TICKET) && OrderCloseTime() > 0) return(true);
   
   bool CloseThisTrade = false;
   
   //I have left the tpsl code in case non GP members need stealth
   double take = OrderTakeProfit();
   double stop = OrderStopLoss();
   
   bool OppositeColour = false;
       
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
   if (OrderType() == OP_BUY || OrderType() == OP_BUYSTOP || OrderType() == OP_BUYLIMIT)
   {
      //TP
      if (bid >= take && !CloseEnough(take, 0) && !CloseEnough(take, OrderTakeProfit()) ) CloseThisTrade = true;
      //SL
      if (bid <= stop && !CloseEnough(stop, 0)  && !CloseEnough(stop, OrderStopLoss())) CloseThisTrade = true;
 
      if (!CloseThisTrade)
         if (UsePeaky)
            if (PeakyStatus[PairIndex] == peakyshorttradable)
               CloseThisTrade = true;
 
      if (!CloseThisTrade)
         //SS has closed red
         if (HtfSsStatus[PairIndex] == red || MtfSsStatus[PairIndex] == red || LtfSsStatus[PairIndex] == red)
         {
     
            //Market trade
            if (OrderType() < 2)
            {
               //Htf
               if (!CloseThisTrade)
                  if (UseHtfSs && HtfCloseMarketTradesOnOppositeSignal)
                     if (HtfSsVal[PairIndex] < HtfCloseBuysBelow)
                        CloseThisTrade = true;
           
               //Mtf
               if (!CloseThisTrade)
                  if (UseMtfSs && MtfCloseMarketTradesOnOppositeSignal)
                     if (MtfSsVal[PairIndex] < MtfCloseBuysBelow)
                        CloseThisTrade = true;
           
               //Ltf
               if (!CloseThisTrade)
                  if (UseLtfSs && LtfCloseMarketTradesOnOppositeSignal)
                     if (LtfSsVal[PairIndex] < LtfCloseBuysBelow)
                        CloseThisTrade = true;
           
            }//if (OrderType() < 2)
                     
            //Pending trade
            if (OrderType() > 1 && OrderType() < 6)//6 is a deposit into the account
            {
               //Htf
               if (!CloseThisTrade)
                  if (UseHtfSs && HtfDeletePendingTradesOnOppositeSignal)
                     if (HtfSsStatus[PairIndex] == red)
                        CloseThisTrade = true;
                     
               //Mtf
               if (!CloseThisTrade)
                  if (UseMtfSs && MtfDeletePendingTradesOnOppositeSignal)
                     if (MtfSsStatus[PairIndex] == red)
                        CloseThisTrade = true;
                     
               //Ltf
               if (!CloseThisTrade)
                  if (UseLtfSs && LtfDeletePendingTradesOnOppositeSignal)
                     if (LtfSsStatus[PairIndex] == red)
                        CloseThisTrade = true;
                       
            }//if (OrderType() > 1 && OrderType() < 6)
               
         }//if (HtfSsStatus[PairIndex] == red || MtfSsStatus[PairIndex] == red || LtfSsStatus[PairIndex] == red)
         
   }//if (OrderType() == OP_BUY || OrderType() == OP_BUYSTOP || OrderType() == OP_BUYLIMIT)
   
   
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
   if (OrderType() == OP_SELL || OrderType() == OP_SELLSTOP || OrderType() == OP_SELLLIMIT)
   {
      //TP
      if (bid <= take && !CloseEnough(take, 0) && !CloseEnough(take, OrderTakeProfit()) ) CloseThisTrade = true;
      //SL
      if (bid >= stop && !CloseEnough(stop, 0)  && !CloseEnough(stop, OrderStopLoss())) CloseThisTrade = true;
 
      if (!CloseThisTrade)
         if (UsePeaky)
            if (PeakyStatus[PairIndex] == peakylongtradable)
               CloseThisTrade = true;
 
      if (!CloseThisTrade)
         //SS has closed blue
         if (HtfSsStatus[PairIndex] == blue || MtfSsStatus[PairIndex] == blue || LtfSsStatus[PairIndex] == blue)
         {
         
            //Market trade
            if (OrderType() < 2)
            {
               //Htf
               if (!CloseThisTrade)
                  if (OrderType() < 2)
                     if (UseHtfSs && HtfCloseMarketTradesOnOppositeSignal)
                        if (HtfSsVal[PairIndex] > HtfCloseSellsAbove)
                           CloseThisTrade = true;
           
               //Mtf
               if (!CloseThisTrade)
                  if (OrderType() < 2)
                     if (UseMtfSs && MtfCloseMarketTradesOnOppositeSignal)
                        if (MtfSsVal[PairIndex] > MtfCloseSellsAbove)
                           CloseThisTrade = true;
                       
           
               //Ltf
               if (!CloseThisTrade)
                  if (OrderType() < 2)
                     if (UseLtfSs && LtfCloseMarketTradesOnOppositeSignal)
                        if (LtfSsVal[PairIndex] > LtfCloseSellsAbove)
                           CloseThisTrade = true;
           
            }//if (OrderTyp() < 2)
           
            //Pending trade
            if (OrderType() > 1 && OrderType() < 6)//6 is a deposit into the account
            {
               //Htf
               if (!CloseThisTrade)
                  if (UseHtfSs && HtfDeletePendingTradesOnOppositeSignal)
                     if (HtfSsStatus[PairIndex] == blue)
                        CloseThisTrade = true;
                     
               //Mtf
               if (!CloseThisTrade)
                  if (UseMtfSs && MtfDeletePendingTradesOnOppositeSignal)
                     if (MtfSsStatus[PairIndex] == blue)
                        CloseThisTrade = true;
                     
               //Ltf
               if (!CloseThisTrade)
                  if (UseLtfSs && LtfDeletePendingTradesOnOppositeSignal)
                     if (LtfSsStatus[PairIndex] == blue)
                        CloseThisTrade = true;
                       
            }//if (OrderType() > 1 && OrderType() < 6)
           
         }//if (HtfSsStatus[PairIndex] == blue || MtfSsStatus[PairIndex] == blue || LtfSsStatus[PairIndex] == blue)
         
   }//if (OrderType() == OP_SELL || OrderType() == OP_SELLSTOP || OrderType() == OP_SELLLIMIT)
   
   ///////////////////////////////////////////////////////////////////////////////////////////////////////////
   if (CloseThisTrade)
   {
      bool result = false;
     
      if (OrderType() < 2)//Market orders
         result = CloseOrder(ticket);
      else
         result = OrderDelete(ticket, clrNONE);
           
      //Actions when trade close succeeds
      if (result)
      {
         TicketNo = -1;//TicketNo is the most recently trade opened, so this might need editing in a multi-trade EA
         OpenTrades--;//Rather than OpenTrades = 0 to cater for multi-trade EA's
         return(true);//Makes CountOpenTrades increment cc to avoid missing out ccounting a trade
      }//if (result)
   
      //Actions when trade close fails
      if (!result)
      {
         return(false);//Do not increment cc
      }//if (!result)
   }//if (CloseThisTrade)
   
   //Got this far, so no trade closure
   return(false);//Do not increment cc
   
}//End bool LookForTradeClosure()
The last 12 months at SHF have been mind-bendingly good. I wonder where we will be in 5 years time?

:xm: :rocket:
Author:  Gertje [ Sat Feb 02, 2019 7:09 pm ]
Post subject:  Slopey Peaky Bob

The last 12 months at SHF have been mind-bendingly good. I wonder where we will be in 5 years time?
I know where i will be in 5 years time if things go as they have gone the last year. :smile:
Heck, I will be there in 2 years time!! :jump:
Author:  danjuma [ Sat Feb 02, 2019 9:11 pm ]
Post subject:  Slopey Peaky Bob

Thanks for sharing Steve, Thomas and all you good folks. It's most kind of you!
Author:  billv [ Sat Feb 02, 2019 9:40 pm ]
Post subject:  Slopey Peaky Bob

SteveHopwood » Sun Feb 03, 2019 5:56 am wrote: There is one more input allowing the user to chose his/her own lot size but retains Thomas' simplicity. :
Thanks Steve

On the issue of lot size I would like to mention my experience with the GBP pairs and particularly with the EURGBP which has high pip value on my AUD based trading accounts.
Some months ago, when there was a run against my GBP pairs my accounts suffered over 50% DD.
This was to my surprise because my lot size was 5000/0.01 which is more conservative than what was previously suggested .

I was wondering why I had so much drawdown on my GBP pairs.
Ok the pip count was high but a similar pip number on other pairs had almost half the DD

I had to do something about this so I changed my trading size and made it so that it is based on pip value.
The easiest way to do this (without modifying the code) is to use the risk percent input of the SPB EA.

I don't like to use SL for this strategy but for this function to work, it needs a SL input so I used a very very distant SL of 2000 pips which will hardly ever been hit but people can even use 3000 pips or more if that makes them sleep better at night:)

People who are interested to use this risk minimisation technique can set the lot size inputs of the EA to 0
and experiment with the riskpercent + SL inputs
As an example risk percent of 2 with a SL of 2000 will give a trading lot size of between 0.01 and 0.03 ( depending on base currency and on what each pip is worth)

The following example is from my $60K AUD account with settings: riskpercent=2 and stoploss =2000.
Currently the account does not have open EURGBP trades but if there were any, they would have been size 0.02.
This technique is not only helping me reduce my DD, but it also makes my money work harder because currency pairs which have low pip value can be traded at higher lot size.

I hope this helps someone :)
Author:  tomele [ Sat Feb 02, 2019 10:24 pm ]
Post subject:  Slopey Peaky Bob

Gertje » 25 Jan 2019, 10:24 wrote:Thomas,

What kind of EA is SMA-SPB?
Hi Gertjan.

This was an experiment René and I had set up months ago. A forgotten Google VPS kept on uploading results even after the whole thing had been buried.

Forget it, it had no legs.

Cheers
Thomas
Author:  SteveHopwood [ Sat Feb 02, 2019 10:42 pm ]
Post subject:  Slopey Peaky Bob

billv » Sat Feb 02, 2019 9:40 pm wrote:
SteveHopwood » Sun Feb 03, 2019 5:56 am wrote: There is one more input allowing the user to chose his/her own lot size but retains Thomas' simplicity. :
Thanks Steve

On the issue of lot size I would like to mention my experience with the GBP pairs and particularly with the EURGBP which has high pip value on my AUD based trading accounts.
Some months ago, when there was a run against my GBP pairs my accounts suffered over 50% DD.
This was to my surprise because my lot size was 5000/0.01 which is more conservative than what was previously suggested .

I was wondering why I had so much drawdown on my GBP pairs.
Ok the pip count was high but a similar pip number on other pairs had almost half the DD

I had to do something about this so I changed my trading size and made it so that it is based on pip value.
The easiest way to do this (without modifying the code) is to use the risk percent input of the SPB EA.

I don't like to use SL for this strategy but for this function to work, it needs a SL input so I used a very very distant SL of 2000 pips which will hardly ever been hit but people can even use 3000 pips or more if that makes them sleep better at night:)

People who are interested to use this risk minimisation technique can set the lot size inputs of the EA to 0
and experiment with the riskpercent + SL inputs
As an example risk percent of 2 with a SL of 2000 will give a trading lot size of between 0.01 and 0.03 ( depending on base currency and on what each pip is worth)

The following example is from my $60K AUD account with settings: riskpercent=2 and stoploss =2000.
Currently the account does not have open EURGBP trades but if there were any, they would have been size 0.02.
This technique is not only helping me reduce my DD, but it also makes my money work harder because currency pairs which have low pip value can be traded at higher lot size.

I hope this helps someone :)
This is something for people to experiment with and find their own comfort zone. Feel free to discuss it here. It is an obvious to explore.

:xm: :rocket:
Author:  c1borg [ Tue Feb 05, 2019 4:18 pm ]
Post subject:  Slopey Peaky Bob

SteveHopwood » Wed Jan 23, 2019 9:28 pm wrote:V 1z is in post 1. Here is the pm I received from Thomas earlier, followed by my reply:
Hi Steve experimenting with SPB in my own setup(s) couple of minor observations cant find 1z in post 1 is this now V2 and Slopey Peaky Bob 10000 pips version has no magic setting so changed mine in the code so it would manage my trades. Absolutely brilliant EA :yahoo:
All times are UTC Page 52 of 84