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
I've added this function on my pending orders assuming it would solve my problems but no, price does not close at my stop loss.
Please help if you know the problem
do a search of this website, there will be several threads discussing pending orders, and also the use of freeze level. I think that you will find that freeze level only applies to the opening price of a pending order.
i would also print the freezelevel and such info to journal when you create the pending order, so you can check if it is working as you want. including the trail stop step also. You may find that it is not working as you plan it to.Those are not assignments; they are initialization of a common (globally declared), or static variable(s) with a constant. They work exactly the same way in MT4/MT5/C/C++.
They are initialized once on program load.
They don't update unless you assign to them.
In C/C++ you can only initialize them with constants, and they default to zero. In MTx you should only initialize them with constants. There is no default in MT5, or MT4 with strict (which you should always use).
MT4/MT5 actually compiles with non-constants, but the order that they are initialized is unspecified and don't try to use any price (or indicator) or server related functions in OnInit (or on load or in OnTimer before you've received a tick), as there may be no connection/chart yet:
Unlike indicators, EAs are not reloaded on chart change, so you must reinitialize them, if necessary.
external static variable - MQL4 programming forum #2 (2013)
do a search of this website, there will be several threads discussing pending orders, and also the use of freeze level. I think that you will find that freeze level only applies to the opening price of a pending order.
i would also print the freezelevel and such info to journal when you create the pending order, so you can check if it is working as you want. including the trail stop step also. You may find that it is not working as you plan it to.I've done some research over the past few days & the only close solution I came across the information below and It still does not work.
I've done some research over the past few days & the only close solution I came across the information below and It still does not work.
I've read this thread, and I think that the concept that you're missing is:
[F]reeze level only applies to the opening price of a pending order (emphasis added).
It seems that you're trying to use stop level and freeze level to solve an execution price issue occurring upon automatic conversion of your stop order to a market order.
It also seems that you've verified that your broker-dealer is pretty much square, so: