You wouldn’t do that on a real account but we need some positions that we can close and afterwards we want to call the function check close timer that doesn’t exist so far so we need to create it now. Now you can delete everything above the on tick function and let’s also remove the two comment lines here.įirst, we want to check if we have open positions that is done by using orders total and if the return value is zero we don’t have any open positions and in that case, we are going to open some test positions here. To get started please click on a little button here or press F4 on your keyboard, now you should see the Metaeditor window and here you want to click on file, new file, expert advisor from template, continue, I will call this file simple close timer, click on continue, continue and finish. In this video we are going to create an expert advisor that is able to close positions that are not profitable after some time has passed, in our case after an hour so if we have no profit we should see that the position is closed, so let’s find out how to code that with mql4. Copy and paste this HTML code into your webpage to embed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |