Odd Behavior With Quik Trailing trade manager EA

 

Hi, All

I've got a few quibbles with the latest version of MT4 and wonder if anyone else has seen similar things. One thing that bugs me is that with the 500 - 509 releases of MT4 the ability to modify stops and take profit levels appears to have undergone a radical change. I've seen others voice this but saw no answers. My quibble with this is that with the new releases you are forced to place stops and take profits anywhere from 40 to 70 pips from the current market price. In addition, once you have stops and TPs set, you can't change them. I use the QT trade manager I mentioned in the subject which allows you(or used to) double click on a stop or TP line and drag it elsewhere if you wanted to change it. The first thing that happens and never used to before is that you get the Modify/Close dialog thrown up. You never seem to be able to reliably actually change the level, though. With FXCM you can sometimes get it to work but with Alpari, it always acts like it's changed it but then puts the value(s) right where you had originally set them. A couple other odd things happen, also. Using QT I can initially set the levels where I want them but if I don't use it, I'm blocked by the level limits and can't put them where I want them. I also use a Break Even, First Take Profit and Trailing Stop that are set through the EA. the EA is allowed to set a value for, say, the pips to lock in on Break Even and MT4 is cool with. If I try to manually move my stop to the Break Even point, MT4 won't let me.

Another strange thing has happened. Until yesterday everything worked right. The initial level values were set correctly by the EA, the Trailing Stop also worked correctly, the Break Even worked correctly and the First Take Profit also worked correctly. Yesterday, for no apparent reason, the First Take Profit stopped working but everything else is still working fine. The weirdness began with MT4 500 and I first thought that perhaps something had changed and was clashing with the EA. The differences in behavior of the FXCM platform and the Alpari platform are also puzzling. After seeing others complain about similar user unfriendly behavior I've begun to think that maybe it isn't a clash with my EA after all. I should mention that I'm a professional Software Engineer(though I don't do any MQL programming at the moment) so running into a clash between an EA written against pre-500 versions of MT4 and 500 and post-500 versions wouldn't surprise me. I doubt this matters but for completeness' sake, I'm running Windows 7 64 bit.

I understand how the EA is coded but I can't legally provide the code since I didn't write the EA. I have gone through it, though, and the logic is correct. Has anyone run into situations like I've described and have any idea of what to do about it? The First Take Profit suddenly deciding to roll over and die has me completely bumfuzzled. If anybody has any knowledge to share, I'd greatly appreciate it.

Thanks,

Jeff

 
ProfessorMetal :

Hi, All

I've got a few quibbles with the latest version of MT4 and wonder if anyone else has seen similar things. One thing that bugs me is that with the 500 - 509 releases of MT4 the ability to modify stops and take profit levels appears to have undergone a radical change. I've seen others voice this but saw no answers. My quibble with this is that with the new releases you are forced to place stops and take profits anywhere from 40 to 70 pips from the current market price. In addition, once you have stops and TPs set, you can't change them. I use the QT trade manager I mentioned in the subject which allows you(or used to) double click on a stop or TP line and drag it . . . .

You are probably trying to modify your trade in such a way that it does not comply with the STOP or FREEZE levels . . . read and understand this article: Requirements and Limitations in Making Trades
 

Hi, Raptor

Thanks for the reply. I did a shutdown and restart of MT4 and my First Take Profit started working again. I suspect MT4 has a memory leak that caused the problem. I've seen memory leaks cause funky things to happen in apps many times over the years.


I understand the behavior of Stop and Limit orders, as well as the relationship of Stop Loss and Take Profit levels to pricing when placing an order - to a point. E. g., I can get away with modifying an order that I'm told the StopLevel is 50 pips to have a TakeProfit of 25 pips. Is the StopLevel established by the number of pips I specify for StopLoss when I initially place a trade? It seems like I can modify the TakeProfit all over the place but I'm stuck with initial StopLoss until my EA modifies it. E.g., I set the stop loss to 100 pips initially, then tried to modify it to 75 pips. The Modify/Delete dialog said I had to set it a minimum of 50 points from the current market price so I used 750 points to get 75 pips. It changed the SL and in about a second reverted it back to 100 pips. There's something here I don't understand.

The FreezeLevel stuff makes even less sense. I assume that FreezeLevel is the number you're quoted on the Delete/Modify dialog if you want to modify an order, i.e. "You must set SL or TP at least 50 pips away from the current market price". I don't really understand the why of such a limitation. That could force you into taking a huge financial loss. The pre-500 builds of MT4 didn't force that but the newer ones do. Am I understanding what the FreezeLevel means? The document doesn't define it and I can't find a definition for it anywhere on the site.

Some of what the description in the FreezeLevel section of the document says only makes. E.g., the setting of SL or TP values. With a Buy trade as an example, trying to put a TP value between the bid and the SL wouldn't make even the least bit of sense. Ditto, trying to place a SL between the bid and TP values. There are some things that do have me scratching my head, though. One concerns BreakEven and TrailingStops. If I want to, say, lock in 2 pips profit if the trade reaches 10 pips profit all I have to do is set the parameters in the EA and it successfully modifies the order. If I try to do it manually, the FreezeLevel stuff apparently kicks in whether I use the EA's drag and drop or use MT4's Delete/Modify dialog and immediately puts my SL back where I originally had it.

Things that seem to be at odds with the document's FreezeLevel rules are my First Take Profit as well as using a Trailing stop. With the FTP, if the FreezeLevel is 50 pips how does the EA get away with closing out half the position at 25 pips or I, for that matter, get away with closing a trade manually if it goes against me but has not passed the FreezeLevel or I manually close a trade that's in profit but hasn't reached the FreezeLevel yet. The same ideas apply to a Trailing Stop. If my BE is set to lock in 2 pips and I set it to start trailing at 12 pips and trail 1 pip for each pip increase, how do those modify orders get executed? The same question applies to the price dropping and hitting the level the TS has moved the Stop Loss to. How is the order being closed? It would seem to be a violation of the Freeze rules. Does MT4 not see these modifications as StopLoss and TakeProfit values? Or maybe I should be calling them Stop orders? Obviously, once again, I'm misunderstanding something.

I hope I'm not being a pain here but I'm trying to get my head wrapped around the behavior I'm seeing so that I don't accidentally shoot my foot off because I misunderstood something about the way the platform works. Another thing I'm wondering about is are these MT4 rules or are they broker specific - the FreezeLevel stuff, I mean.

Thanks for the info. BTW, I make my living as a freelance Software Developer and plan to add MQL apps to my arsenal so I really want to understand the functioning of MetaTrader so I can put out good apps instead of junk that only half works.

 

I'm stuck with initial StopLoss until my EA modifies it. you wrote

Looks like if your EA you have also is place the stoploss setting to the settings it has code inside it

if you try to change trades of this EA manually or with other trademanager

the EA will replace the trade to its own

remove the EA from chart and try again

might be it will not happen what you have now

 
ProfessorMetal :


I hope I'm not being a pain here but I'm trying to get my head wrapped around the behavior I'm seeing so that I don't accidentally shoot my foot off because I misunderstood something about the way the platform works. Another thing I'm wondering about is are these MT4 rules or are they broker specific - the FreezeLevel stuff, I mean.

Thanks for the info.

FREEZELEVEL and STOPLEVEL are set by your Broker individually for each symbol, they have been around for a long time and are nothing new for recent builds.

What you are seeing as "You must set SL or TP at least 50 pips away from the current market price" is, I think, the STOPLEVEL of 50 points, verify this with a simple script that prints/comments the MODE_STOPLEVEL

You should determine what the STOPLEVEL and FREEZELEVEL are in your code and validate modifications to orders before attempting them, you get theses levels using MarketInfo() with MODE_FREEZELEVEL & MODE_STOPLEVEL

 

Hi, deVries

Thanks for the reply. As you can see from my original post, I'm suspicious of a clash between the EA and MetaTrader. However, none of this happened before I updated to the 500 build of MT4. There may be some miscoding in the EA that earlier builds of MT4 let slide and the current builds won't. I have a feeling that I'm going to have to break down and learn MQL and code my own trade management EA. I've been meaning to do that, I just haven't had time.

Have a good one,

Jeff

 
RaptorUK :

FREEZELEVEL and STOPLEVEL are set by your Broker individually for each symbol, they have been around for a long time and are nothing new for recent builds.

What you are seeing as "You must set SL or TP at least 50 pips away from the current market price" is, I think, the STOPLEVEL of 50 points, verify this with a simple script that prints/comments the MODE_STOPLEVEL

You should determine what the STOPLEVEL and FREEZELEVEL are in your code and validate modifications to orders before attempting them, you get theses levels using MarketInfo() with MODE_FREEZELEVEL & MODE_STOPLEVEL


Thanks again, Raptor. I suspected that it was broker specific.

Like I told deVries, I'm going to have to break down and code my own EA, I think. I can't modify the one I have because I don't have the rights to it but I've got in mind something that includes money management capabilities and potentially a few other things in addition to what this one does. I like the convenience of having my strategy preset and just needing to watch for what I perceive as a high probability trade, place the order and let the EA execute my plan instead of me having to babysit it. I don't trust any automatic trading bots - in my opinion, they're only function is to make the vendor a lot of money preying on the gullible while smoking their trading accounts. A trade manager that will manage a trade the way I would if I were sitting there babysitting it is a horse of a different color. I'm not always right in my decisions, unfortunately, but I still trust me more than I do some huckster's Magic Millionaire Maker Black Box. :-)

BTW, your suggestions give me a good starting point for putting together something simple to get me going on the road to learning MQL. Many thanks for your advice and gentle prods in the right direction.

Later,

Jeff

 
ProfessorMetal :

Thanks again, Raptor. I suspected that it was broker specific.

Like I told deVries, I'm going to have to break down and code my own EA, I think. I can't modify the one I have because I don't have the rights to it but I've got in mind something that includes money management capabilities and potentially a few other things in addition to what this one does. I like the convenience of having my strategy preset and just needing to watch for what I perceive as a high probability trade, place the order and let the EA execute my plan instead of me having to babysit it. I don't trust any automatic trading bots - in my opinion, they're only function is to make the vendor a lot of money preying on the gullible while smoking their trading accounts. A trade manager that will manage a trade the way I would if I were sitting there babysitting it is a horse of a different color. I'm not always right in my decisions, unfortunately, but I still trust me more than I do some huckster's Magic Millionaire Maker Black Box. :-)

BTW, your suggestions give me a good starting point for putting together something simple to get me going on the road to learning MQL. Many thanks for your advice and gentle prods in the right direction.

You are welcome, it's a good idea to have control of the code you are using if you have the time inclination and ability. If you need help with any of your coding please feel free to ask.
 
RaptorUK :
You are welcome, it's a good idea to have control of the code you are using if you have the time inclination and ability. If you need help with any of your coding please feel free to ask.


Will do. Thanks again, Raptor. I've been in software development professionally since 2000 so my biggest challenge will be learning MQL itself - along with making sure that I understand MT4's functionality. I'll likely have some questions along the way.

Have a great weekend,

Jeff
Reason: