Articles by: David Williams

How To Close a Trade After 240 Seconds

Q: How can I close a buy trade after 240 seconds if it’s not over the first trailing step (60)?

A: I created a video to show you how this is done. Also, the system can be downloaded below.
A few notes:
The function “fnGetOrderInfo” is used to get almost any information about an open order, including the open time, and the amount of profit.
Most “times” in MQL are saved in seconds. TimeCurrent is in seconds and so it the OpenOrder time. So if we subtract TimeCurrent (right now) from when the time the order was opened, we’ll have the elapsed seconds since the order was opened:
TimeCurrent – OpenOrderTime = secondsElapsed

Watch the video here

Download the VTS System and EA here:

Click to download VtsPackageCloseOnProfit

 download-now

 

 

 

 

 

Need help with the downloaded file? http://www.iexpertadvisor.com/how-do-i-open-a-vts-zip-file/

To get notified about the latest questions and answers, follow us!

 

RAQ

Running VTS on Windows 10

Q: Does VTS run on Windows 10?


A: Yes, the only difference is the compiler used to convert the MQL code into an Expert Advisor.


Metatrader offers a 32-bit and 64-bit compiler. VTS ships with both versions. For a Windows 10 installation, set the compiler to mql64.exe


In VTS, under Tools-> Options->Platform, set the compiler to mql64.exe.



The file is at: C:\Program Files (x86)\iExpertAdvisor\Visual Trader Studio Connect\cfg\tools

 


 



To get notified about the latest questions and answers, follow us!



RAQ