suppose I want to close a trade in n bars (say n=5) if the price doesnt move at least 15 pips in my favor. How do I code that? I know for the trade entry price I use OrderOpenPrice() but how do I get the iClose for the next few bars? its because subsequent bars will constantly load up so I cant use iClose function with a fixed shift.
- wrong stop loss and take profit
- How to find the Bar Shift Of a Historical Bar
- Dumb question about iClose
1mathboy1:
suppose I want to close a trade in n bars (say n=5) if the price doesnt move at least 15 pips in my favor. How do I code that? I know for the trade entry price I use OrderOpenPrice() but how do I get the iClose for the next few bars? its because subsequent bars will constantly load up so I cant use iClose function with a fixed shift.
What does iClose() have to do with this ? Closing a trade when it is x bars old has been asked and answered at least once in the last 3 months, have a search for it . . . or just look at today's posts.
suppose I want to close a trade in n bars (say n=5) if the price doesnt move at least 15 pips in my favor. How do I code that? I know for the trade entry price I use OrderOpenPrice() but how do I get the iClose for the next few bars? its because subsequent bars will constantly load up so I cant use iClose function with a fixed shift.
takeprofit of 15, stoploss?.. and https://docs.mql4.com/series/iclose??.,,assuming you use a new bar verification , just count bars ,, then close trade(s).
afunction to give you exactly what you need sounds in order. not iclose since you just need close after x num of bars, nothing more.

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