int count_order() { int count=0; int total=OrdersHistoryTotal(); for(int i=0;i<total;i++) { if(OrderSelect(i,SELECT_BY_POS, MODE_HISTORY)==true) { if(OrderSymbol()==Symbol()&& OrderMagicNumber()==Magic_Number) { count++; } } } return(count); }
Keith Watford:
Now its counting ALL BUY AND SELL. I want only get the BUY Orders and only SELL ORDERS
Raphael Schwietering:
Now its counting ALL BUY AND SELL. I want only get the BUY Orders and only SELL ORDERS
Wow! Then add an additional check for either buy or sell orders and count them. Use either Global variables or pass variables to the function.
Keith Watford:
Wow! Then add an additional check for either buy or sell orders and count them. Use either Global variables or pass variables to the function.
thanks now i have working it.
can you help me out how to get the profit of closed trades?i think there must be small changes
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
Hi,
i tried to count buy and sell orders of History of an magic number.
I tried this out but it seems that it is not working well.
in the ontick function i add this.
It looks like it is counting all of the history. With open and close.