fxDreema

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

    Problem with block "Trailing stop (group of trades)"

    Bug Reports
    2
    4
    1206
    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.
    • D
      drewinbrissie last edited by

      I'm trying to use this block to trail a group of buy and sell trades. The block only seems to trail either the buys or the sells, but not all together as a single group. This is frustrating as I'm using the opposite trades as a hedge and want to exit when the whole group is in profit, not just the buys or sells. Without the hedge working the drawdown if much higher.

      The attached files have an example of the block and the resulting trades. In this case all trades are trailed (ie.modified), but only the buys are closed as a group, then the sells are modified and finally closed.

      Any help would be much appreciated.

      Thanks Drew

      ......
      example trades.xlsx
      fxdreema blocks.docx

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

        I can see Buy-Sell pairs, 2 trades located close to each other. Do you have error messages in the log? Because, how can you set the same SL for both trades in a pair when they are so close to each other? And why do I think that the value of TPPips is 0. And why TPPips is sounds like something about take-profit, but it used as a trailing SL.

        1 Reply Last reply Reply Quote 0
        • D
          drewinbrissie last edited by

          Attached are couple of screenshots which show the behavior in action.

          I am getting some errors in the Journal. "Error: Invalid SL requested (1.15878 for Bid price 1.1548)". These appear to be associated with the trailing stop being too close to the open price.

          The strategy I am implementing enters buy and sell trades with different lotsizes as a recovery from drawdown on an existing trade. The attached screenshots shows how this works. Simple mean-reversion strategy really. The exit will always be after a retracement has occurred so there will be buy and sell trades at the same level, and above and below the current price.

          The TPPips variable is the number of pips in profit for the series of trades to exit as a group. For example, if there are 10 trades and TPPips is set to 10, when the average price of all 10 trades is 10 pips in profit, then trail the group. In the attached screen shots you can see only the buy trades were trailed and closed and the sell trades where left open.

          If the trail was implemented as a virtual trail, rather than modifying each trade individually in real-time, it would then take out the whole series when the trail SL point was reached. This would avoid the issues of MT4 trying to set new SLs for each trade in real-time and getting conflicts with open prices. I appreciate it means if there are price gaps then there are no hard stops to take out individual trades.

          The group profit calculation works well in the block "Check profit (unrealised)". If I put a close block after this it takes out all trades immediately at the correct point. Rather than a hard close, I want to trail the series of trades once a specific level of profit is reached. The ability to trail as a % of profit is ideal. It would be great if this function could be included as a "Trailing Stop mode" option. This means as profit increases I can give the trades more room to move rather than using a fixed value.

          Thanks again for your great support,
          Drew

          ......
          graphical example.docx

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

            The difference between 1.15878 and 1.1548 is 40 pips, pretty large number.

            Do you know how this block works? Because it reads the trades, calculates their average lot size and average open price using some formula (imagine that the result is one single position) and sets SL of all trades to a particular level behind that invisible "open price". Of course, each trade is still individual, each one still have its type (Buy or Sell) and depending on the current price you are able to set SL at certain level for some of the trdes, but not for others.

            Imagine you have Sell trade that is on profit. You can't put the SL level below the current price.
            Imagine you have Buy trade that is on loss. You can't put the SL level above the current price.

            When you have mix of Sells and Buys, it depends, some of them might be out of the game.

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

            Online Users

            R
            F

            15
            Online

            146.7k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors