Errors, bugs, questions - page 61

 

How do I trade with pending orders? I tried it this way:

      if(open<close)// цена растет
       {
       if(OrderGetInteger(ORDER_TYPE)!=ORDER_TYPE_SELL_STOP)
        {
         {
         mrequest.action = TRADE_ACTION_PENDING;                                        
         mrequest.price = (high+low)/2;            
         mrequest.sl = NormalizeDouble(mrequest.price + STP*_Point,_Digits); // Stop Loss
         mrequest.tp = NormalizeDouble(mrequest.price - TKP*_Point,_Digits); // Take Profit
         mrequest.symbol = _Symbol;                                          // символ
         mrequest.volume = Lot;                                              // количество лотов для торговли
         mrequest.magic = EA_Magic;                                          // Magic Number
         mrequest.type = ORDER_TYPE_SELL_STOP;                               // ордер на продажу
         mrequest.type_filling = ORDER_FILLING_AON;                          // тип исполнения ордера - все или ничего
         mrequest.deviation=5;                                               // проскальзывание от текущей цены
         OrderSend(mrequest,mresult);                                        // отсылаем ордер
         }
        }
       }
One order is executed and then on every tick pending orders continue to be placed.
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - Документация по MQL5
 
AM2:

How do I trade with pending orders? Tried it this way:

One order is executed and then on every tick the pending orders continue to be placed.

Please provide all the code.
 
AM2:

How do I trade with pending orders? Tried it this way:

One order is executed and then on every tick pending orders continue to be placed.

Is it necessary to control the presence of pending orders on this pair, like (or what)?
 

installed WIN-7 64. downloaded and installed MT5.

Inactivated date selection tab.

 
Prival:

installed WIN-7 64. downloaded and installed MT5.

Inactivated date selection tab.

Is custom mode selected?
 
Prival:

installed WIN-7 64. downloaded and installed MT5.

Inactivated date selection tab.

What is the period type there? Usually only the "Custom period" dates become active (everything else counts automatically)...
 
Interesting:
What type of period is there? Usually only "Custom period" makes dates active (everything else is automatic)...
Yeah, I think I got it. Thanks. I have an all period. I can't do anything right now. I've been downloading history for about 20 minutes. Let it download, maybe it will be faster later...
 
alexvd:

Not always. The prime example is ENUM_TIMEFRAMES.

No description of enum values is planned in the help, but you always have an opportunity to find out their meaning.

not so... I'm a programmer... and I personally can pull everything... and the invisible cursor too... from the outside...

But the product is for a trader... who has no understanding of programming, but sometimes wants to do something...

You've got to get all the information you can...

 
alexvd:
Please give me the whole code.
Files:
ema.mq5  6 kb
 
EQU:

not so... I'm a programmer... and I personally can pull everything... and so can the invisible cursor... from the outside...

but it's a product for a trader... who knows nothing about programming, but sometimes wants to do something...

You've got to get all the information you can...

There are no plans to post integer values. Use constant identifiers, it will protect you from possible errors.
Документация по MQL5: Основы языка / Препроцессор / Макроподстановка (#define)
Документация по MQL5: Основы языка / Препроцессор / Макроподстановка (#define)
  • www.mql5.com
Основы языка / Препроцессор / Макроподстановка (#define) - Документация по MQL5
Reason: