fxDreema

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

    MARKING A PRICE

    Questions & Answers
    2
    7
    1906
    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.
    • 4
      4xFatigue last edited by

      Is there a way or block that can determine the highest, lowest, or median price over a given range?

      Like: Lowest price over past 6 bars.

      Basically I'm trying to develop a system that creates a stop loss and target depending on how many pips back a particular trend started.

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

        If you are in "Condition", look somewhere in "Market properties" - https://fxdreema.com/demo/mt4-trace-multiple Only Highest and Lowest prices are available here.
        As an indicator this is known as Donchian Channel

        1 Reply Last reply Reply Quote 0
        • 4
          4xFatigue last edited by

          Will this use absolute value if we choose "Custom pips".

          FOR BUY: For example the ea I'm working on determines the stop loss from the lowest within the last 5 candles. That's easy enough.

          FOR BUY: For whatever that distance is (in pips) the stop-loss is (calculated from the lowest within the last 5 candles) I want that to be the same number of pips for take-profit moving forward.

          So if I choose "Custom pips" lowest point within the last 5 candles, will it just apply that pip value for the take profit? Or will it apply that lowest price for the number of pips (which would close the trade instantly)?

          In other words the distance of the stop loss is equal to the distance of the take profit from the trade. But the stop loss changes depending on the lowest within the last 5 candles (I would prefer the lowest 'close' within the last 5 candles but I don't see that option).

          If you need to see the ea, it is the one with the cheesy name: BOLLINGER ROCKET 1-0

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

            Try this - https://fxdreema.com/shared/FbPnl5L7

            This creates Buy trade with SL = Lowest price of the last 10 candles and TP is calculates as the same distance. I want to get the difference between Bid and the Lowest price, but because I selected the Lowest price and I want to include the Bid price in the Adjust field, I use this formula to invert the calculation: *-1)+Bid

            Bid is predefined variable in MQL4. MetaTrader puts the value of Bid on every tick. By the way there is no such variable for MQL4. Why Bid... because candles are built out of Bid prices.

            But note that this project is dangerous! Put it to test and you will see why. Before going to Buy, the difference between Bid and the Lowest value must be checked.

            You can also use Variables and calculate these values in a different way 🙂 I just wanted to show you this example that uses no extra blocks for calculations.

            1 Reply Last reply Reply Quote 0
            • 4
              4xFatigue last edited by

              So for Take Profit, even though you chose "Lowest Candle" it still "knows" to just use that for the distance in pips and only close after the price has moved into that far into profit. Did I get that right?

              1 Reply Last reply Reply Quote 0
              • 4
                4xFatigue last edited by

                I see. So the calculation account for the Positive distance (for buy).

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

                  I forgot that in the settings for Take Profit there is also "% of Stop Loss". Try this 🙂

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

                  Online Users

                  A
                  N
                  S
                  E
                  A
                  M
                  T
                  M
                  A
                  E
                  K
                  J
                  J

                  28
                  Online

                  146.7k
                  Users

                  22.4k
                  Topics

                  122.6k
                  Posts

                  Powered by NodeBB Forums | Contributors