Please edit your post and
use the code button (Alt+S) when pasting code
I know that it is not obvious, but topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
Keith Watford:
Please edit your post and
use the code button (Alt+S) when pasting code
I know that it is not obvious, but topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
thank you for the help Keith
nicholas herrera: a close order immediately as it takes the current close price and not the actual close price. How do i get around this?
You don't.
- You can only close at the current market price.
- It is impossible to know the current candle close price, because it is impossible to know when a candle will close. A candle is closed when a tick arrives after the last possible second and a new candle is opened..
William Roeder:
Ok so how would I be able to compare its datetime to until it changes? Or would it be better to use a bar count and when that changes, exit the trade?
You don't.
- You can only close at the current market price.
- It is impossible to know the current candle close price, because it is impossible to know when a candle will close. A candle is closed when a tick arrives after the last possible second and a new candle is opened..
nicholas herrera: Ok so how would I be able to compare its datetime to until it changes? Or would it be better to use a bar count and when that changes, exit the trade?
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 programming forum.) Always use time.
New candle - MQL4 programming forum #3 2014.04.04
I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
Running EA once at the start of each bar - MQL4 programming forum 2011.05.06
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 am looking to close a trade that i am in for the duration of 1 bar based on the prev 2 bars. if the parameters fit i enter a trade, but when i set my takeprofit to the close of the current bar it will look to execute a close order immediately as it takes the current close price and not the actual close price. How do i get around this?