[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 16

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
I will explain how to write MQL4 code in MQL4 Expert Advisor. An order is opened on zero bar, i.e. on the current bar. The indicators will close it on the signal on THIS current bar ( 0 ). I need them to close it in a new bar or in subsequent bars, BUT not this one where it opened. Thanks in advance.
Remember the time of the bar at which the order was opened and until the zero bar time has changed, do not take any action, something like this:
remember the time of the bar at which the order was opened and do not take any action until the time of the zero bar has changed, approximately like this:
Just what I need! Thank you Igor. I do not know yet what to do with the code.
Why such a negative response? A grown man... and no one has taught you respect in life?
That's the end of the despute. I treat my elders with respect, no matter how "rotten" they are.
Somebody answer me, this is the third time I've written.
How should we make the orders open and close at regular intervals during the whole week?
If we run the Expert Advisor in the middle of the week, the orders should also open in the same intervals with the start of counting from the beginning of the week.
At least give us some code or script for the example.
Somebody answer me, this is the third time I've written.
How should we make the orders open and close at regular intervals during the whole week?
If we run the Expert Advisor in the middle of the week, the orders should also open in the same intervals with the start of counting from the beginning of the week.
At least give us some code or script for the example.
Hm, ok.
I want for example in Mon an order was opened (no matter where, or any action happened simply), after, say, 9 hours the order was closed and a new one was opened, after another 9 hours the old one was closed and a new one was opened immediately and so it continued until the end of trading on Friday.
Everything will be restarted in Mon. If we launch the Expert Advisor on Wednesday, it will calculate these timeframes in 9 hours from the beginning of the week and make a deal again as soon as the next timeframe is reached. Here.
r.ig.h:
I want to open an order in Mon (no matter where, or any action occurred simply), after, say, 9 hours the order closed and opened a new one, after another 9 hours the old one closed and immediately opened a new one, and so it continued until the end of trading on Friday.
Everything will be restarted in Mon. If we launch the Expert Advisor on Wednesday, it will calculate these time slots in 9 hours from the beginning of the week and make a deal again as soon as the next time slot is reached. Here.
Don't you think it is nonsense?
No) But still, is it possible to write an algorithm on this nonsense?
Or is there still something unclear in the description?
No) But still, is it possible to write an algorithm on this nonsense?
Or is there something not clear in the description?
If they tell you to search the forum, will that make you feel better? ;)
As for the subject - if you need a clock, it is optimal to take the opening time of a bar and analyse the opening hour to make a decision,
you can use the tutorial https://book.mql4.com/ru/functions/datetime