I use the following code with no issues ...
void LastClosedTrade(){ int cnt, total; total = OrdersHistoryTotal(); for(cnt=0;cnt<total; cnt++){ if(OrderSelect(cnt,SELECT_BY_POS,MODE_HISTORY)==true) if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC){ LastOrderType = OrderType(); LastOrderLots = OrderLots(); LastOrderProfit = OrderProfit(); } } }
Osama Shaban: I use the following code with no issues ...
|
|
Osama Shaban:
I use the following code with no issues ...
Thanks! I've tried using your code, however it doesn't work. Check out the EA I've attached. How to get it working?
I have a full account history with 1000s of orders. I just need the last order that returned in profit for current instrument.
Files:
sample.mq4
3 kb
Ive got it working, nm!
Thx all
nadiawicket:
Ive got it working, nm!
Thx all
Please post your solution!
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
This is the last step to getting my system going. Really need this solved.
Does not work at all.
Need to select last profit order of the account history tab for current chart symbol. Its eluding me. Thanks in advanced.
How to do this?? Heres the EA attached for quick reference. It just selects like a zillion apparently and it locks the thing up.. HELP