Slopey Peaky Bob

Post Reply
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Slopey Peaky Bob

Post by SteveHopwood »

Glad you got it sorted out. We can tell members to try a different chart if this arises again.

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Slopey Peaky Bob

Post by SteveHopwood »

V 2k is in post 1.

I have added differential lot sizing and moved lot sizing to its own section. I have added Desky's full swap filters.

Details are in the user guide but you do not need it if you have been following along with Desky.

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Slopey Peaky Bob

Post by SteveHopwood »

V 2l is in post 1. This addresses a rare situation where a pair that is normally negative swap in one direction is temporarily at zero and so the bot can send trades in a direction that will cost a lot of swap when that swap reverts to its normal negative. You do not need the update if negative swap does not bother you.

DIYers, copy this over the top of the existing void TradeDirectionBySwap(string symbol) function:

Code: Select all

void TradeDirectionBySwap(string symbol)
{

   //Sets TradeLong & TradeShort according to the positive/negative swap it attracts

   //Swap is read in init() and AutoTrading()

   TradeLong = true;
   TradeShort = true;
   
   if (CadPairsPositiveOnly)
   {
      if (StringSubstrOld(symbol, 0, 3) == "CAD" || StringSubstrOld(symbol, 0, 3) == "cad" || StringSubstrOld(symbol, 3, 3) == "CAD" || StringSubstrOld(symbol, 3, 3) == "cad" )      
      {
         if (!CloseEnough(longSwap, 0) && longSwap > 0) TradeLong = true;
         else TradeLong = false;
         if (!CloseEnough(shortSwap, 0) && shortSwap > 0) TradeShort = true;
         else TradeShort = false;         
      }//if (StringSubstrOld()      
   }//if (CadPairsPositiveOnly)
   
   if (AudPairsPositiveOnly)
   {
      if (StringSubstrOld(symbol, 0, 3) == "AUD" || StringSubstrOld(symbol, 0, 3) == "aud" || StringSubstrOld(symbol, 3, 3) == "AUD" || StringSubstrOld(symbol, 3, 3) == "aud" )      
      {
         if (!CloseEnough(longSwap, 0) && longSwap > 0) TradeLong = true;
         else TradeLong = false;
         if (!CloseEnough(shortSwap, 0) && shortSwap > 0) TradeShort = true;
         else TradeShort = false;         
      }//if (StringSubstrOld()      
   }//if (AudPairsPositiveOnly)
   
   
   if (NzdPairsPositiveOnly)
   {
      if (StringSubstrOld(symbol, 0, 3) == "NZD" || StringSubstrOld(symbol, 0, 3) == "nzd" || StringSubstrOld(symbol, 3, 3) == "NZD" || StringSubstrOld(symbol, 3, 3) == "nzd" )      
      {
         if (!CloseEnough(longSwap, 0) && longSwap > 0) TradeLong = true;
         else TradeLong = false;
         if (!CloseEnough(shortSwap, 0) && shortSwap > 0) TradeShort = true;
         else TradeShort = false;         
      }//if (StringSubstrOld()      
   }//if (AudPairsPositiveOnly)
   
   //OnlyTradePositiveSwap filter
   if (OnlyTradePositiveSwap)
   {
      if (!CloseEnough(longSwap, 0) && longSwap <= 0) TradeLong = false;
      if (!CloseEnough(shortSwap, 0) && shortSwap <= 0) TradeShort = false;      
   }//if (OnlyTradePositiveSwap)
   
   //MaximumAcceptableNegativeSwap filter
   if (longSwap < MaximumAcceptableNegativeSwap) TradeLong = false;
   if (shortSwap < MaximumAcceptableNegativeSwap) TradeShort = false;      

   //Buy/sell only pairs.
   //Must not be in the sell only list
   if (checkSellOnlyPairs(symbol) )
      TradeLong = false;

   //Must not be in the buy only list
   if (checkBuyOnlyPairs(symbol) )
      TradeShort = false;

}//void TradeDirectionBySwap()
:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Bloop alert

Post by SteveHopwood »

I have SPB running an a largely unattended account. I noticed earlier that a group of stop orders were repeatedly being sent and then deleted.

This behaviour stopped once I turned off the various SS delete pendings on an opposite signal inputs.

There is a logic failure somewhere and I will sort it out later. In the meantime, be aware that this can happen.

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
ntjs
Trader
Posts: 17
Joined: Wed Nov 16, 2011 6:02 pm

Slopey Peaky Bob

Post by ntjs »

Shirt protection?
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Slopey Peaky Bob

Post by SteveHopwood »

Just so you know folks, the problem is caused by the rolling grid.

SPB was obediently deleting the pendings when one of the CSS turned to the opposite colour, then the rolling grid function would equally obediently spot that there are no stop orders in place, and replace them.

I shall add additional conditionals to void DoRollingGridStuff(string symbol, int pairIndex) later.

For now, don't run both pending deletion and rolling grids at the same time.

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Slopey Peaky Bob

Post by SteveHopwood »

V 2m is in post 1. This has the attempted fix for the problem I described a few posts ago.

For the DIYers, do a search for: if (RollingGrid)//Are we using this feature?

Replace the existing code block with:

Code: Select all

   if (RollingGrid)//Are we using this feature?
      if (IsTradingAllowed(symbol, pairIndex) )//Make sure there is nothing to stop us trading eg spread
         if (MarketTradesTotal > 0)//There are open trades
            if (MarketTradesTotal + GridSize <= (MaxRolledTrades - GridSize) )//A new grid will not exceed our maximum allowed
            {   
               //Buy grid
               if (BuyOpen && ps == tradablelong)//There are market buy trades and peaky has not changed direction
                  if (!UseHtfSs || !HtfDeletePendingTradesOnOppositeSignal || HtfSsStatus[pairIndex] == blue)
                     if (!UseMtfSs || !MtfDeletePendingTradesOnOppositeSignal || MtfSsStatus[pairIndex] == blue)
                        if (!UseLtfSs || !LtfDeletePendingTradesOnOppositeSignal || LtfSsStatus[pairIndex] == blue)
                           if (BuyStopsCount == 0)
                           {
                              SendBuyGrid(symbol, OP_BUYSTOP, ask, Lot, TradeComment); 
                           }//if (BuyStopsCount == 0)
                        
               //Sell grid
               if (SellOpen && ps == tradableshort)//There are market sell trades and peaky has not changed direction
                  if (!UseHtfSs || !HtfDeletePendingTradesOnOppositeSignal || HtfSsStatus[pairIndex] == red)
                     if (!UseMtfSs || !MtfDeletePendingTradesOnOppositeSignal || MtfSsStatus[pairIndex] == red)
                        if (!UseLtfSs || !LtfDeletePendingTradesOnOppositeSignal || LtfSsStatus[pairIndex] == red)
                           if (SellStopsCount == 0)
                           {
                              SendSellGrid(symbol, OP_SELLSTOP, bid, Lot, TradeComment); 
                           }//if (SellStopsCount == 0)
               
            }//if (MarketTradesTotal + GridSize <= MaxRolledTrades)//A new grid will not exceed our maximum allowed

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Slopey Peaky Bob

Post by SteveHopwood »

V 2n is in post 1.

I have added PairPrefix and PairSuffix inputs to the General Inputs section. SPB will add these to your lists of pairs should your broker use them.

I have added the directional trading controls that I added to Desky last week.

I have added a feature requested by Sam. The inputs are LeaveIndividualBasketPendingsOpen for treating individual pairs as a basket, and LeaveAllPairsBasketPendingsOpen for the global baskets. From the updated UG:
  • LeaveIndividualBasketPendingsOpen: this is a feature requested by MurphyMan. This is his explanation: “One thing I would like to see. Would it be possible to allow the open trades to close when our targets are hit, but keep the pending trades open? Currently, when all trades are closed, it takes SPB a day or two to repopulate the pending orders. Keeping the pendings intact might be a better way to keep us in the game.”
The same explanation applies to the global basket.

Coders, I added a boolean variable deletePendings to the basket trading section. I have set this to 'true' or 'false' according to the relevant Leavexxxxx input, whenever a function is called that may close baskets. There is a possibility that I have missed a call somewhere.

Also for the coders, I was adapting SPB for one of our members and kept on forgetting that all the variables began with an upper case letter, so I repeated the exercise I did with Desky a few weeks ago and changed them so they all begin with a lower case. Bear this in mind for future DIY or it will cause you confusion.

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
MurphyMan
Trader
Posts: 345
Joined: Tue Nov 15, 2011 2:35 pm
Location: Southern Illinois, USA

Slopey Peaky Bob

Post by MurphyMan »

Thanks a lot Steve! I'll take it for a run this week.

:hi:
User avatar
MurphyMan
Trader
Posts: 345
Joined: Tue Nov 15, 2011 2:35 pm
Location: Southern Illinois, USA

Slopey Peaky Bob

Post by MurphyMan »

I got this alert today from my SPB, Ver 2n:
2019.05.23 14:20:14.186 Slopey Peaky Bob Latest Version USDSGDi,H1: Alert: USDJPYi SPB buy trades Recovery target reached. All USDJPYi SPB buy trades should have closed.
The two losing trades closed, along with 4 pendings, but there was nothing in profit to balance, so break-even didn't happen. My recovery settings are:

Use Recovery - True
The number of trades that must be opened for recovery - 6
The number of losers to close out at the break - 2
Recovery Profit Pips - 10

Have I got a setting wrong here?
Post Reply

Return to “Super Slope EA's”