Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 556

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
Greetings!
I am trying to make my EA close trades on Friday half an hour before the session closes.
I tried the tutorial, but it did not work.
i can ask if anyone has a ready code.
I have the closing code. i need it to be able to close a session 30 minutes beforehand.
This may be more universal to any broker. Too bad there is no difference in broker quotes from UTC yet
I have this one working, no malfunctions.
tried it this way, tested it through a tester, then the function didn't work.
Well this should not work in the tester.
The functions are based on current time, and what I wrote above will work because TimeCurrent() and TimeDayOfWeek() work correctly. You only need to add function for switching to summer and winter time, i.e. parameter hrd. Switching usually takes place according to American DST time (first Sunday of November second Sunday of March), but some brokers do not make the switch, so you should use your
Greetings!
I am trying to make my EA close trades on Friday half an hour before the close of the session.
I tried the tutorial, but it did not work.
i can ask if anyone has a ready code.
I have the closing code. I need it to signal the closing of the session 30 minutes before.
Maybe like this.
Not like this at all.
We need to define the session closing time datenime SessionClose = . If not session close, but trade close, then SessionClose = StrToTime("23:30");
Define day of the week TimeDayOfWeek()
If Friday, check TimeCurrent() >= SessionClose
This is not the case at all.
We need to define session closing time datenime SessionClose = .... If not session close, but trade close, then SessionClose = StrToTime("23:30");
Define day of the week TimeDayOfWeek()
If Friday, check TimeCurrent() >= SessionClose
can you describe the code in more detail?
This is not the case at all.
We need to define session closing time datenime SessionClose = .... If it's not session closing, but trading, then SessionClose = StrToTime("23:30");
can you describe the code in more detail?
Yes, I can. But it goes against my principles.
session closing time datenime SessionClose = ... and bidding ... will not work in the tester no matter how you define it :) Check from the beginning of March to this day
I can. But it is against my principles.
What does the tester have to do with it? Although it did work in the tester until the latest updates. I won't argue now, I haven't tested it and won't be forced to turn on the tester any time soon.No objections to the principles, but the man wants to run the EA in the tester, so your options are not suitable for him.
Use my version, it will work in the real and in the tester, but until they made a feature to automatically account for the transition to winter summer time, define the transition time for this year like
From March 2013 to November 2014 will work and test correctly. Set the shift according to your brokerI have no objections to the principles, but the man wants to run the Expert Advisor in the tester, so your options do not suit him.
Use my variant, it will work both in real and in the tester, but until they have made a function to automatically account for daylight saving time, define the transition time for this year like
From March 2013 to November 2014 will work and tested correctly. Set the shift according to your brokerI will not look where it is written that the time is generated in the tester, you know it yourself. But in the help it specifically says that
Whereas it does not say anything specific about StringToTime().
The only thing to take into account is time on the tester (of the DC server). And accordingly when testing you should have a history of the same type of account on which this owl will work.