Slopey Peaky Bob
- tomele
- Administrator
- Posts: 1208
- Joined: Tue May 17, 2016 3:40 pm
- Location: Germany, Forest of Odes, Defending the Limes
Slopey Peaky Bob
Hi @all.
Now that Steve has added the parts that made up version 1L, the latest version of SPB should be able to behave like 1L (the 100,000 pips challenge version). Many, many thanks Steve for bringing this bot to where it is now.
My setfile that emulates the 1000,000 pips 1L with the current version is attached. I will be testing that in the time to come. As soon as I am happy with it, there will be another rat race. That time playing with the grid thingies as FXT-SPB4. Stay tuned.
One thing is for sure. Exciting times are ahead.
Cheers
Thomas
.
Now that Steve has added the parts that made up version 1L, the latest version of SPB should be able to behave like 1L (the 100,000 pips challenge version). Many, many thanks Steve for bringing this bot to where it is now.
My setfile that emulates the 1000,000 pips 1L with the current version is attached. I will be testing that in the time to come. As soon as I am happy with it, there will be another rat race. That time playing with the grid thingies as FXT-SPB4. Stay tuned.
One thing is for sure. Exciting times are ahead.
Cheers
Thomas
.
You do not have the required permissions to view the files attached to this post.
Happy pippin, Thomas 
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
- WorldsEnd
- Trader
- Posts: 97
- Joined: Fri Aug 29, 2014 7:36 pm
Slopey Peaky Bob
Set up on SPB V2e and connected to FxTestify. Let‘s wait and see.tomele » 04 Mar 2019, 19:40 wrote:Hi @all.
Now that Steve has added the parts that made up version 1L, the latest version of SPB should be able to behave like 1L (the 100,000 pips challenge version). Many, many thanks Steve for bringing this bot to where it is now.
My setfile that emulates the 1000,000 pips 1L with the current version is attached. I will be testing that in the time to come. As soon as I am happy with it, there will be another rat race. That time playing with the grid thingies as FXT-SPB4. Stay tuned.
One thing is for sure. Exciting times are ahead.
Cheers
Thomas
.
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Slopey Peaky Bob
V 2g is in post one, fixing a monumental bloop in the rolling grid stuff.
Just so you folks know, I can take a beating up here.
Jem emailed from GP last week. Not exactly the same words but the same gentle statement. It included a details of a demo I was running and ran along the lines of, "Hey Steveo. This account is going berserk. Couldn't sort out your coding could you?"
Probably around the same time, I received this PM from Thomas:
"Listen up you mindless cretin. Your code is a total disaster of the sort only created by a dimwit of the first order. Sort it out you moron, before SPB/GP implodes."
So I promised both that I would do something about it and promptly forgot. I am getting older, so this is something you may need to factor into your consideration.
I deleted the offending version from a demo and forgot about it. Something for you folks to remember as I continue to age.
Thomas sent me a nudge earlier, hence V 2g.
They are easy DIY's folks and will show easily why the rolling grid code would replace the pendings that SPB just deleted after the signal went flat. Go to void DoRollingGridStuff(string symbol, int pairIndex). Scroll down to:
if (BuyOpen)//There are market buy trades
Replace it with:
if (BuyOpen && BuySignal[pairIndex])//There are market buy trades
Then scroll down to:
if (SellOpen)//There are market sell trades
Replace it with:
if (SellOpen && SellSignal[pairIndex])//There are market sell trades
Sorry Jem.
Thanks Thomas.

Just so you folks know, I can take a beating up here.
Jem emailed from GP last week. Not exactly the same words but the same gentle statement. It included a details of a demo I was running and ran along the lines of, "Hey Steveo. This account is going berserk. Couldn't sort out your coding could you?"
Probably around the same time, I received this PM from Thomas:
I know you folks love a laugh at my expense, so here is a translation into Steveese of Jem and Thomas' gentle posts:Hi Steve.
Sorry to bother you with a problem of the rolling grid in SPB.
As soon as SPB closes the pending trades due to a changed SS signal, the rolling grid feature gets mad. SPB constantly closes/reopens pending trades.
Cheers
Thomas
"Listen up you mindless cretin. Your code is a total disaster of the sort only created by a dimwit of the first order. Sort it out you moron, before SPB/GP implodes."
So I promised both that I would do something about it and promptly forgot. I am getting older, so this is something you may need to factor into your consideration.
I deleted the offending version from a demo and forgot about it. Something for you folks to remember as I continue to age.
Thomas sent me a nudge earlier, hence V 2g.
They are easy DIY's folks and will show easily why the rolling grid code would replace the pendings that SPB just deleted after the signal went flat. Go to void DoRollingGridStuff(string symbol, int pairIndex). Scroll down to:
if (BuyOpen)//There are market buy trades
Replace it with:
if (BuyOpen && BuySignal[pairIndex])//There are market buy trades
Then scroll down to:
if (SellOpen)//There are market sell trades
Replace it with:
if (SellOpen && SellSignal[pairIndex])//There are market sell trades
Sorry Jem.
Thanks Thomas.
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. pianodoodler@hotmail.com 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.
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. pianodoodler@hotmail.com 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.
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Slopey Peaky Bob
V 2h is in post 1. The rapid opening and closing of the rolling grid is still causing problems, but you do not need 2h for now if you are not using it.
A brief interjection: I have done a global search and replace of "PairIndex" with "pairIndex" to make this parameter the same as it is in Desky - just so I do not have to remember which is which.
I cannot work out why the rolling grid is not working. I have tried changing the conditional and added a margin check at the top of the function. No idea if this will do the trick. DIYers, the easiest way is to copy this over the top of the existing function:

A brief interjection: I have done a global search and replace of "PairIndex" with "pairIndex" to make this parameter the same as it is in Desky - just so I do not have to remember which is which.
I cannot work out why the rolling grid is not working. I have tried changing the conditional and added a margin check at the top of the function. No idea if this will do the trick. DIYers, the easiest way is to copy this over the top of the existing function:
Code: Select all
void DoRollingGridStuff(string symbol, int pairIndex)
{
//Margin level check
if (!MarginCheck() )
return;
GetBasics(symbol);
//Make the peaky status equation easier to read
string ps = untradable;
if (PeakyStatus[pairIndex] == peakylongtradable || PeakyStatus[pairIndex] == peakylonguntradable)
ps = tradablelong;
if (PeakyStatus[pairIndex] == peakyshorttradable || PeakyStatus[pairIndex] == peakyshortuntradable)
ps = tradableshort;
//Rolling grid.
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
{
//Buy grid
if (BuyStopsCount == 0)
{
SendBuyGrid(symbol, OP_BUYSTOP, ask, Lot, TradeComment);
}//if (BuyStopsCount == 0)
}//if (BuyOpen)
//Sell grid
if (SellOpen && ps == tradableshort)//There are market sell trades and peaky has not changed direction
{
//Sell grid
if (SellStopsCount == 0)
{
SendSellGrid(symbol, OP_SELLSTOP, bid, Lot, TradeComment);
}//if (SellStopsCount == 0)
}//if (SellOpen)
}//if (MarketTradesTotal + GridSize <= MaxRolledTrades)//A new grid will not exceed our maximum allowed
}//End void DoRollingGridStuff(string symbol, int pairIndex)
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. pianodoodler@hotmail.com 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.
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. pianodoodler@hotmail.com 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.
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Slopey Peaky Bob
V 2i is in post 1.
Global Prime shut down a couple of Mauro's demo accounts after their servers were bombarded by a gazillion messages.
Mauro thinks the problem was shirt protection because he knew that the accounts were close to needing it. He looked through the code and noticed that the call to the relevant function was inside the loop that iterates through all the trading pairs - clearly the wrong place for it.
I have changed the ShirtProtection() function into a boolean, so DIYers copy this over the top of the existing function:
You can see that I have added some extra conditionals at the top of the function as well. Compile the code and follow the error message to get to the incorrectly placed function call. Delete it.
Do an upward search for: CountTotalsForDisplay();
Insert this underneath:
Thanks Mauro

Global Prime shut down a couple of Mauro's demo accounts after their servers were bombarded by a gazillion messages.
Mauro thinks the problem was shirt protection because he knew that the accounts were close to needing it. He looked through the code and noticed that the call to the relevant function was inside the loop that iterates through all the trading pairs - clearly the wrong place for it.
I have changed the ShirtProtection() function into a boolean, so DIYers copy this over the top of the existing function:
Code: Select all
bool ShirtProtection()
{
if (CloseEnough(AccountMargin(), 0) )
return(false);//No margin being used, so nothing to do.
if (OrdersTotal() == 0)
return(false);
if (TotalOpenTrades == 0)//Counted in CountTotalsForDisplay()
return(false);
//Calculate the current margin level percent
double ml = NormalizeDouble(AccountEquity() / AccountMargin() * 100, 2);
//Delete all outstanding pending orders if the margin level drops below
//our comfort zone.
if (DeletePendingsBelowThisMarginLevelPercent > 0)
{
if (ml < DeletePendingsBelowThisMarginLevelPercent)
{
CloseAllTrades(AllSymbols, OP_BUYSTOP);
CloseAllTrades(AllSymbols, OP_SELLSTOP);
return(true);
}//if (ml < DeletePendingsBelowThisMarginLevelPercent)
}//if (DeletePendingsBelowThisMarginLevelPercent > 0)
//Close the entire position if we are in danger of a margin call.
if (CloseDeleteAllBelowThisMarginLevelPercent > 0)
{
if (ml < CloseDeleteAllBelowThisMarginLevelPercent)
{
CloseAllTrades(AllSymbols, AllTrades);
if (ForceWholePositionClosure)
{
CloseAllTrades(AllSymbols, AllTrades);
if (ForceWholePositionClosure)
{
CloseAllTrades(AllSymbols, AllTrades);
if (ForceWholePositionClosure)
{
return(true);//Still failed, so try again at the next timer event
}//if (ForceWholePositionClosure)
}//if (ForceWholePositionClosure)
ForceWholePositionClosure = false;//Closure succeeded
return(true);
}//if (ForceWholePositionClosure)
}//if (ml < CloseDeleteAllBelowThisMarginLevelPercent)
}//if (CloseDeleteAllBelowThisMarginLevelPercent > 0)
//Got here, so no closures
return(false);
}//void ShirtProtection()
Do an upward search for: CountTotalsForDisplay();
Insert this underneath:
Code: Select all
//Protect the account when the margin level drops below our comfort zone.
if (ShirtProtection() )
{
//In case an order close/delete failed
if (ForceWholePositionClosure)
return;
//Closure/deletion succeeded
CountTotalsForDisplay();
DisplayUserFeedback();
return;
}//if (ShirtProtection() )
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. pianodoodler@hotmail.com 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.
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. pianodoodler@hotmail.com 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.
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Slopey Peaky Bob
I just received this PM from Bob, so I am posting it in all the most active threads:

The best way to get in touch will be by PM.nanningbob wrote:I’m going to be in New Zealand April 13-22. Auckland 13-16 and the rest of the time traveling the South Island. If any kiwis want to meet be glad to say hi. I also will be in Fiji islands 4/10-13
Don’t know how to send out a message like this??
Bob
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. pianodoodler@hotmail.com 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.
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. pianodoodler@hotmail.com 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.
- MurphyMan
- Trader
- Posts: 345
- Joined: Tue Nov 15, 2011 2:35 pm
- Location: Southern Illinois, USA
Slopey Peaky Bob
Having some trouble here. No matter what I do, Basket cash take profit is stuck on USD 10.00, even though BasketTargetCash is set to 0.00. Here's a stranger thing, let's say I try setting BasketTargetCash to USD $250.00. SPB will display "Basket cash take profit = USD 250.00" for about three seconds, then it will revert to "Basket cash take profit = USD 10.00".
I really just want use Basket Percentage of Balance Trailing Stop as my method to take profit and I assume that the lower value displayed on the SPB home screen will take priority. I'm also attaching my whole set file.
Could it have something to do with being outside of trading hours?
I really just want use Basket Percentage of Balance Trailing Stop as my method to take profit and I assume that the lower value displayed on the SPB home screen will take priority. I'm also attaching my whole set file.
You do not have the required permissions to view the files attached to this post.
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Slopey Peaky Bob
No idea Sam. There are probably about 1,000 permutations of inputs and I cannot test them all. Try turning everything off then gradually restarting them to narrow anything in the code that is causing a problem. Try to imagine my reaction were I to do this exercise only to find it is you being a dimwit.MurphyMan » Sat Apr 06, 2019 8:02 pm wrote:Having some trouble here. No matter what I do, Basket cash take profit is stuck on USD 10.00, even though BasketTargetCash is set to 0.00. Here's a stranger thing, let's say I try setting BasketTargetCash to USD $250.00. SPB will display "Basket cash take profit = USD 250.00" for about three seconds, then it will revert to "Basket cash take profit = USD 10.00".
I really just want use Basket Percentage of Balance Trailing Stop as my method to take profit and I assume that the lower value displayed on the SPB home screen will take priority. I'm also attaching my whole set file.Could it have something to do with being outside of trading hours?
Actually, perhaps best not to imagine doing so.
You are the first one to come up with this so I am going with my usual it-is-something-you-are-doing-wrong policy.
Looking on the bright side, you have earned the right over the years, to argue. Feel free to do so. I offer no guarantees that my code is completely accurate.
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. pianodoodler@hotmail.com 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.
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. pianodoodler@hotmail.com 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.
- MurphyMan
- Trader
- Posts: 345
- Joined: Tue Nov 15, 2011 2:35 pm
- Location: Southern Illinois, USA
Slopey Peaky Bob
Thanks Steve. Some friends are about to bring over some new Scotch, so I think I may have to wait until tomorrow.
- SteveHopwood
- Owner
- Posts: 9904
- Joined: Tue Nov 15, 2011 8:43 am
- Location: Misterton - an insignificant village in England. Very pleasant to live in.
Slopey Peaky Bob
A friend introduced me to Irish whisky over Christmas and I am completely won over.MurphyMan » Sat Apr 06, 2019 8:52 pm wrote:Thanks Steve. Some friends are about to bring over some new Scotch, so I think I may have to wait until tomorrow.
At least, I assume you are drinking single malt. Blended stuff - you might as well drink petrol.
Irish whisky is more gentle than a single Scotch Malt. Try Jamesons and Tulamore Dew.
Hope you and your pals have a great time.
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. pianodoodler@hotmail.com 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.
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. pianodoodler@hotmail.com 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.