I'm pretty certain the answer is no, since the reference specifies order property operation types are for the OrderSend() function, but I was wondering if you can select a closed order using the OrderSelect() function (MODE_HISTORY), then get a return value of the order operation type using OrderType(). Basically what i'm asking is: does the closed order retain the OrderType() value it had when it was still open/in the market (either a 0 or a 1), or does that get "wiped out" once the order is closed?
- [ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3.
- need help with OrderType command
- How can i know if order is open or close ?
Of course, you can.
Erik Volk #:
Thanks! So orders retain their operational value (0 or 1) even after the order is no longer in the market?
If you really wanna be sure, just code a simple program and Print() your Values.
void OnTick() { //- Previous Count Memory & New Count static int Ticket = 0; static int OrdersTotalPrevious = 0; int OrdersTotalCurrent = OrdersTotal(); //- Send Test Order if(OrdersTotalCurrent == 0){ Ticket = OrderSend(_Symbol,OP_BUY,0.02,Ask,30,Ask - 0.0005, Ask + 0.0005,"TEST",0,0,clrNONE); if(Ticket <= 0) { Print("Could not send Order."); } } //- Compare Previous Count to New Count if(OrdersTotalCurrent < OrdersTotalPrevious) { //- Print Out Value to Answer your Question if(OrderSelect(Ticket,SELECT_BY_TICKET)){ int Type = OrderType(); Print("Closed Ticket Type: ",(string)Type); ExpertRemove(); } } //- Save Count for Next Event OrdersTotalPrevious = OrdersTotalCurrent; }
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