Hi, I have a dilemma, how do I write the code so that the first thread goes in first, and the second one goes in after the first so he can take the crumbs after the first thread, I know I need an if statement, but how do I do it so that it will be good, and when he has finished trading the first thread and has taken care of the crumbs, then it has to wait for the first thread to go back in before the second thread goes in again. First the main trade, then the second trade that takes care of the crumbs. //------ THIS IS THE FIRST TRADE. //Open Buy Order. if(Cross(0, MA[0] > MA2[0]) && MA[1] < MA2[1]) //Moving Average crosses above Moving Average, Moving Average < Moving Average. { MqlTick last_tick; SymbolInfoTick(Symbol(), last_tick); price = last_tick.ask; SL = SL_Pips * myPoint; //Stop Loss = value in points (relative to price) TP = TP_Pips * myPoint; //Take Profit = value in points (relative to price) if(TimeCurrent() - LastOpenTime() < NextOpenTradeAfterHours * 3600) return; //next open trade after time after previous trade's open if(TerminalInfoInteger(TERMINAL_TRADE_ALLOWED) && MQLInfoInteger(MQL_TRADE_ALLOWED)) { ticket = myOrderSend (ORDER_TYPE_BUY, price, MM_Size(), ""); if (ticket == 0) return; } else //not autotrading => only send alert myAlert ("order", ""); myOrderModifyRel (ORDER_TYPE_BUY, ticket, 0, TP); myOrderModifyRel (ORDER_TYPE_BUY, ticket, SL, 0); } //----- THIS IS THE SECOND TRADE. //Open Buy Order. if(Cross(1, Close[0] > MA[0]) && Close[1] < MA[1]) //Candlestick Close crosses above Moving Average, Candlestick Close < Moving Average. { MqlTick last_tick; SymbolInfoTick(Symbol(), last_tick); price = last_tick.ask; SL = SL_Pips * myPoint; //Stop Loss = value in points (relative to price) TP = TP_Pips_Small * myPoint; //Take Profit = value in points (relative to price) if(TimeCurrent() - LastOpenTime() < NextOpenTradeAfterHours * 3600) return; //next open trade after time after previous trade's open if(TerminalInfoInteger(TERMINAL_TRADE_ALLOWED) && MQLInfoInteger(MQL_TRADE_ALLOWED)) { ticket = myOrderSend(ORDER_TYPE_BUY, price, MM_Size(), ""); if(ticket == 0) return; } else //not autotrading => only send alert myAlert("order", ""); myOrderModifyRel(ORDER_TYPE_BUY, ticket, SL, 0); myOrderModifyRel(ORDER_TYPE_BUY, ticket, 0, TP); }