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

Slopey Peaky Bob
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5389
Page 7 of 84
Author:  BobbyT [ Sat Apr 14, 2018 11:43 pm ]
Post subject:  Slopey Peaky Bob

I've been patiently waiting for the Friday closures to kick in over the past few weeks but it has never come despite having either individual pairs or the entire account in profit.

I finally cracked open the source file and found that

Code: Select all

ShutDownForTheWeekend()
is never called.

Where should this be called...OnTimer?

Cheers,
BobbyT
Author:  SteveHopwood [ Sun Apr 15, 2018 12:57 am ]
Post subject:  Slopey Peaky Bob

BobbyT » Sat Apr 14, 2018 11:43 pm wrote:I've been patiently waiting for the Friday closures to kick in over the past few weeks but it has never come despite having either individual pairs or the entire account in profit.

I finally cracked open the source file and found that

Code: Select all

ShutDownForTheWeekend()
is never called.

Where should this be called...OnTimer?

Cheers,
BobbyT
Nice one BobbyT. Thanks. :clap: :clap: :clap: I will correct this over the weekend. Damn, it is the weekend. I have imbibed at the time of writing this, so please nag if a fix does not appear tomorrow. Imbibing and coding do not mix. Nor do imbibing and promising to code.

:xm: :rocket:
Author:  BobbyT [ Sun Apr 15, 2018 1:26 am ]
Post subject:  Slopey Peaky Bob

SteveHopwood » Sat Apr 14, 2018 5:57 pm wrote: Nice one BobbyT. Thanks. :clap: :clap: :clap: I will correct this over the weekend. Damn, it is the weekend. I have imbibed at the time of writing this, so please nag if a fix does not appear tomorrow. Imbibing and coding do not mix. Nor do imbibing and promising to code.

:xm: :rocket:
But imbibing and :party: .....all the damn way :yahoo:

I'll try and remind you on Monday if I don't see an update.

It really does seem everyone is basket trading SPB. Otherwise someone would have mentioned it by now. I'm testing it 'fully' OOTB just for fun. No SL, default TP, no baskets (pairs or global). The only things I have changed is useZeljko = T and converted your limey time settings to hippy settings (PST).

Just completed week three of testing :) Looking much better than the last test which was 100% fully OOTB and killed a 10k demo at GP in a matter of weeks :roll:
Author:  SteveHopwood [ Sun Apr 15, 2018 10:33 am ]
Post subject:  Slopey Peaky Bob

The demo account that had an open balance of $500 on the 7th of Feb 2018 has a current balance of $1141. OOTB settings except for:
  • TreatAllPairsAsBasket=true;
  • BasketTargetCash=30;
  • UseForexKiwi=true;
  • FkMinimumMarginPercent=500;
I have taken $1,000 from my main trading account and opened a separate one, purely to trade SPB. I will let you guys know how it gets on.

:xm: :rocket:
Author:  SteveHopwood [ Sun Apr 15, 2018 2:21 pm ]
Post subject:  Slopey Peaky Bob

I am posting this here because most of you will be testing out Peaky.

There are new versions of each member of the Slopey family in post 1 of their respective threads, including the shell code. Thomas sent me versions with enhanced screen display for these four:
  • Griddy
  • Buddha
  • Reverse Buddha
  • Peaky
All of them have the FridayCloseAllHour and SaturdayCloseAllHour code implemented. The family all had the inputs and the requisite functionality; I forgot to add the relevant call to the function.

Bloody good job mind. The code was total bollocks and would have been a disaster. :arrrg: :arrrg: :arrrg: :arrrg: :arrrg:

Don't rush the update onto your live account folks. Test it on demo first just in case I have introduced something stupid. Again.

I have not updated the version numbers, so you might want to delete/rename your current version before downloading the update.

Here is how to make the updates yourselves if you want to preserve your hard-coded inputs:
Do a search for "void ShutDownForTheWeekend" (turn off 'Match whole word only').
Copy this over the top of the existing function:

Code: Select all

void ShutDownForTheWeekend()
{

   //Close/delete all trades to be flat for the weekend.
   
   int day = TimeDayOfWeek(TimeLocal() );
   int hour = TimeHour(TimeLocal() );
   bool CloseDelete = false;
   
   //Friday
   if (day == 5)
   {
      if (hour >= FridayCloseAllHour)
         if (TotalCashUpl < MaxAllowableCashLoss)//MaxAllowableCashLoss is a negative number
            CloseDelete = true;
   }//if (day == 5)
 
   //Saturday
   if (day == 6)
   {
      if (hour >= SaturdayCloseAllHour)
         if (TotalCashUpl < MaxAllowableCashLoss)//MaxAllowableCashLoss is a negative number
            CloseDelete = true;
   }//if (day == 6)
   
   if (CloseDelete)
   {
      CloseAllTrades(AllSymbols, AllTrades);
      if (ForceTradeClosure)
         CloseAllTrades(AllSymbols, AllTrades);
      if (ForceTradeClosure)
         CloseAllTrades(AllSymbols, AllTrades);
   }//if (CloseDelete)
      

}//End void ShutDownForTheWeekend()
Do a search for, "void AutoTrading()" to take you to the top of the relevant function. Scroll down a few lines until you get to, "CountTotalsForDisplay();". Somewhere underneath, "CountTotalsForDisplay();" insert this snippet:

Code: Select all

   //Can we shut down for the weekend
   if (TotalOpenTrades > 0)
      ShutDownForTheWeekend();
I have put mine underneath the basket trading code when the EA is a basket trader such as Peaky, or directly underneath in the others.

Thanks for spotting the missing stuff, Bill. :clap: :clap: :clap:

:xm: :rocket:
Author:  pandaboy [ Sun Apr 15, 2018 2:28 pm ]
Post subject:  Slopey Peaky Bob

One week demo. Default settings except for the lot size. I have been following Steve's progress with this EA and thought that he was getting around 1500 pips a week, which made me close the positions manually when it reached around 1700 and the next batch of 300 pips before friday (no open trades).
The weekly swing had more juice in it and could have doubled the pips if i had left it till thursday
(Yeah.. I know). :jump:

Steve, Thank You! :hi:


CHFJPYH1.png
Author:  SteveHopwood [ Wed Apr 18, 2018 12:49 pm ]
Post subject:  Slopey Peaky Bob

V 1g is in post 1 in response to this:
tomele wrote:Hi Steve.

Bill pointed me to that:
Dragonian wrote: Hello Thomas,

I've noticed that on the latest version of SPB the "Tradable Pairs Unrealized P/L" column seems to show all pairs, not just tradable pairs. Or am i missing something?
Looking through the code, I saw that tradingstatus[] is no more used and populated. ChartAutomation() and my view on tradable pairs have ceased to work. Shouldnt both use the new PeakyStatus?

Cheers
Thanks for bringing it up Dragonian. I had not noticed because SPB is doing his thingy on VPS so I have not used the display features.

This is a simple DIY. Do a search for:
"if (WhatToShow=="TradablePairs" && tradingStatus[PairIndex]==untradable)"

and copy this over the top:
if (WhatToShow=="TradablePairs" && (PeakyStatus[PairIndex]==peakylonguntradable || PeakyStatus[PairIndex]==peakyshortuntradable || HtfSsStatus[PairIndex] == white))

:xm: :rocket:
Author:  SteveHopwood [ Sat Apr 21, 2018 5:07 pm ]
Post subject:  Slopey Peaky Bob

Newcomers might not understand our references to 'Peaky' here, so I have written a pdf with a full explanation: http://www.stevehopwoodforex.com/phpBB3 ... 102&t=5443

:xm: :rocket:
Author:  Radar [ Sat Apr 21, 2018 6:16 pm ]
Post subject:  Weekend Closures

Hey Steve,

I had a basket close for over $200.00 on Saturday morning, (MaxAllowableCashLoss is set to -20), so had a look at the code, and I think I found the culprit...

Code: Select all

   if (TotalCashUpl < MaxAllowableCashLoss)//MaxAllowableCashLoss is a negative number
   CloseDelete = true;
I've changed the code to...

Code: Select all

   if (TotalCashUpl < 0)
   {
	if (TotalCashUpl >= MaxAllowableCashLoss)//MaxAllowableCashLoss is a negative number
        CloseDelete = true;
   } // End if (TotalCashUpl < 0)
It sounds crazy to say it, but I hope I have another bad week, to test if the change works as desired ;)

Take care,
&
Have fun! =8^)
Author:  SteveHopwood [ Sat Apr 21, 2018 6:35 pm ]
Post subject:  Slopey Peaky Bob

Thanks radar.

if (TotalCashUpl >= MaxAllowableCashLoss) was the original code and I changed it without thinking about it properly.

I will make the necessary changes tomorrow.

:xm: :rocket:
All times are UTC Page 7 of 84