V 1g is in post 1. I have moved the maximum pairs allowed filter to where it will do some good. Also, Gary just pm'd me with suggestions to help cut out the 'unknown ticket' errors that crop up.
For those of you who like to go under the bonnet, do a search for "Note to coders about hedging." This will take you to the explanatory comment about hedging. Underneath that and before the two blocks of code that set up the trade, insert this:
Code: Select all
//A check that we are not already at our pairs limit. Abort the trade if so.
if (SendLong || SendShort)
if (OrdersTotal() > 0)
{
CountCurrentlyTradingPairs();
if (PairsWithTrades >= MaxPairsAllowed)
return;
}//if (OrdersTotal() > 0)
Then go to OnTimer() and delete the code block that contains the call to CountCurrentlyTradingPairs();
The other changes are in four code blocks, two each in these two functions:
- void CloseAllTrades(string symbol, int type, int magic)
- void NuclearOption()
You will see this block of code twice in each function:
Code: Select all
if (result)
{
cc++;
OpenTrades--;
}//(result)
Gary suggested adding this: FifoTicket[cc] = -1;
The block will look like this:
Code: Select all
if (result)
{
FifoTicket[cc] = -1;
cc++;
OpenTrades--;
}//(result)

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.