Retrieve the Last Active Trade in MT5 with This Handy EA

Mike 2024.05.05 18:37 25 0 0
Attachments

Hey fellow traders! Today, let's dive into a nifty little tool for our MetaTrader 5 setup. This Expert Advisor (or EA, as we like to call it) features a code that’s super handy for developers and traders alike. Ever found yourself needing to pull up the last active trade? Well, this EA lets you do just that—and more!

When I say 'active trade,' I’m talking about market orders, not those pesky pending ones. If you want to fetch the most recent active trade, simply pass a 0 as an argument. But wait, there’s more! If you pass 1, you’ll get the trade right before the most recent one, and you can keep going back like that.

Plus, you’ve got some filtering options at your disposal. You can narrow down your search based on the trading symbol and the magic number, making it easier to find exactly what you need.


List
Comments 0