Questions from a "dummy" - page 222

 
TVA_11: It is not in the terminal (navigator window). Everything looks standard there, the same as before compilation.

Advisers

adviser

examples

more...

Terminal => Ctrl+N (Navigator) => Open one of the folders (Indicators, Expert Advisors or Scripts) => Search for the name of the required program.
 
TVA_11: https://www.mql5.com/ru/code/103 this Expert Advisor. First, I created what I have in Expert Advisors. Then I inserted the program text there.

Did you run the Expert Advisor initially in the tester?

TVA_11 : Not a single transaction in any variant. What's wrong?

What do the log files say?

 

Looks like that Expert Advisor is not trading at all.

Put in from others, where it trades from any two bars to where it goes, and it worked.

Now I am trying to figure out how to trade correctly.

Every Expert Advisor has its own approach.)

20_200 expert_v4.2_AntS.mq5

I am trying to understand how it works and if it trades correctly.

 
TVA_11:

...

What's not an expert, you get your own approach ).

...

Experts in Code Base just as an example of implementation. Not always of high quality and full-featured of course. Anything more than that, you either have to do it yourself or order it.
 

I do not understand the meaning of the possibility, in MetaEditor, to open new code windows(context menu => New window). If you change one of the windows, the same thing will change in the other one.

In the Help it is written only this:

  • New Window - opens a copy of the current tab in a new one. At that the serial number of the copy will be added to the tab name;

What are new windows for?

 

Hello, can someone explain the win api. Created a dialog box, CreateDialog() function. Why window function is not executed atomically, even when using critical section?

INT_PTR CALLBACK DialogProc(HWND hWnd,
                            UINT uMsg,
                            WPARAM wParam,
                            LPARAM lParam)
{
        lock.LockObject();              // Далее нужно атомарное выполнение.
        MessageBoxA(NULL, "", "", MB_OK);               // При запуске программы, вылетает пачка сообщений (одновременно).
        lock.UnlockObject();    // Переводим в свободное состояние (критическая секция).

    return FALSE;
}
 

In the standard MC indicators, we added !IsStoped() in for.

for(int i=pos;i<rates_total && !IsStopped();i++)

Can you tell me why it's done, what is it for?

 
paladin800:

If the loop is long (or perpetual) how can it be interrupted without terminating the terminal process? When the user gave the command - to remove the script from the chart, the function will return true (false before this event). As a result, the conditions for subsequent iterations will not be met.

Ордерa, позиции и сделки в MetaTrader 5
Ордерa, позиции и сделки в MetaTrader 5
  • 2011.01.05
  • MetaQuotes Software Corp.
  • www.mql5.com
Надежный торговый робот не может быть создан без понимания механизмов работы торговой системы MetaTrader 5. Клиентский терминал получает от торгового сервера информацию о позициях, ордерах и сделках. Чтобы правильно обработать эти данные средствами MQL5 необходимо хорошо представлять как происходит взаимодействие mql5-программы и среды исполнения терминала.
 
220Volt:

If the loop is long (or perpetual) how can it be interrupted without terminating the terminal process? When the user gave the command - to remove the script from the chart, the function will return true (false before this event). As a result, the conditions for subsequent iterations will not be met.

Ok, it makes sense to me now. I just compared it to MQL4 and could not catch the difference.

Happy New Year!

 

Please help, send me an example of how to work withORDER_TIME_SPECIFIED, I can't make the expiry time of an order properly.

Here's a snippet of code

int need_year_AUDUSD=mqldt.year;
int need_mon_AUDUSD=mqldt.mon;
int need_day_AUDUSD=mqldt.day;
int need_hour_AUDUSD=mqldt.hour;
int need_min_AUDUSD=mqldt.min+15;
int need_sec_AUDUSD=mqldt.sec;
string need_year2_AUDUSD=IntegerToString(need_year_AUDUSD,0,' ');
string need_mon2_AUDUSD=IntegerToString(need_mon_AUDUSD,0,' ');
string need_day2_AUDUSD=IntegerToString(need_day_AUDUSD,0,' ');
string need_hour2_AUDUSD=IntegerToString(need_hour_AUDUSD,0,' ');
string need_min2_AUDUSD=IntegerToString(need_min_AUDUSD,0,' ');
string need_sec2_AUDUSD=IntegerToString(need_sec_AUDUSD,0,' ');
string date_AUDUSD=(need_year2_AUDUSD+".0"+need_mon2_AUDUSD+".0"+need_day2_AUDUSD+" "+need_hour2_AUDUSD+":"+need_min2_AUDUSD+":"+need_sec2_AUDUSD);
datetime b_AUDUSD=StringToTime(date_AUDUSD);


trade.BuyStop(0.1,SymbolInfoDouble(qwerty,SYMBOL_ASK)+D,qwerty,SymbolInfoDouble(qwerty,SYMBOL_ASK)+D-SL,SymbolInfoDouble(qwerty,SYMBOL_ASK)+D+TP,ORDER_TIME_SPECIFIED,b_AUDUSD);

it's all very crooked, i know, but i couldn't find an example at a certain time, had to do it myself, now it's getting annoying and cumbersome

Reason: