for (int i = 0; i < OrdersTotal(); i++) { OrderSelect (i, SELECT_BY_POS, MODE_TRADES); if (OrderSymbol() == Symbos() && OrderType() == OP_BUY) { //then do something } }
but BTW if u have only this 5 on this symbol it's supposed to be the first i (the first selecting order) on the sample above (SELECT_BY_POS)
double a = 1.39355; double b = 1.37566; double c = 1.41234; double smallest = MathMin(MathMin(a,b),c);
thank you very much sir, I'll study the code.
double lowest=99999; for(int pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() ){ // and period and symbol lowest = MathMin( lowest, OrderOpenPrice() ); }
Thank you Sir:
I had 3 buying order, My perpose is to select the lowest one, I used the code above, but it still show me all the 3 OrderOpenPrice,not the only lowest one,will you please help me to solve it?
2010.11.02 04:42:16 MyEa GBPJPY,M5: 129.203
2010.11.02 04:42:16 MyEa GBPJPY,M5: 129.207
2010.11.02 04:42:16 MyEa GBPJPY,M5: 129.236
my code didn't help
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
which one's price is the lowest one
I have bought 5 times,so I have 5 OP_BUY order, how to find out which order's open price is the lowest one?