Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1922

 
Vitaly Muzichenko #:

Clearly, you know better than 2,000 km away.

So does the rest of the world.

 
Vitaly Muzichenko #:

Comrade moderators, please give the user a chance, he didn't mean it.

And delete this message.

He'll be out in a week.

 

Hello!

I am a dummy in programming from the word out, but have ideas for a trading strategy (simple enough, no indicators, purely mathematical calculation).

Can you tell me whether it is possible to find someone who can write an EA for MT4 to test the strategy?

Thank you.

Sincerely.

 
Dmit_Rich write an EA for MT4 to test the strategy?

Thank you.

Sincerely.

There are two ways (in general you should write it somewhere large and attach it):

1) detailed and publicly state the idea on a forum in special threads or in your own thread, and it is as publicly implemented / supplemented / criticized

2) order it on a freelancer for a fee. Everything is private there, but for money

 
Maxim Kuznetsov #:

There are two ways (in fact, it needs to be written and attached somewhere):

1) you state the idea in detail and publicly on the forum in special branches or separately in your own and it is just as publicly implemented/added/critiqued

2) order it on a freelancer for a fee. Everything is private there, but for money

Got it. Thank you very much!
 

The question arose

Structure

MqlTick last_tick;



int OnInit()
  {
  MqlTick last_tick; // Получаю нули на ask bid, т.е. заполняется только на тике?
Ask=SymbolInfoDouble(Symbol,SYMBOL_ASK);        // Так работает
Ask=SymbolInfoDouble(Symbol(),SYMBOL_ASK);      // Почему ошибку скобок пишет?  Не догоняю. Примеры полностью идут без ошибок.  
....
}

void OnTick() 
  { 
   MqlTick last_tick; 
//--- 
   if(SymbolInfoTick(Symbol(),last_tick)) 
     { 
      Print(last_tick.time,": Bid = ",last_tick.bid, 
            " Ask = ",last_tick.ask,"  Volume = ",last_tick.volume); // здесь все заполняет
     } 
   else  
      Print("SymbolInfoTick() failed, error = ",GetLastError()); 
//--- 
  }
 
Valeriy Yastremskiy MqlTick last_tick;



Ask where is it announced?
 
Artyom Trishkin #:
Where is Ask declared?

Global.

In the global field MqlTick also announced

#define  Ask SymbolInfoDouble(Symbol,SYMBOL_ASK) // верный результат
#define  Ask last_tick.ask                       // возвращает ноль

MqlTick last_tick; 

int OnInit()
  {
 ......
else LevelPrice[NumberLevelsDoun]= Ask;         // Массив глобально объявлен
......

else LevelPrice[NumberLevelsDoun]= last_tick.ask;         // тоже ноль возвращает


}
Документация по MQL5: Константы, перечисления и структуры / Структуры данных / Структура для получения текущих цен
Документация по MQL5: Константы, перечисления и структуры / Структуры данных / Структура для получения текущих цен
  • www.mql5.com
Структура для получения текущих цен - Структуры данных - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Valeriy Yastremskiy #:

Global.

In the global scope MqlTick is also declared

Then another question: where is Symbol declared ?

About using structure - do you fill it somewhere with SymbolInfoTick() ? Or decided, that poltergeist will fill it for you? :)

 
Artyom Trishkin #:

Then another question: where is Symbol declared ?

About using structure - do you fill it somewhere with SymbolInfoTick() ? Or decided, that poltergeist will fill it for you? :)

(Thank you, I understand).

In general, you may write about filling it explicitly)))), but not like this

MqlTick

MqlTick variable allows you to receive values Ask, Bid, Last and Volume in one call to SymbolInfoTick() function.

Reason: