Can you give an example of when it's not working? I'm running it here and it looks like it's doing what you're after, but I don't really understand your description of the problem.
The best way to check something like this is to add a print statement of the values then run a back test in slowed visualisation mode, open the journal page and just watch what is happening compared to the values from the Print statement. For instance I added
Print("PrevPivot=" + PrevPivot + ",PrevClose=" + iClose(NULL,0,1) + ",CurrOpen=" + iOpen(NULL,0,0));
Just under //*****Trade Order Functions, and of course turn off the printing of "shit" in your indicator as these make reading the journal very difficult.
Anyway if you can post a screenshot of a backtest when your EA didn't trade but should of I'll see what I can do...
I am still new to programming and I just can not get a handle of what is going on with this EA. I still need to add some filters, but the EA currently does not put orders in correctly.
Simply, I would like to place an order if the close of the previous bar and the open of the current bar is above the PrevPivot. And Visa-versa for a sell order.
Now the EA seems to only trade when the Value of the PrePivot changes day to day. But not during the day. Now I checked the Data window and the PrePivot buffer shows the value throughout the day. But for some reason it just doesnt work for me. Can someone please take a look at this for me.
Hello,
The EA comes from this thread: https://www.mql5.com/en/forum/177482.
Maybe inside that you could find what you need.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use