there are many ways to do this, here is one of them : Inserted Code datetime crosstime;/variable will remember a time when ma's crossed /anytime when it crossed, it should be like if(Ma1curr gt; Ma2curr Ma1prev lt; Ma2prev) { crosstime = TimeCurrent(); } /when check for a new order open if(entry consitions ...) { if(NoOpenedOrderSinceLastCross())/this func checks for it { OrderSend(...) /... } } /and here a function which will check this bool NoOpenedOrderSinceLastCross() { int a = 0; for(int i = 0; i lt; 1000; i ) { if(OrderSelect(OrdersHistoryTotal()-i,SELECT_BY_POS,MODE_HISTORY)) { if(OrderSymbol() == Symbol()) { if(OrderMagicNumber() == magic) { if(OrderOpenTime() gt;= crosstime) { a ; break; } if(OrderOpenTime() lt; crosstime) { break; } } } } } if(a==0) return(true); if(agt;0) return(false); }Originally Posted by ;