Questions from Beginners MQL5 MT5 MetaTrader 5 - page 492

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
Is there any way to check if the opening scripts work at the weekend?
Only the indicator handles all ticks in OnCalculate(). Without any skips.
Uh, no. And he misses. But less than others. But it skips.
That's good, thank you.
Another question:
OrderSelect
Selects an order for further work with it. Returns true on successful completion of the function. Returns false if the function fails. You need to call theGetLastError() function to get information about the error.
TheOrderSelect(
ulong ticket// Ticket the order
);
Parameters
ticket
[The ticket of the order.
How is this ticket assigned? Where can I get it? Or how do I set it up?
OrderGetTicket
Returns the ticket of the corresponding order and automatically selects the order for further manipulation using functions. We have to look through all of the orders by index and get a ticket, if necessary. Although this function will also select the order itself. The ticket is set by the broker, and we can't change it.
Hello all!
I have written a function, which should draw "non-trading time zone" on the chart every day.
But here is a problem - when I start it, the module OnInit, draws as it should be but when I trigger it in the module OnTimer for some unknown reason the variable date keeps values which were assigned in the module OnInit.
Question: Why?
Hello all!
I've written a function which should draw a "non-trading time zone" on a chart every day.
But there is a problem - when executed in module OnInit it draws the date as it should be but when executed in module OnTimer for some unknown reason the date variable keeps the values which were assigned in module OnInit.
Question: Why?
Forum on trading, automated trading systems and strategy testing
Bugs, bugs, questions
Karputov Vladimir, 2016.01.09 20:51
What makes you think that in the timer variable date is passed the value previously defined in OnInit()?
You need to look at your function that draws the zone.
Completed:
Correctly would be OnTimer, not onTimer.
Forum on trading, automated trading systems and trading strategy testing
Bugs, bugs, questions
INGFX, 2016.01.09 21:20
Because A) I see visually, the "time zone" is not drawn today from 21:00 to 23:59, but from yesterday 21:00 to today 23:59
B) If I open the properties of the graphical object (shaded rectangle - "time zone"), I see that the first variable has not changed, i.e. it has the same value as yesterday's 21:00
Yes OnTimer, made a mistake when rewritten here ... the code itself is correct
You would have checked your code. Tired of stitching together your bits and pieces - so here, check code. In OnTimer substitute your local time and compare prints at initialization and in timer:
You would have checked your code.
Vladimir, thank you for your patience and help!
Really made a mistake in the code ...
I'll be more careful from now on.