Errors, bugs, questions - page 1548

 
comp:
Then you can't interrupt the calculation by event.

ok. look the other way then.

You can artificially parallelise - by placing a second indicator on the chart.

And by accessing GlobalVariableSetOnCondition from both.

 
o_O:

ok. look the other way then.

You can artificially parallelise - by putting the second indicator on the chart.

And by accessing the GlobalVariableSetOnCondition from both.

I don't get it.
 
comp:
I don't get it.

The second indicator is a signaler that sends events from ChartEvent to the main indicator as a custom one + changes the state of global variable for example by the time in ms.

In the main indicator you catch this event and start the calculation, + look at the global variable to make sure that it has the same ms time as the one you started the calculation with.

If the time in it has changed, then a new event has arrived - and you break your current calculation.

like this.

---

Or you can simply change the ms in the gp at each chart event, and only control it in the main indicator

in general - the second indicator will parallelize

 

Hello! A little help for a newbie. I can't seem to get a handle on the OnBookEvent event.

If you call this event from onTick() , everything works. If onTick() is empty, then nothing works. I don't understand anything, OnBookEvent is called when there is a change in the glass, i.e. it is a separate event handler, essentially the same as onTick() is called when a tick occurs. Why doesn't it work?

This is how it works. Well, how it works, it prints "Anything" when a tick occurs, not when there is a change in the cup. For example, the volume of bids has changed, at a certain price, the OnBookEvent handler for the change in the cup should be called , but it doesn't happen. If onTick() is left empty, it won't even print anything.

int OnInit()

{

if ! MarketBookAdd("RTS-6.16" )

{

Print("Error ",GetLastError() );

}

else

{

Print("Done");

}

void OnDeinit(const int reason)

{

MarketBookRelease("RTS-6.16");

}

void OnTick()

{

OnBookEvent(_Symbol);

}

void OnBookEvent(const string &symbol)

{

MqlBookInfo book[];

MarketBookGet("RTS-6.16", book);

if(ArraySize(book) == 0)

{

printf("Failed load market book price. Reason: " + (string)GetLastError());

return;

}

Print("Anything");

}

 
Just tried it on other instruments and it all works!!!! How can this be? It only doesn't work on rts!!!
 
the problem is solved, it's working on its own!
 

Error in https://www.mql5.com/ru/docs/constants/structures/mqltraderequest help

SL & TP Modification

A trade order to modify StopLoss and/or TakeProfit levels. 4 fields are required:

-action

-symbol

-sl

-tp

-position

Added field position but the number of fields to be filled is still 4.
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура торгового запроса
Документация по MQL5: Стандартные константы, перечисления и структуры / Структуры данных / Структура торгового запроса
  • www.mql5.com
Стандартные константы, перечисления и структуры / Структуры данных / Структура торгового запроса - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Alexey Viktorov:

Error in the help https://www.mql5.com/ru/docs/constants/structures/mqltraderequest

Added field position but the number of fields to be filled in is still 4.
Alexey, it makes no sense to write here, you have to send a request to the servicedesk. At the same time there will be + to the rating )
 
Alexey Volchanskiy:
Alexey, there's no point in writing here, you have to send a request to Servisdek. At the same time it will be + to the rating )
I'm too old to chase the rating: )))) They won't fix it and don't need to.
 
o_O:

you put the second indicator a signaler that sends you to the main indicator as a custom event from ChartEvent + change the state of the global variable for example by the time in ms

In the main indicator you catch this event and start the calculation, + look at the global variable to make sure that it has the same ms time as the one you started the calculation with.

If the time in it has changed, then a new event has arrived - and you break your current calculation.

like this.

---

Or you can use the signaler to change ms in gp at every chart event, and only control it in the main indicator

in general - the second indicator will parallelize

Got it, thanks. Unfortunately, this solution will only work in an Expert Advisor (in which the calculation must be interrupted). It won't work in the indicator, because call of the indicator on the chart doesn't create a parallel chart queue, it joins not even a specific chart, but ALL the charts of this symbol.

How do I put the indicator as MQ5-resource instead of EX5-resource?

Reason: