Just so you know folks, there is another update coming before the markets open tomorrow.
Mauro realised the price calculation for the first pending order in the grid could be incorrect if we are not using ATR for the distance between trades.
This is an easy DIY if you want to. Move the price calculation out of the if (UseAtrForGrid) conditional, so the code looks like this:
Code: Select all
//Using ATR to calculate the distance between trades
if (UseAtrForGrid)
{
double GridAtrVal = GetAtr(symbol, GridAtrTimeFrame, GridAtrPeriod, 1);
GridAtrVal*= factor;
DistanceBetweenTrades = NormalizeDouble(GridAtrVal / GridAtrDivisor, 0);
}//if (UseAtrForGrid)
if (type == OP_BUYSTOP)
price = NormalizeDouble(price + (DistanceBetweenTrades / factor), digits);
else
price = NormalizeDouble(price - (DistanceBetweenTrades / factor), digits);
Repeat this in the void SendSellGrid(string symbol, int type, double price, double lot) function.

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.