You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
How can I sort open time of Orders descending or ascending in my code:
Ticket open price open time symbol
40739542 9844.79 2016.05.18 11:50:27
48327797 10280.5 2016.10.04 20:43:05 DAX30
40739556 15.882 2016.05.18 11:50:44 DTEDE
40739557 15.908 2016.05.18 11:50:44 DTEDE
48328053 1.12427 2016.10.04 20:46:33 EURUSD
40739708 125.337 2016.05.18 11:53:21 VOWDE
void OnStart()
{
//---
int handle=FileOpen("OrdersReport.csv",FILE_WRITE|FILE_CSV,"\t");
if(handle<0) return(0);
// write header
FileWrite(handle,"#","open price","open time","symbol");
int total=OrdersTotal();
// write open orders
for(int pos=0;pos<total;pos++)
{
if(OrderSelect(pos,SELECT_BY_POS)==false) continue;
FileWrite(handle,OrderTicket(),OrderOpenPrice(),OrderOpenTime(),OrderSymbol());
}
FileClose(handle);
}