| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Script vs EA for closing trades at end of week https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5151 |
Page 1 of 1 |
| Author: | dclayw [ Wed Apr 26, 2017 7:41 am ] |
| Post subject: | Script vs EA for closing trades at end of week |
I'm not all that familiar with Empty4 EA and script coding and inner workings and would appreciate some advice. I'm currently testing one of the dottybot versions. Due to weekend gap risk I won't hold trades over the weekend but I want to simulate that as best as possible. I would like to close all trades just before market close on Friday and re-enter selected trades on market open on Monday. This approach can essentially "hold" trades without taking on the weekend gap risk, at the expense of paying double brokerage etc. I can use Steve's Nuclear Script to close all trades but I would like an automated way to do it. The easiest way would be to automatically run the script at a certain day/time, is this possible? Another option would be to run the script as an EA and add timing functions so that trades are nuked at a certain day/time, but this seems overkill, having an EA running (and taking up resources) for the whole week just so that it's functions can be executed just one time. |
|
| Author: | dclayw [ Fri Apr 28, 2017 2:01 am ] |
| Post subject: | Script vs EA for closing trades at end of week |
OK I added timing functions to Steve's nuclear script (thanks for providing that script Steve) and converted it to an EA. It uses OnTick which is probably not terribly efficient way considering it will only run once/week. It works Ok and i will just fire it up on Friday evenings. |
|
| Author: | 1Direction [ Fri Apr 28, 2017 7:32 am ] |
| Post subject: | Script vs EA for closing trades at end of week |
Very interesting as I also experienced issues with market gaps, mostly over the weekend. Does your EA also re-open all closed trades when the market re-open after the weekend? |
|
| Author: | dclayw [ Fri Apr 28, 2017 8:33 am ] |
| Post subject: | Script vs EA for closing trades at end of week |
Nope, it doesn't do that. I expect that you might not want to re-open some of those trades either, depending on what happened over the weekend. Also, it's not my EA. All I did was modify Steve's Nuclear Option script by adding timing so that it will run at a certain day/time and made it run as an EA. That's it. This is what I intend doing (on D1 only). Close trades at say 23:00 (Global Prime server time) on Fridays. Manually re-enter selected trades on Monday open using Steve's Market Sell/Buy only scripts. Those trades will then be managed by whatever trade manager EA I'm running. What you're suggesting would be nice to have for sure but my coding skills are not up to that level atm. The criteria for deciding which trades to re-open might also be complex and different for each person so it's probably difficult to code something like that. |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|