[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 458

 
DenisRos >>:

ага, открываю отложенник. когда он становится на рынок, открывается еще 1 и изменяются существующие на рынке.

просто показал где проблемма=)

it's better to use a cycle. my opinion.

 
By your logic, two orders are already open and, if the second is a sell, two more pendants are opened and this second one is modified.
 
Roger писал(а) >>
If the second one is already open, then two more pending orders will be opened and this second pending order will be modified.

In general, yes, but the modification of the second in the end will not happen, it must occur when one of the two pending orders is opened, what we have now is temporary.

This loop must be placed before OrderType()==OP_SELLor must it be placed somewhere else?

 
Well, if you know exactly where the order is, maybe you don't need a loop. Check the logs to see what errors are being written.
 

Hello. I am a beginner trader, I came up with a trading strategy, wrote an Expert Advisor and the following problem arose while working on my demo account:

EA sometimes hangs during OrderSend() operation. It looks like this: I run the EA at night and in the morning I find out that the EA hangs at 3 am. The log contains the message "The command execution has started ...", but there is no message "... Command execution stopped" message does not appear. The MT4 terminal is working, quotes are received, the quotes are displayed on the chart of the symbol on which the EA is running, and the EA is hanging. The situation occurs repeatedly, after restarting the terminal the error may occur again after a few hours.

Questions:

What is the reason for the hang of the EA? How can I fix it?

Here is a fragment of appropriate code:

#define MAGICMA 20050610
extern int Slippage = 10;   // Величина проскальзывания при открытии позиций.

void OpenOrder(string sCommand, double aPrice, double aSL, double aTP)
{
  RefreshRates();
  
  double lot    = 1.0;
  int    ticket = 0;

  // Проверка всяких условий ...
  {
    Print("Выполнение команды началось ...");
    ticket = OrderSend(Symbol(), OP_SELL, lot, Bid, Slippage, aSL, aTP, "SELL", MAGICMA, 0, Red);
    Print("... Выполнение команды закончилось.");

    if ( ticket < 0 )
      Print("Ошибка открытия позициии.");
    else
      Print("Открыл позицию");
  }

  return;
}                  

Additional info: I use GPRS-modem, it is on all day and night, there are no connection interruptions with loss of connection during work of advisor, I haven't installed special software for network traffic analysis, only standard firewall WinXP.

I searched forum, I could not find any suitable description of this problem, its causes and ways to fix it.

( I have the feeling that this problem appeared out of nowhere. I can't imagine how such fundamental things can fail to work )

 
Andrew_Filinsky >>:

использую GPRS-модем

It's better to switch to ADSL or another kind of connection. I don't see how you can work on gprs at all.

 

Hello all!!! =)

May it already have been somewhere apologize for the repetition...

Programmers need help... It's nothing for the pros, but it's a problem for me.... The essence is this: There is an indicator and I need it to display the name of the indicator on the chart at the top right ... It is not important, the name will be taken from the name of the file of the indicator or it is programmatically (in the code).

You need a code fragment.

Thanks in advance...

Well, it will look like this:



 
Rover82 >>:

Всем здрасти!!! =)

Может это уже где-то было извиняюсь за повтор...

Программисты нужна помощь... Для профи это пустяковое дело, а вот для меня проблемка.... Суть такова: есть индикатор и мне нужно что бы высвечивалась имя индикатора на графике справа вверху... не важно, имя будет браться из самого названия файла индикатора или это программно (в коде).

Нужен фрагмент кода.

Заранее спасибо...

Ну а выглядеть это будет примерно так:

Post the indicator itself here

 
Necron >>:

Выложите здесь сам индикатор

here.

Files:
optlev.mq4  14 kb
 

Hello all! Could you please tell me how to get the values of the levels themselves out of the +MP indicator for use in the EA?

Files:
fmp.mq4  6 kb