Forum

OrderClose() Error 4051

Hello. I get an "Invalid ticket for OrderClose() function" (error 4051) when I test my EA. Looking at the error codes I see that a parameter is invalid. Although I have a hunch it is OrderTicket() that is messing up, I have seen this parameter listed like it is in other codes. The OrderClose() code

Referencing the last three trades

Hello. I have most of my code down for my EA but I am uncertain as to how I can reference my last three trades. I need something to the effect of- if(conditions of last three trades are met) ...my code... else ...rest of code Im particularly interested in the "conditions of last three trades are