just at this code to your EA, and ensure you place the function "CloseProfit" under the Ontick function: extern int Takeprofit = 400; //your Fixed Take profit extern int Slippage = 30; double CurrentProfit; int TotalOrders; int MyMagic=554245147; ...