Because I have tested the code now, and it works fine for me. So, the code is not the problem.
To accommodate for slippage, introduce a slippage input parameter: input double SLPG = 10;
Then, replace all zeros (which is the last parameter) in all OrderClose() calls with the SLPG variable,
i.e. OrderClose(ticketsb, OrderLots(), Bid, 0) becomes OrderClose(ticketsb, OrderLots(), Bid, SLPG). And hope for the best : p
Maybe your broker also runs some other tricks on you, but that's your problem, I cannot help with that..
P.S. Also keep in mind that the SLCASH paramter has to be a negative value.
..