Добрый день!
Возможна ли модификация стоп-лимит ордера, выставленного
с TP и SL?
Получилось
2015.06.29 22:24:32.175 Trades 'ххххх': modify order #14737510 buy stop limit 1.00 VTBR-9.15 at 7889 (7789) sl: 7689 tp: 7909 -> 7989 (7809), sl: 7609 tp: 8049 done in 37 ms
2015.06.29 22:24:32.138 Trades 'ххххх': modify order #14737510 buy stop limit 1.00 VTBR-9.15 at 7889 (7789) sl: 7689 tp: 7909 -> 7989 (7809), sl: 7609 tp: 8049
2015.06.29 22:24:27.136 Trades 'ххххх': buy stop limit 1.00 VTBR-9.15 at 7889 (7789) sl: 7689 tp: 7909 placed for execution in 35 ms
2015.06.29 22:24:27.100 Trades 'ххххх': buy stop limit 1.00 VTBR-9.15 at 7889 (7789) sl: 7689 tp: 7909
void Modify(ulong mticket, const double price, const double sl_price, const bool buy_sell ) { MqlTradeRequest request = {0}; MqlTradeResult result = {0}; //--- Fill structure request.action = TRADE_ACTION_MODIFY; request.symbol = _Symbol; request.order = mticket; request.price = price; request.stoplimit = sl_price; if ( buy_sell ) { request.type = ORDER_TYPE_BUY_STOP_LIMIT; request.tp = sl_price + PointsToPrice( NewTP ); request.sl = sl_price - PointsToPrice( NewSL ); } else { request.type = ORDER_TYPE_SELL_STOP_LIMIT; request.tp = sl_price - PointsToPrice( NewTP ); request.sl = sl_price + PointsToPrice( NewSL ); } //--- Send order if ( OrderSend( request, result ) ) { if ( result.retcode == TRADE_RETCODE_PLACED ) { ticket = result.order; } } else { Print( result.retcode, " Place: Ордер не установлен!" ); } }
Для лучшей читаемости кода можно использовать вместо
const bool buy_sellвот это
ENUM_ORDER_TYPE buy_sell
и в коде функции изменить условиеif(buy_sell == ORDER_TYPE_BUY_LIMIT)так код будет нагляднее
Для лучшей читаемости кода можно использовать вместо
вот этои в коде функции изменить условие так код будет нагляднее- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Вы принимаете политику сайта и условия использования
Добрый день!
Возможна ли модификация стоп-лимит ордера, выставленного
с TP и SL?