fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Trailing Stop problem

    Questions & Answers
    2
    9
    1830
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      edwardseer last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        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 🙂

        1 Reply Last reply Reply Quote 0
        • E
          edwardseer last edited by

          It's for mql4. It happens for both. I'm using custom level.

          1 Reply Last reply Reply Quote 0
          • E
            edwardseer last edited by

            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?

            1 Reply Last reply Reply Quote 0
            • fxDreema
              fxDreema last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • fxDreema
                fxDreema last edited by

                By the way I wrote here some explanation of how to make custom blocks topic/3375

                1 Reply Last reply Reply Quote 0
                • E
                  edwardseer last edited by

                  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 function

                        else 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.

                  1 Reply Last reply Reply Quote 0
                  • fxDreema
                    fxDreema last edited by

                    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

                    1 Reply Last reply Reply Quote 0
                    • fxDreema
                      fxDreema last edited by

                      Ok, I made some changes, is it ok now?

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post

                      Online Users

                      C
                      P
                      E
                      R
                      F
                      Ø­

                      13
                      Online

                      146.7k
                      Users

                      22.4k
                      Topics

                      122.6k
                      Posts

                      Powered by NodeBB Forums | Contributors