gabrejos:
So... I writing expecting that someone could help me to add a code to open this orders ONLY if this pairs are not trading.
So... I writing expecting that someone could help me to add a code to open this orders ONLY if this pairs are not trading.
int GetOrderCount(){ int count=0; for(int iPos = OrdersTotal()-1; iPos >= 0 ; iPos--) if ( OrderSelect(iPos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == symbolChart // and my pair. ){ count++; } return (count); } int start(){ : if (GetOrderCount() != 0) return(0); :
WHRoeder:
gabrejos:
So... I writing expecting that someone could help me to add a code to open this orders ONLY if this pairs are not trading.
So... I writing expecting that someone could help me to add a code to open this orders ONLY if this pairs are not trading.
int GetOrderCount(){ int count=0; for(int iPos = OrdersTotal()-1; iPos >= 0 ; iPos--) if ( OrderSelect(iPos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == symbolChart // and my pair. ){ count++; } return (count); } int start(){ : if (GetOrderCount() != 0) return(0); :x
Thank you very much WHRoeder, I will try. But where have to insert it?
Sorry for mi ignorance.
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
Hello, I m be trading manual a system that could be profitable.
The system that I am trying to do (hedge) is open eurusd, gbpusd, usdchf and usdjpy (all BUY, and all 1 lot). When the sumatory of this 4 trades get a profit of 100 U$S, then I close all trades and re-open the same 4 trades.
I am using an e.a that close this orders when get the profit.
But I need another e.a (this) that open this 4 orders only when the other e.a close them.
I found this a script that could be program for open this 4 trades, and if I executed as an e.a, it open 4 trades once and again, and again, and again.
If I could add a code to open this trades only if there is no position open with each pair, I think that will work.
So... I writing expecting that someone could help me to add a code to open this orders ONLY if this pairs are not trading.
I m not speak english, and dont get a spanish book for programing mql4, so if anybody could help me, and the system works, we could have a nice profit.
Thank you very much, and sorry for my english.