V 1d is in post 1, with a fix to stop Awesome hanging up her hat when loaded onto a newly created demo account.
The starting balance shows up as a trade when code iterates through trades in the History tab, with an OrderType() of 6 so I have told her only to consider closed market trades.
Easy DIY. Copy this over the top of double AccumulatedProfit(int tf):
Code: Select all
double AccumulatedProfit(int tf)
{
bool OnlyClosedOrders=False;
datetime starttime = iTime(Symbol(), tf, 0);//Define a starting time based on the passed parameter
double profit = 0; //initialize the profit to calculate
//Iterate through the orders in History and calculate the accumulated profit/loss.
for (int cc = OrdersHistoryTotal() -1; cc >= 0; cc--)
{
if(BetterOrderSelect(cc, SELECT_BY_POS, MODE_HISTORY) )
if(OrderCloseTime() >= starttime)
if (OrderType() < 2)//We are only interested in market trades
profit += (OrderProfit() + OrderSwap() + OrderCommission() );
}//for (int cc = OrdersHistoryTotal() -1; cc >= 0; cc--)
return(profit);
}//End double AccumulatedProfit(int tf)
I suggest holding off downloading the latest just in case something else crops up that I have forgotten. Download it a few hours before the markets open after the weekend.

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.