Hello MQL5 Community,
I am currently developing an EA based on two MAs and CCI Cross conditions.
I'd like to implement a time-based trading strategy and would appreciate your assistance.
As I am in the process of learning coding. I've received helpful advice from the community as well as materials to work through as I go.
My plan is to create a time function similar to the one in the attached sample file, which I acquired from "GitHub." I have added a bit of information to it as an idea of what I would like.
The highlighted section would be my additional check from the variables section.
Example:
if(Hour() == StartHour) {
if(IsFirstTick == true) {
IsFirstTick = false;
And my entry time condition:
if(Open[0] < Open[StartHour] - MinPipLimit*vPoint) {
//check ma
if(Close[0] > maCross || MAFilter == false)
The opposite will apply for the sell condition as well, and with the "if (IsFirstTick == true"). I will be using the "OpenBar" instead.
I currently get two return errors of which I have tried numerous times to resolve with no success.
1a. Alert("Parameters incorrect"); return (INIT_PARAMETERS_INCORRECT); and the other at
2b. return (INIT_SUCCEEDED);
The OnInit() function in which you have placed this code has return type "void" - usually it should be "int OnInit()"
Hello MQL5 Community,
I am currently developing an EA based on two MAs and CCI Cross conditions.
I'd like to implement a time-based trading strategy and would appreciate your assistance.
As I am in the process of learning coding. I've received helpful advice from the community as well as materials to work through as I go.
My plan is to create a time function similar to the one in the attached sample file, which I acquired from "GitHub." I have added a bit of information to it as an idea of what I would like.
The highlighted section would be my additional check from the variables section.
Example:
if(Hour() == StartHour) {
if(IsFirstTick == true) {
IsFirstTick = false;
And my entry time condition:
if(Open[0] < Open[StartHour] - MinPipLimit*vPoint) {
//check ma
if(Close[0] > maCross || MAFilter == false)
The opposite will apply for the sell condition as well, and with the "if (IsFirstTick == true"). I will be using the "OpenBar" instead.