fxDreema

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

    checking trade price

    Questions & Answers
    3
    10
    1600
    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 block that can flag the price of the trade?

      For example, if "current price" is > then "price of trade" then bla bla bla.?

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

        A follow up question would be to mark WHEN a trade was made.

        For example I would like to compare a current condition to a condition 3 candles ago but only 3 candles from the TRADE, not before.

        Is there a time block I can use so that it waits "n" candles after the trade before running the condition?

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

          Think I figured it out...Use "if trade" and then connect orange to "every 'n' bars"?

          That should keep the condition from running until a trade has been made and then 'n' bars after that.

          Did I get it right?

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

            Maybe it will work. It's probably not the best way to do something like that, but if it works... The best way is to check parameters of the trade itself - time, price, whatever

            1 Reply Last reply Reply Quote 0
            • N
              new69mart last edited by

              I am joining the discussion because this is exactly what I need to do now, where I can check the parameters for a specific trade and then add blocks depending of the level?

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

                "For each Trade" loads specific trade (or trades) and then it's parameters can be get from "Condition", from other blocks, or using the rest of the pink blocks.

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

                  I sort of understand.

                  Basically, I want a condition to run only after x bars from the trade.

                  As you describe it, I'm having trouble differentiating between "for each trade" and "if trade".

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

                    "For each Trade" finds how many trades there are (depending on the filter settings) and starts to load each one, one after another. For each loaded trade the orange output becomes active => what is connected there runs. For each trade only its parameters are loaded - open-price, stop-loss, whatever... All the other pink blocks are designed to work with those parameters, to check them, to modify them. In other words this block creates "for" loop where the body of the loop is represented by all blocks connected after "For each Trade".

                    "If trade" finds how many trades there are, depending on the filter settings. Then it decides to pass or not. That's all.

                    X bars from the trade.... What is that mean? Because:

                    • Each bar has Time attribute, along with Open, High, Low, Close and Volume attributes. That Time attribute equals to the rounded time when the bar was created. For H1 the first bar of the day has the Time that is translated to 00:00 at this day. The second candle of the day has Time that is 01:00. Not 01:00:04 or something like that. This can be easily seen in the Histry Center:
                      http://prntscr.com/a6ue5y
                      http://i.imgur.com/WkgRBTH.png
                    • Each trade has two Time attributes - Open Time and Close Time. If we take Open Time for example, this is the exact time when the trade was opened. This time is not rounded to the nearest minute or hour.
                      http://prntscr.com/a6ug7s
                      http://i.imgur.com/8r5AxLu.png

                    So what X bars from the trade really means? If you are in H1 and a trade is opened at 00:59, visually it will appear that the trade is opened within the very first bar in the day, but in fact it is opened at the last minute of that candle. Then what means 1 bar after that trade? It is something after 01:00 or is it something after 01:59?

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

                      I see what you mean.

                      Basically 1HR of the trade would effectively serve the purpose. (or 2hr or 3hr etc.)

                      So, in other words, I can use the block for time from trade to withhold running block or stop running blocks after a trade depending on these settings.

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

                        Here is for example how to close a trade if it's older than 1 hour - https://fxdreema.com/shared/QKXmhyGWb Of course, something else can be used instead "close".

                        There is actually a function to turn any Time value into candle offset - https://docs.mql4.com/series/ibarshift I wonder if it's a good idea to add it in Condition -> (in loop)... , but I'm not sure 🙂

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

                        Online Users

                        S
                        V
                        M
                        K
                        R
                        N
                        W
                        L

                        16
                        Online

                        146.7k
                        Users

                        22.4k
                        Topics

                        122.6k
                        Posts

                        Powered by NodeBB Forums | Contributors