[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 459

 
kara100 >>:

Здравствуйте, все! Подскажите, плз, как вытащить из индикатора +МР, сами значения уровней для использования в советнике?

You can try using ObjectGet(). Note the line DrawVLine(onp + "hz", hz, Red, 1, STYLE_DOT, false);

 
Necron писал(а) >>

You can try using ObjectGet(). Note the DrawVLine(onp + "hz", hz, Red, 1, STYLE_DOT, false) line;

Thanks

 
Andrew_Filinsky >>:

Здравствуйте. Я начинающий трейдер, придумал торговую стратегию, написал советника, при его работе на демосчёте возникла следующая проблема:

Советник иногда зависает во время выполнения операции OrderSend(). Выглядит это так: в вечером запустил советник, утром обнаруживаю, что советник завис в 3 часа ночи. В логе присутствует сообщение "Выполнение команды началось ...", сообщения "... Выполнение команды закончилось" нет. Терминал MT4 работает, получение котировок происходит, котировки отображаются на графике инструмента, на котором работает советник, советник висит. Ситуация возникает неоднократно, после перезапуска терминала ошибка может повториться через несколько часов.

Вопросы:

В чём причина зависания советника? Как устранить зависание?

Вот фрагмент соответствующего кода:

Дополнительная информация: использую GPRS-модем, включён круглосуточно, обрывов связи с потерей коннекта в течение работы советника не наблюдается, программ для анализа сетевого трафика специально не устанавливал, работает только стандартный брандмауэр WinXP.

Поискал по форуму, подходящего описания такой проблемы, её причин и способов их устранения не нашёл.

( Такое ощущение, что проблема возникла на ровном месте. Вообще не представляю, как такие фундаментальные вещи могут не работать )

Try to run a looped script parallel to the EA which will refresh if there is an error with a frequency of 3000 slips (3 seconds).

I think the problem can be solved by a regular request (regardless of ticks).

You refresh if there is a tick, but if there is a tick why refresh?

so only a looped script can help.

int start()
{//+----------------------------------------------+
 while(!IsStopped())
   {if(!IsConnected())RefreshRates();
    Sleep(3000);
   }
return(0);
}//+----------------------------------------------+

I wrote it directly in Mozilla without checking if it works).

 
Rover82 >>:

вот.

Check, my indicator is not displayed (there is a .csv required there). The labels setting should be true

Files:
optlev_1.mq4  15 kb
 
Necron >>:

Проверьте, у меня не отображается индикатор (там .csv нужен какой-то). В настройках labels должно быть true

Necron, thank you very much it works... Yes I know the indicator itself requires external data....

 
Please help me close a position!!! I have 3 BUY orders, a signal comes out to close one BUY position and the last order I opened is closed, but I need to close the first one (the earliest one) Thanks a lot!
 

In MT4 there are two windows open horizontally (on different timeframes) for each currency pair.

- Is there any way to link them? - When I press one, the second one goes up together with the first one.

(I heard there are programs that allow linking windows, but I don't know if they work with MT)

 
splxgf писал(а) >>

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

Advisor sometimes hangs during OrderSend() ...

... I use GPRS modem, it's on 24 hours a day, no connection interruptions with loss of connectivity during EA work, I haven't installed any software to analyze network traffic, only standard WinXP firewall.

[In fact, 10MB of traffic per day and 0.8 (sic!) kilobits per second, which is 50 times less than gprs class 10 bandwidth, is enough to work online on six major currency pairs. It is important that there are no dropped connections, and that there is little delay in getting a packet to and from the broker. From the phone via GPRS the bandwidth was sufficient, but there were interruptions. Now via fixed GPRS/EDGE modem my connection is good for 24 hours without interruptions, bandwidth for MT4 terminal is even better. [End of lyric digression]

I found and fixed the source of the problem experimentally. The source was just WinXP firewall, that seemed to have interfered with data transfer from MT terminal to DC server and distorted it. And what is interesting, positions were opened, closed and modified manually but the Expert Advisor's script - poof. The problem with the hangs was solved after adding MetaTrader to WinXP firewall exceptions list.

Thank you all, thank you for the potential help.

 
Советник иногда зависает во время выполнения операции OrderSend().

Urain wrote :>>

Try to run looped script parallel to EA which refreshes in case of non-commitment with frequency of 3000 slips (3 sec). I think the problem can be solved by a regular request (regardless of ticks).

Thanks, I've already found the cause of the problem, and the solution. In fact, the connection has not gone anywhere, it has been stable without interruptions for several days. The problem turned out to be caused by WinXP firewall activity, and it is solved by adding MetaEditor to its exceptions list.

 
Good evening everyone! Can someone tell me how to close an order and select the first order and close it?
while(true)                                  // Цикл закрытия орд.
     {
      if ( Tip==0 && Cls_B==true)                // Открыт ордер Buy..
        {                                       //и есть критерий закр
         Alert("Попытка закрыть Buy ", Ticket,". Ожидание ответа..");
         RefreshRates();                        // Обновление данных
         
         Ans=OrderClose( Ticket, Lot,Bid,2);      // Закрытие Buy
         if ( Ans==true)                         // Получилось :)
           {
            Alert ("Закрыт ордер Buy ", Ticket);
            break;                              // Выход из цикла закр
           }
         if ( Fun_Error(GetLastError())==1)      // Обработка ошибок
            continue;                           // Повторная попытка
         return;                                // Выход из start()
        }

PLEASE HELP!!!

Reason: