fxDreema

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

    how to set TP/SL according to indicator?

    Questions & Answers
    2
    7
    2863
    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.
    • M
      mamabear last edited by

      I have an ATR stop indicator I'd like the EA to take profit and stop loss according to. However I could not get it to work. I tried to configure it first with the buy and sell button, didn't work. Then I tried a block if trade-indicator logic-close trade. Still didn't work. Not only that, it messes up the EA in general it doesn't open and close trade according to logic anymore, it closes the trades immediately after open. However if I remove the tp/sl condition and use the simple fixed pips the ea works fine. so it is a question and a bug report I guess. Please help

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

        Well, if trades started to close immediately, this is at least something. People have this problem very often and the reason for that is because their conditions to buy/sell and the conditions to close trades are true at the same time. I don't know how to better explain the problem. It's not a bug in the problems, it's a logical error - the way blocks are connected.

        Here is some example that contains very few blocks - https://fxdreema.com/demo/mt4-buy-sell-buy-sell-opposite-conditions - and at first you might think that something horrible will happen. But their settings and location are good.

        Whatever you do, remember that all the blocks under "on Tick" run on every tick - over and over again, very quickly.

        M 1 Reply Last reply Reply Quote 0
        • M
          mamabear @fxDreema last edited by

          @fxDreema

          Thanks for the response. I understand what you said (I think) but it does not do that if I left the TP/SL as fixed pips, the EA works fine.

          It only changes behavior when I tried to change TP/SL to correspond with an indicator, then The EA loses it's mind. My problem is I can't get the EA to successfully set TP and SL according to an indicator.

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

            Maybe the indicator levels are not proper. Or you selected the wrong option? There is difference between "price level", "price fraction" and "pips". If you select the wrong one, you could see error... or fxDreema could try to correct that error and you will see wrong behavior. I think that you selected some option that resulted is small SL/TP, so the trades are closed early.

            M 1 Reply Last reply Reply Quote 0
            • M
              mamabear @fxDreema last edited by

              @fxDreema

              I selected price level, defined by indicator buffers. doesn't work. I even tried different indicators same problem, this time the EA does not open any trades.

              1 Reply Last reply Reply Quote 0
              • M
                mamabear last edited by

                OK I think I get it what was wrong, now I got the TP and SL to work according to the indicator but I have another problem. Perhaps it's a problem with the indicator but maybe it's how I defined it.

                Basically the EA set the TP and SL according to indi but at the level where the trades were taken. I want the EA to follow the movement of the indi to close trades when the current price meets the current levels. Can it be done?

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

                  Yes, but not in Buy/Sell blocks. Remember - these blocks only do their job once when they are executed, they create their trade and that's all. Well, the only option that appears to continue working is the Expiration option for the MQL4 side.

                  https://fxdreema.com/demo/mt4-trailing-stop Trailing stop is an example how stops can be moved multiple times. And I would actually recommend this block for your task, if you also want stops to move only in one direction. You can see those Custom options for Trailing Stop.
                  If you want to modify stops every time, there is a block "Modify stops". Well, SL and TP are not separated in this block.
                  Or "For each Trade - > modify stops"

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

                  Online Users

                  J
                  T

                  11
                  Online

                  146.9k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors