Need someone to check my coding mistakes

 

Hey guys,

Here's a part of my code. Can someone check to see if there's a mistakes?

void ManageClose() {
   if (MaximumRiskPercentage > 1000.0) MaximumRiskPercentage = 1000;
   if (gi_304 >= gi_136 && AccountProfit() >= 0.0) CloseAllTrades();
   if (gi_216 && !gi_380) gd_unused_280 = (AccountBalance()-AccountBalance()+1200/240);
   gi_380 = gi_216;
   if (gi_164) {
      CloseAllTrades();
      gi_276 = FALSE;
   }
   if (gi_176 && Hour() == gi_180 && Minute() >= gi_184 && !gi_276) {
      CloseAllTrades();
      gi_276 = FALSE;
   }
   if (OrderProfit()>0) {
       Sleep(172800000);//Sleep for 48 hours
   }
   if (gi_196 && AccountProfit() >= gd_200) {
      CloseAllTrades();
      gi_276 = TRUE;
   }

What I want is that, "If a recently closed order profits bigger than 1 USD, then sleep for 48 hours."

I took the 10,000 = 10 seconds

60,000 = 60 seconds X 60 (minutes) X 60 (hours) X 48 (48 hours)

= 172,800,000


Is it correct to add

if (OrderProfit()>0) {
       Sleep(172800000);//Sleep for 48 hours

Under ManageClose? Will it cause problems? Such as repeated closing and open of trades? (which of course resulted in huge losses)

I need it to look at the order profit of RECENTLY CLOSED trades. Which means a trade that just closed WITHIN a minute ago instead of 1 day ago or 1 hour ago.

Please also tell me if I have small mistakes such as semicolons, commas etc...


Thanks alot !

Reason: