Last active
June 25, 2017 13:22
-
-
Save currencysecrets/6543381 to your computer and use it in GitHub Desktop.
Automated Trading - Framework.
I'm finding through continued automated MetaTrader 4 system programming that my expert advisors are taking the same form and shape.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INIT | |
---- | |
| | |
|_ remove pending orders | |
| | | |
| |_ error alert | |
| | |
|_ reset charts | |
|_ reset global variables | |
START | |
----- | |
| | | |
| |_ process every tick | |
| | | |
| |_ check open trades | |
| | | |
| |_ manage trailing stops | |
| | | |
| |_ error alert | |
| | |
| | |
|_ process every nth-bar (period) | |
| | |
|_ check entry gates | |
| | | |
| |_ pre-trade | |
| | | | |
| | |_ check existing trades | |
| | |_ check existing orders | |
| | |_ check portfolio drawdown | |
| | | |
| |_ money management | |
| | | | |
| | |_ calculate initial stop loss | |
| | |_ calculate expiry time | |
| | |_ calculate position size | |
| | | | |
| | |_ check margin / cash available | |
| | | |
| |_ pre-order | |
| | | | |
| | |_ check order distance from market (for stop entry orders) | |
| | | | | |
| | | |_ if too close, change order to an "at market" order | |
| | | | |
| | |_ check global switch (has previous tick been here?) | |
| | |_ check if trade context is free | |
| | | |
| |_ order placement | |
| | | |
| |_ error alert | |
| | |
|_ reporting (email) | |
| | |
|_ open trades | |
|_ closed trades | |
DEINIT | |
------ | |
| | |
|_ error alert | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment