Trailing Stop problem
-
hi, how can i prevent the trailing stop function to change tp if the tp level does not meet the minimum level. i set the stop level to not move back, but this problem will always cause the tp level to move up when price move up for a buy preventing it from closing unless its a fast price movement.
http://snag.gy/fo5PP.jpg
if this happens, i want it to not change the value instead of choosing the minimum
also, where is the custom block guide url. i cant seem to find a documentation for the custom block creator. i remember seeing once somewhere. -
What is this, MQL4 or MQL5, Trailing Stop for SL or TP? I am playing with "Opposite stop... " options for MQL4, but I have another problem - my TP it not even modified when I used Fixed settings

It looks that I am too lazy to update this information. Something is wrong for me, there are important things that I must do and I don't want to do them

-
It's for mql4. It happens for both. I'm using custom level.
-
I think i currently resolved this issue for my purpose by using a custom code to check for the min stop level to not be exceeded by my own tp level before allowing the trailing stop block to run but i would prefer the trailing stop block function to just not do anything if the min stop level is not reached rather than it changing the take profit levels.
also, is it possible for you to create a breakeven point for group of trades like what you did for each trade? -
Can you give me some simple EA with settings that will cause the problem here in my MT4? I don't understand what is the problem exactly, because from what I tried - everything works.
Isn't it possible with some settings to make this break-even behaviour. What if Start plays the role of the target price, Stop is the same as Start (or smaller) and Step is some big value that will never be reached.
-
By the way I wrote here some explanation of how to make custom blocks topic/3375
-
I extracted the portion of my code that deals with the trail stop in project ID mt4-1063.
The issue i was having was due to this portion of code in the trailing stop functionelse if ((bs>0 && tp<tplimit) || (bs<0 && tp>tplimit)) { if (USE_VIRTUAL_STOPS) { return(tp); } Print( "Warning: Too short TP requested (", DoubleToStr(tp,digits), " or ", DoubleToStr(MathAbs(tp-askbid)/point,0), " points), minimum will be taken (", DoubleToStr(tplimit,digits), " or ", DoubleToStr(MathAbs(askbid-tplimit)/point,0), " points)" ); tp=tplimit; return(tp); }if this is run in live mode, the trail stop function will sometimes change the tplevel i set to the tplimit which is above the tp level i set. i.e, for a buy order, the tp level i set will move up for each incoming new tick that moves less than the min stop level. This sometimes result in the trade unable to close for an otherwise profitable trade.
Thanks for the explanation on the custom block. i will take a look at it.
-
It looks that I need to investigate "Trailing stop (group of trades)", I need to add some more checks before trying to modify SL/TP of any trade
-
Ok, I made some changes, is it ok now?