Please decode (in Russian) line by line this obscure (top or bottom) construct for me ?
In general, the "concept" of this Expert Advisor, I figured it out. Initially, two pending orders are set - Buy Stop and Sell Stop. When either of the pending orders triggers, the second one is deleted. But, at the same time, a trailing stop is set on the open position and the opposite trailing stop-loss is set instead of the stop-loss price!
//----------------------------------------------------------- intTotalSell(){intcount=0; //Функция возвращающая количество устаноавленныых SELL ордеров
for(inti=0; i<OrdersTotal(); i++){ //задается цикл от ноля до общего количества всех ордеров if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES))break; //Выбирается ордер по позиции из списка, если не выбран - выход
if(OrderSymbol()!=Symbol())continue; //Сравнивается по символу, если соответствует - продолжить
if(OrderType()==OP_SELL)count++;}return(count);} //Сравнивается по типу SELL, если соответствует то увеличивает счетчик ордеров на 1//------------------------------------------------------------ intTotalSellStop(){intcount=0; //Тоже что и предидущая функция но для SELLSTOP ордеров
for(inti=0; i<OrdersTotal(); i++){if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES))break;
if(OrderSymbol()!=Symbol())continue;
if(OrderType()==OP_SELLSTOP)count++;}return(count);}//-------------------------------------------------------------------
That's not the point. I put the script on the chart (Alpari demo). I press the "YES" button in the window that appears, but nothing happens. The positions are not reversed. In the logbook at the moment of pressing
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I apologise for the possibly incorrect question!
I'm currently dealing with the decompiled EA code. I cannot "get into" a bit of code.
Please decode (in Russian) line by line this obscure (top or bottom) construct for me ?
In general, the "concept" of this Expert Advisor, I figured it out. Initially, two pending orders are set - Buy Stop and Sell Stop. When either of the pending orders triggers, the second one is deleted. But, at the same time, a trailing stop is set on the open position and the opposite trailing stop-loss is set instead of the stop-loss price!
That's all there is to it
Good evening everyone! A need has arisen.
To use a script that reverses open positions.
To my surprise, I found that the script does not work for some reason! I tried to figure it out, but .... It does not work.
And there, apparently, - too witty author got the design ..., inserted moronic accompanying comments.
Please, can you tell me why it's not working?// Развернуть все ордера.mq4It's weird everything works just wouldn't be a bad thing to make it so :That's not the point. I put the script on the chart (Alpari demo). I press the "YES" button in the window that appears, but nothing happens. The positions are not reversed. In the logbook at the moment of pressing
2008.04.29 01:15:41 Script Revers__all_orders EURJPY,M15: removed
Good afternoon. Please write an iCustom expression for this indicator:
Here is its code -
To be able to set the R parameter in the "properties" and the bar number, of course.Yes, sort of like this, if you consider that the indicator name is hilo.mq4: