Forum

Close[], iClose() & live vs strategy tester.

Ok, I'm not sure if this is a dumb question or if it has been asked often, but here goes. In the Metatrader terminal program, you are given DIRE warnings when you download history data that it might not match that given by the broker. if you have a look in the folders there is a history/downloads

Detecting if an order is selected

#define ERR_NO_ORDER_SELECTED 4105 bool OrderIsSelected() { GetLastError (); OrderTicket(); return ( GetLastError ()!=ERR_NO_ORDER_SELECTED ); } after some trial and error, this seems to work. if you want to write a function for example called OrderCloseIfProfitable(), you