Errors, bugs, questions - page 1548
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.
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.
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");
}
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
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, 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 )
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?