fxDreema

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

    Bug with Trailing and BE ?

    Questions & Answers
    2
    5
    1331
    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
      ezzakt last edited by

      Hello,

      I wonder if there is a bug using trailing and Break Even Conditions both together on trades.

      Example:
      The EA has a trade running, it starts BE at 100% of SL and Trailing at 200% of SL

      Now I noticed once the BE starts if a trade reaches 100% SL of Profit, it modifies the trade correctly and sets it BE. The fact it sets this trade BE leads to the trailing Stop kicking in immediately after the BE was set. I tried to reconstruct it in several ways and it looks to me that once a trade is modified via BE, trailing always kicks in immediately after that modify. Even if the trailing target to start is not reached.

      Like if the BE marks the trade in some way so the trailing block thinks it can start now. Could this be the way ?

      Cheers

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

        Let me know if you need screens on this, I send you then by pm

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

          Yes, maybe "% of Stop Loss size" option in TS is not working as expected in all situation. First, because to "start trailing stop" means to do trailing stop when the condition is met, otherwise wait. And second, this Stop Loss size is calculated as the difference between Open Price and Stop Loss... which is fine when SL is below OP for Buy and above OP for Sell... but in your case SL is already on the opposite side and then that difference is not correct. Now the question is what is the SL size (if you measure it in pips/points) when it is modified while the trade is on profit and OP is on the opposite size. Maybe it is correct to say that SL is the size in the moment of modification (Ask-SL for Buy or SL-Bid for Sell), because after that the price continues to move and Ask-SL and SL-Bid changes all the time.
          I'm not sure if you will understand something. Now I'm not sure what is the best way to resolve this, but I will think for some way.
          For now I can suggest to use other option for trailing start. Maybe "Fixed pips" option, where you can write exact amount from Open Price which can be calculated somehow.

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

            I think I understand what you mean. Well maybe not completely, but I get it overall 😉

            Would be great if you could find some way to fix this in future revisions. My current EAs are using calculations based on Risk Reward factors only. So I always use % of SL size for everything (Like TP, distance for entries, start of be or trailing, trailing size, partial close at %of SL etc....)

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

              In case of Buy trade, SL is initially below OP and cannot be placed above it, but if there is a big enough profit SL can be placed above OP, because SL depends on the current market price, OP does not matter.

              When we have just placed Buy trade with SL of 100 pips, we know that SL level is 100 pips below it's OP, which is the current market price as well. And even when the price goes above/below a little bit, we still think that SL is 100 pips, because we accept that it SL is calculated as the difference between OP and SL level.

              But what if we are in profit with 100 pips and we put SL 10 pips below? Then, how big is our SL if we measure it in pips? Can we now tell that SL is the difference between OP and SL level?

              So, now I realize that this option (% of SL) is not very correct, because it is fine only when SL is below OP. Well, if we say that SL (in pips) is the difference between the last market price when we opened/modified our trade and SL level, then everything will be a little bit better. And in MQL4 we know Open Price of any trade, but unfortunately we don't know the last Modify Price, there is no such attribute in MQL4...

              Then I decided that I can save that attribute in memory, but everything will be gone when the EA is turned off by accident, and the strategy will be bronek. So I decided that I can also backup that data in external file, but actually almost the same problem goes here - if you modify a trade manually or with another EA that does not operate with this external file, there will be wrong data again.

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

              Online Users

              A
              E
              R

              8
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors