void TakeProfiting()
{
if (BuyOrders == 0 && SellOrders == 0)
{
InvestAmt = AccountEquity();
}
else
{
InvestAmt = AccountBalance();
}
double profit = AccountEquity() - InvestAmt;
if (profit > 0)
{
double percentProfit = (profit * 100) / InvestAmt;
if (percentProfit > TakeProfitPercentage)
{
//close all orders
}
}
}