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

Slopey Peaky Bob
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5389
Page 42 of 84
Author:  SteveHopwood [ Tue Aug 28, 2018 5:16 pm ]
Post subject:  Slopey Peaky Bob

Experimental V 1w is in post 1.

The Recovery code was not quite right - and I am still not certain.

I had recovery to kick in at 4 trades, with at least 1 of them being a loser. What was happening was that the 4th pending was filling and was instantly a loser because of the spread, so SPB was closing the trades immediately.

I have changed the name of one input and added another. From the updated user guide:
  • TradesToStartLookingForRecovery: the number of market trades that need to be open before Slopeyconsiders the position to be in need of Recovery.
  • MinimumLosersToTriggerRecovery: we only need Recovery if we have some losers. This input specifies the number of losing trades to trigger looking to close out at breakeven.
The default TradesToStartLookingForRecovery is 6.

The default MinimumLosersToTriggerRecovery is 2.

Let's see if this makes the function work better.

:xm: :rocket:
Author:  SteveHopwood [ Wed Aug 29, 2018 9:58 pm ]
Post subject:  Slopey Peaky Bob

What a day.

Those of us aficionadas of SPB have been stuck in DD for weeks. I still am, but at about a third of what it was at the start of the week.

The sudden strengthening of the GBP did me a lot of favours today. I was still stuck with GJ buys at the start of the week that were about -$1,200 into DD. Absolutely no danger to the account - see my firm conclusions re lot size versus size of account in post 1 - but enough to prevent me taking any further trades.

Here is what happened today:
GBPJPYH1.png
All the stuff on the chart veils the extent of the rise. Here is the same chart drawn out so you can see some detail at the end.
GBPJPYH1 steep rise.png
The steep rise started c. 2.00 pm UK time. As it continued, I gradually offset numbers of winners from the bottom of the heap of umpteen trades against vast losers at the top. This freed up lots of equity and margin.

I had also closed out a couple of other groups of trades at BE plus a few bucks.

It took a few hours but I eventually arrived at a point where I could close those GJ trades at a small loss and still be in overall profit for the day. OK, so I closed the GJ trades at nearly -$60, but bear in mind where they had once been - and I came out in profit over the day.

Now I can easily trade again without worrying about umpteen GJ trades continuing to go against me. No, the account was never in danger as the margin level percent never dropped below 750 but I have learned caution. I do not want it to drop below 1,000%, so the worst was not comfortable.

I still have a number of SPB pair trades deeply into DD. I am dealing with them mostly in the same way I described a few posts up - unless there are only a couple of trades open and the swap is positive.

I am starting to fall in love with the Super Slope D1, H4, H1 combo. I am thinking seriously about adding the two extra SS time frames here.

:xm: :rocket:
Author:  trader689 [ Thu Aug 30, 2018 12:36 pm ]
Post subject:  Slopey Peaky Bob

hey Steve

brilliant, thanks for the update and can second that feedback on my SPB demo's dd after the GBP rise.
Also addition of the two SS timeframes sounds like it would be an exciting development :good:

trader
Author:  SteveHopwood [ Wed Sep 05, 2018 10:41 am ]
Post subject:  For the codeslingers

Those of you trying the Experimental version and Recovery already know that it is not working.

I returned to the code and found lots that was wrong. Here is a fully commented copy of the updated code. Would you codeslingers run your eyes over it, please, and see if you can spot anything obviously wrong? THe function is called just after the call to CountOpenTrades(symbol, PairIndex), so the bot has a picture of the open position.

Code: Select all

bool HaveWeHitRecoveryTarget(string symbol, int type)
{
   //Calculate the Recovery target and close the trades if the target price is reached.
   
   GetBasics(symbol);//Probably not needed, but no harm to check.
   
   int cc = 0;
   RecoveryTargetPrice = 0;
   
   if (type == OP_BUY)
   {
      //Add together the price of all the market trades
      for (cc = 0; cc < ArraySize(BuyTickets); cc++)
      {
         if (!BetterOrderSelect(BuyTickets[cc], SELECT_BY_TICKET, MODE_TRADES) )
            continue;//Just in case
         
         //Buy ticket numbers are sorted in ascending order at the end of CountOpenTrades()
         if (cc == 0)//Set RecoveryTargetPrice first time around the loop
            RecoveryTargetPrice = OrderOpenPrice();
         else
            RecoveryTargetPrice+= OrderOpenPrice();//Add the next order price to RecoveryTargetPrice
      }//for (cc = 0; cc < ArraySize(BuyTickets); cc++)
      
      //Divide this figure by the ticket array size to arrivc at the breakeven price
      RecoveryTargetPrice/= ArraySize(BuyTickets);
      RecoveryTargetPrice+= (RecoveryProfitP / factor);//Add the lock-in profit pips
      
      //Has the market reached this target? Using bid because buys close at the Bid
      if (bid >= RecoveryTargetPrice)
         return(true);
   
   }//if (type == OP_BUY)

   if (type == OP_SELL)
   {
      //Add together the price of all the market trades
      for (cc = 0; cc < ArraySize(SellTickets); cc++)
      {
         if (!BetterOrderSelect(SellTickets[cc], SELECT_BY_TICKET, MODE_TRADES) )
            continue;//Just in case
         
         //Sell ticket numbers are sorted in descending order at the end of CountOpenTrades()
         if (cc == 0)
            RecoveryTargetPrice = OrderOpenPrice();
         else   
            RecoveryTargetPrice+= OrderOpenPrice();//Subtract the next order price from RecoveryTargetPrice
      }//for (cc = 0; cc < ArraySize(BuyTickets); cc++)
      
      //Divide this figure by the ticket array size to arrivc at the breakeven price
      RecoveryTargetPrice/= ArraySize(SellTickets);
      RecoveryTargetPrice-= (RecoveryProfitP / factor);//Add the lock-in profit pips
      
      //Has the market reached this target? Using ask because sells close at the Ask
      if (ask <= RecoveryTargetPrice)
         return(true);
   
   }//if (type == OP_SELL)
   

   //Got this far, so no closure
   return(false);

}//bool HaveWeHitRecoveryTarget(string symbol, int type)
:xm: :rocket:
Author:  FXTrucker [ Thu Sep 06, 2018 12:39 am ]
Post subject:  Slopey Peaky Bob

First off... Thanks to Steve , Bob and all the others who have done so much to make this forum such a great resource. I have been following SPB for some time and am still reviewing the program and re reading the forum posts.

I am not a full fledged codeslinger but I have used your programs as a framework to code EAS and INDIS.
Most of what I know about Mq4 I have learned from them.

It looks like you recovery call should work as intended to me
Author:  SteveHopwood [ Thu Sep 06, 2018 11:47 am ]
Post subject:  Slopey Peaky Bob

FXTrucker » Thu Sep 06, 2018 12:39 am wrote:First off... Thanks to Steve , Bob and all the others who have done so much to make this forum such a great resource. I have been following SPB for some time and am still reviewing the program and re reading the forum posts.

I am not a full fledged codeslinger but I have used your programs as a framework to code EAS and INDIS.
Most of what I know about Mq4 I have learned from them.

It looks like you recovery call should work as intended to me
Thanks for looking.

:xm: :rocket:
Author:  SteveHopwood [ Thu Sep 06, 2018 2:24 pm ]
Post subject:  Slopey Peaky Bob

Those of you managing your trades manually, check out slipshod's post at http://www.stevehopwoodforex.com/phpBB3 ... 796#p11796

Eherenmat (Mat) has sent me a version of HGCB with support/resistance added and I am just hacking his code to see how it works, so I can add it to SCB. Mat is a great fan of slipshod's indi.

:xm: :rocket:
Author:  barry [ Mon Sep 10, 2018 1:35 am ]
Post subject:  Slopey Peaky Bob

Does anyone here keep a log of changes made to the various updates of SPB? I left a version 1o running, and I have a version 1t and a version 1v running. The newer versions are doing better, but now I don't know whether to attribute that better performance to improvements to the EA or the setfile, or reduced leverage or the luck of starting at a time more suited to the EA. Any ideas?
I know it's generally good practice to keep up with the updates, but the v1o was doing so well for such a long time that I wanted to leave it undisturbed.
Author:  Priyesh [ Sun Sep 16, 2018 11:12 pm ]
Post subject:  Slopey Peaky Bob

Has anyone else noticed that the SPB dashboard is not refreshing?
I have checked all settings and including EventTimeIntervalSecond = 1
BTW I am running the EA on Eaymon's VPS server. and a GP live account.

Regards
Priyesh
Author:  luke [ Mon Sep 17, 2018 6:05 pm ]
Post subject:  Slopey Peaky Bob

Priyesh » Mon Sep 17, 2018 12:12 am wrote:Has anyone else noticed that the SPB dashboard is not refreshing?
I have checked all settings and including EventTimeIntervalSecond = 1
BTW I am running the EA on Eaymon's VPS server. and a GP live account.
make sure auto trading is enabled
All times are UTC Page 42 of 84