Questions from Beginners MQL5 MT5 MetaTrader 5 - page 6

 
openlive:

made a working expert

But I can't test the Expert Advisor in the tester. The matter is that the Expert Advisor takes data from a csv file. I put it in the special folder of the tester. and instructions prescribed in the file of the expert that it refers to this directory.... but they couldn't help me at the time. But the idea to run it in the tester remains. help plz.

Look at tester_file and tester_library constants here: MQL5 Reference / Language Fundamentals / Preprocessor / Program Properties (#property)
 

There is a task - to mark the current price with any graphic icon, for example OBJ_ARROW_CHECK symbol in Expert Advisor. I've been reading the Help for about 3 hours and can't figure out how to do it all. I thought I could do with 2-3 lines of code, but I don't know what to do. I wrote it myself: - it does not work :(

void OnTick()
{
datetime CTime[1];
int=CopyTime(_Symbol,_Period,0,1,CTime);
MqlTick LPrice;
ObjectCreate(0, "BID",OBJ_ARROW_CHECK,0,CTime[0],LPrice.bid);

}

Help !

Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов - Документация по MQL5
 
Desead:

There is a task - to mark the current price with any graphic icon, for example OBJ_ARROW_CHECK symbol in Expert Advisor. I've been reading the Help for about 3 hours and can't figure out how to do it all. I thought I could do with 2-3 lines of code, but I don't know what to do. I wrote it myself: - it does not work :(

void OnTick()
{
datetime CTime[1];
int=CopyTime(_Symbol,_Period,0,1,CTime);
MqlTick LPrice;
ObjectCreate(0, "BID",OBJ_ARROW_CHECK,0,CTime[0],LPrice.bid);

}

Help !

void OnTick()
  {
   datetime CTime[1];
   int cop=CopyTime(_Symbol,_Period,0,1,CTime);
   MqlTick  LPrice;
   SymbolInfoTick(_Symbol,LPrice);
   ObjectCreate(0,"BID",OBJ_ARROW_CHECK,0,CTime[0],LPrice.bid);
  }
like this.
 
uncleVic:
Like this.

Right! I linked the LPrice variable to the MqlTick structure, but forgot to get the price.

Thank you very much!

Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура для получения текущих цен
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура для получения текущих цен
  • www.mql5.com
Стандартные константы, перечисления и структуры / Структуры данных / Структура для получения текущих цен - Документация по MQL5
 

Yesterday I wrote a simple EA to run in the optimiser to select the right period of a makdi indicator. It seems to be working, but it's a bit messy.

Help me to understand why such a difference in history and graphics ? (situation 1 and 2)

Why do i open buy positions that i have no in my EA at all?

Why many sell trades are opened, if i opened a sell position in my EA, then i don't reopen it ?

I probably got it wrong ?

Thanks in advance for the answers.

Files:
MACD_P.mq5  6 kb
 
Doesn't anyone know why there is such a difference between the chart and the log? In the end the result is the same - the entire chart is painted with arrows as if I was actively buying and selling, in the magazine tester is written 1 deal (this is correct), but when you close the tester and see all the statistics, it also says that there are 79 deals completely, etc. What the fuck, how to work ? why i can not make only 1 transaction ?
 
Desead:
Doesn't anyone know why there is such a difference between the chart and the log ? In the end the result is the same - the entire chart is riddled with arrows as if I was actively buying and selling. Tester's log says 1 deal (this is correct) but when I close the tester and look at all statistics it says 79 deals at all and so on. What the fuck, how to work ? why i can not make only 1 transaction ?

What can you talk about if you don't have any Print in your code?

First, try to find out where the unnecessary Byes are executed. And show the printout of their opening.

 
Why would I need a print when my EA is only allowed to make 1 trade and that's it ? Anyway, thanks for the reply and I just realized why this situation happens, I read all the help etc. and there's nothing written anywhere, and the answer was on the surface - it's just closing the day it turns out. I'm surprised though that the forum couldn't help with such a simple task.
 
Desead:
Why would I need a print when my EA is only allowed to make 1 trade and that's it ? Anyway, thanks for the reply and I just realized why this situation happens, I read all the help etc. and there's nothing written anywhere, and the answer was on the surface - it's just closing the day it turns out. Although I am surprised that the forum could not help with such a simple task.

And how can I help you if you haven't provided any log file or work report.

in which case the only place where you can get help is here

Клуб Телепатов - MQL4 форум
  • www.mql5.com
Клуб Телепатов - MQL4 форум
 

It says - 1 transaction and a screenshot, here you can see straight away that it is a swap, without reading the code.

Useful link by the way. Not critical at all, but is there the same for mql5 ?

Reason: