-
Play videoPlease edit your post.
For large amounts of code, attach it.
pBid=MarketInfo(OrderSymbol(), MODE_BID);
Why use a function call when you can just use the predefined Bid?- Check your return codes and find out why.
What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
- Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it.
It's use is always wrong
- SL/TP (stops) need to be normalized to tick size (not Point.) (On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 forum) and abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 forum
- Open price for pending orders need to be adjusted. On Currencies, Point == TickSize, so you will get the same answer, but it won't work on Metals. So do it right: Trailing Bar Entry EA - MQL4 forum or Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 forum
- Lot size must also be adjusted to a multiple of LotStep. If that is not a power of 1/10 then NormalizeDouble is wrong. Do it right.
Hi WHRoeder,
Thank you for your quick reply. I have edited my above post as you requested and used SRC.
I`m starting to study in order to implement your hints.
I will make an update soon.
Kind regards,
Chris
Spent hours to solve the case, tried hunders of combinations, however with no result.
My knowledge seems insufficient in regards to mql4 coding.
I thought I could figure it out like I do it for excel macros, but it is more difficult.
I will post this on mql4 job site.
Thank once again.
I consider this trad closed.
Kind regards,
Chris
1) make it a habit to count down open orders!
// failes if you close orders: for(i=0; i<OrdersTotal(); i++){ // Cycle searching in orders for(i=OrdersTotal()-1; i>=0; i--){ // Cycle searching in orders
2) Your code is - for me - quite confusing. Keep OrderSelect() in the same loop you cont down the OrdersTotal-loop.
Hi gooly,
Yes, that code can be confusing, with no doubt :)
I`m not a developer, just mixed two EAs and adjusted some part of code found on the net in most logical way for the guy with no mql4 knowledge.
Just posted above on mql5 job site. Raul agreed to work on it with me.
Thanks for your help.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi All,
I wanted to create an EA that would open a trade at specific date and time. I also wanted to add Trailing Stop to it. I made a research on this forum and did not find ready solution. So I tried to mix some EAs. Som efeuterues added correctly. However I have a problem with Trailing Stop that activates after take profit is reached.
EAs that I used:
1. Time Trader - https://www.mql5.com/en/code/10822
2. eTrailing - https://www.mql5.com/ru/code/7778
My changed code:
Could you please point me in the right direction how to fix it and enable Trailing Stop?
Kind regards,
Chris