Created
April 13, 2013 06:42
-
-
Save currencysecrets/5377351 to your computer and use it in GitHub Desktop.
This function returns the number of orders, both open or pending, for the currency and the type specified.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this function will return the quantity of orders (both open and pending) | |
// on the selected currency for the order type requested. | |
int getQtyOrders( int type, string sym ) { | |
int result = 0; | |
int tot = OrdersTotal(); | |
for ( int i = 0; i < tot; i++ ) { | |
if ( OrderSelect( i, SELECT_BY_POS, MODE_TRADES ) ) { | |
if ( OrderSymbol() == sym ) { | |
if ( OrderType() == type ) { | |
result += 1; | |
} | |
} | |
} | |
} | |
return( result ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment