Hi, i do not know a lot of coding but i already made something from examples from mq4l code base book EA that was "turn off" by my broker, http://www.forexfactory.com/showthre...44#post6753944
but i'm determined to get everything working like it use to, or the close that i can get, so what i need is when open trades is true verify orders
so the code for verify will be:
Will this be correct? will this change every open order that i have only if the stop is bigger then 50 ?
Also i would like to delete the specific order ticket if the modify return an error, any help ?
but i'm determined to get everything working like it use to, or the close that i can get, so what i need is when open trades is true verify orders
Inserted Code
int start { if( _SellTicket > 0 || _BuyTicket > 0) { _VerifyOrders() } // the rest of the code...
so the code for verify will be:
Inserted Code
int _VerifyOrders() { int _index; _TotalOrders; _TotalOrders = OrdersTotal(): for(_index=_TotalOrders-1;_index >=0;_index--) // loop for open orders if( OrderSymbol() == Symbol() && OrderMagicNumber() == _MagicNumber && ( OrderType() == OP_SELL || OrderType() == OP_BUY)) // <-- is the Order a stop or Buy Order { // define type, open price and stops for the current ticket int _type = OrderType(); double _sl=OrderStopLoss(); double _tp=OrderTakeProfit(); int _stop;_profit;_open; while(True) { switch(_type) { case 0: // buy order _open = OrderOpenPrice(); _stop = _open-50*Point; _profit = _open+50*Point; if( OrderStopLoss() < _stop ) { OrderModify(OrderTicket(),_open,_stop,_profit); } case 1: //sell order _stop = OrderOpenPrice()+50*Point; _profit = OrderOpenPrice()-50*Point; if( OrderStopLoss() > _stop ) { OrderModify(OrderTicket(),_open,_stop,_profit); } } } }
Will this be correct? will this change every open order that i have only if the stop is bigger then 50 ?
Also i would like to delete the specific order ticket if the modify return an error, any help ?