Finding the OrderType of the last closed trade - page 2

 
WHRoeder:
His function returns the last order type. If you need other information about the last order, or about the last N closed orders, then my code would be better: Could EA Really Live By Order_History Alone? - MQL4 forum




Above code provided worked great :) Thank you very much!
 
MisterDog:

Thanks for the push dabbler. Here is the code I came up with -- it seems to work. It was a good learning experience.

The Magic on && OrderMagicNumber() == Magic is not declared 
 
chalithuo: The Magic on && OrderMagicNumber() == Magic is not declared 

Assumed to be a global input variable. Corrections to posted code is left as an exercise for the reader.