Attachment:
global.jpg [ 108.89 KiB | Viewed 65544 times ]
Attachment:
int start().jpg [ 93.48 KiB | Viewed 65539 times ]
Attachment:
conditions.jpg [ 179.79 KiB | Viewed 65514 times ]
2 things: Note that I used TimeCurrent in lieu of curTime. The MT4 build I have no longer recognizes curTime. And the compound if statement was killing me--something with the brackets I guess... so I simply added the time filter as another trading condition. This may use slightly more CPU resources because MT4 will run through 3 conditions instead of merely checking a an if first.
On a general note... When you copy this stuff, don't just paste it. Editing code is rarely this easy. Punctuation marks are almost always interrupted when you insert new code. Once you learn the meaning of the various punctuation marks, this becomes more apparent. For each left parenthesis, there is a right parentheses. For each left bracket, there is a right bracket. And there are compound sets of these--a left and a right within another left and another right... within another left and another right, and so on. Count up the sets to determine the code they are capturing. Then you can identify the groups of code, and see where to insert your new code without creating havoc. I emphasize this because my screenshots are cut off on the right side. With a straight copy and paste, you are bound to wind up with an extra ) } or ; which will throw compilation errors.
The first 2 screenshots are self explanatory. In the 3rd, my highlighted code already contains the end-of-group punctuation--so use your own full MACD-EA2 code to see which punctuation needs to be deleted from the end of the line immediately preceding each new insertion (this is no longer the end of the group).
This is not tested, so test and go from there.