Forum on trading, automated trading systems and testing trading strategies
Hello,
Please EDIT your post and use the SRC button when you post code.
Thank you.
Since you are new, answering your question won't solve anything because you will not understand it due to the lack of basic framework.
So, I suggest you first invest some time in researching and learning the basics of MQL and how it all works.
Consult the documentation and study the many examples that are available in the CodeBase
Also, if you are just starting, I suggest you go straight to MQL5 instead of MQL4 (since development on that platform has been halted).
if(DayOfWeek()==1 //monday { // Place Buy Order }
sorry im new to mql
DayOfWeek
Returns the current zero-based day of the week (0-Sunday,1,2,3,4,5,6) of the last known server time.
int DayOfWeek(); |
Returned value
Current zero-based day of the week (0-Sunday,1,2,3,4,5,6).
Note
At the testing, the last known server time is modelled.
Example:
// do not work on holidays. |
if(DayOfWeek()==1 //monday
Don't hard code constants, use the proper enumerations
if(DayOfWeek() == MONDAY) { // Place Buy Order }
You will also need to make provision in your code so that once an order has been opened, the EA will not open additional orders on that same monday.
Thank you very much and yes I already ordered some books on amazon about MQL 4 and MQL 5 - but there is actually not a big difference or? I mean the code still looks similar.
The only Problem I have is that I want to close the order the next day.
So everytime a order is opened at Monday, it should close the order on the next day (Tuesday)
Is there a similar code snippet ?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
sorry im new to mql