Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!
Mohammad Velayati: it should wait … what should i do
- Use the code button.
- Code it to do what you want. Show us your attempt (using the CODE button) and state the nature of your problem. There are no mind readers here and our crystal balls are cracked.
if(Volume[0]<=1 && OrdersTotal()==0 )
For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart,) volume is unreliable (miss ticks,) Price is unreliable (duplicate prices and The == operand. - MQL4 and MetaTrader 4 - MQL4 programming forum.) Always use time.
I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
New candle - MQL4 and MetaTrader 4 - MQL4 programming forum-
Using OrdersTotal directly and/or no Magic number filtering on your
OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual
trading.)
Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 and MetaTrader 4 - MQL4 programming forum
MagicNumber: "Magic" Identifier of the Order - MQL4 Articles if(CandleStatus()=="Buy") int tiketbuy=OrderSend(…); int tiketbuy1=OrderSend(…);
Your if statement only applies to the first OrderSend, The other's are always done. Is that what you intended?
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 have an strategy that when it gets a signal it should open 5 buys with different sls and tps but it should wait until all of them being closed by hiting sl and tp and then open another 5 buy .
as i said i should wait until trade package close then open another 5 trade package
what should i do
here is a sample of my code