fxDreema

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

    Hedge by pips distance

    Questions & Answers
    2
    21
    8541
    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.
    • tcanuto
      tcanuto last edited by

      Hello fxDreema, okay?

      I have a project for hedge pips distance, but he does not seem to work properly.

      Link to the project: http://fxdreema.com/shared/QzZtAAEwd

      Until more!

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

        Well, I'm not the right guy to have a discussion about hedging.

        There is an error of mising variable that is defined in block 21. I corrected that in the project in your profile. This is because all of the hidden parameters of the block are included to the final code. Someday I must change that rule.

        I wonder why you are using "toDigits" when calculating lots value. "toDigit" and "toPips" are function to work with price levels, not lots.

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

          __There is an error of mising variable that is defined in block 21. I corrected that in the project in your profile. This is because all of the hidden parameters of the block are included to the final code. Someday I must change that rule.[/quote:1ge6krkw]
          Ok .. what comes to be that change. I'm sorry but I understood not.

          __I wonder why you are using "toDigits" when calculating lots value. "toDigit" and "toPips" are function to work with price levels, not lots.[/quote:1ge6krkw]
          I used to believe toDigit be possible to multiply the lot of the initial order for 1.1 or 2 if I want. If this way is wrong, how can I do this?

          Until more!

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

            toDigits is a function that normally converts 10 to 0.0010. It is used for pips conversion, not lots.

            Now I saw that you are trying to use value from (Event trade), but this should be used under "on Trade" event. At the moment it give you pure 0, I believe.
            If you want to get the lot size of the last trade, then put "Start trades loop" block with "Not more than n trades" parameter set to 1, and then you can get the lot size of the last trade from "(in loop) Attributes of the loaded trade/order", not from "(Event trade)...."

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

              I'm trying to do what they asked me to do now.
              Please could create a sample project so I can understand you better? Because it also could not find two blocks that you said.

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

                Ok, I'm really bad in hedging strategies, but I think you should use the "on Trade" event as well. I am probably missing something here, but at least this project is doing something and can give some direction: http://fxdreema.com/shared/saUu2Td5b
                Also, there was a project named Sure-Fire. Isn't it the same story there?

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

                  __Also, there was a project named Sure-Fire. Isn't it the same story there?[/quote:2ejyhx9i]

                  Yes .. until I was happy with it, but it was not working properly, or was not closing all orders in profit. The other problem is that it will become a sort of Martigale. But at first liked the idea, yes. Its make it work properly?

                  Now I will test this version hedge that made me. Thanks for the help.

                  I would also like you to take a look at my other hedge, which is triggered at support or resistance, rather than x pips from the market.
                  http://fxdreema.com/forum/viewtopic.php?f=2&t=1954

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

                    __Also, there was a project named Sure-Fire. Isn't it the same story there?[/quote:zqgy7278]

                    Yes .. until I was happy with it, but it was not working properly, or was not closing all orders in profit. The other problem is that it will become a sort of Martigale. But at first liked the idea, yes. It has as make it work properly?

                    Now I will test this version hedge that made me. Thanks for the help.

                    I would also like you to take a look at my other hedge, which is triggered at support or resistance, rather than x pips from the market.
                    http://fxdreema.com/forum/topic/1954

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

                      What is "Price Offset"? How do I open a pending order x pips to market? If the Price offset, it is not working properly because I put 5 pips away from the market and opened it to 22 pips away from the initial order.

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

                        Let's say that you want to open Buy pending order. The defaults are Open at price = Ask, Price offset = 20 (pips), which means that the pending order will be opened at price Ask+20pips.
                        If you use dynamic value (not Ask), you can set Price offset as 0.

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

                          Well .. in this case it did not work offset the price, but I'm using a pending order based on the top line or below the price channel indicator.

                          This happening the following issues that still can not solve:

                          SLPipsDistPriceChannel not working;
                          And the multiplier lots also not working.

                          http://fxdreema.com/shared/VbMho3Dsd

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

                            Check this again...
                            __toDigits is a function that normally converts 10 to 0.0010. It is used for pips conversion, not lots.

                            Now I saw that you are trying to use value from (Event trade), but this should be used under "on Trade" event. At the moment it give you pure 0, I believe.
                            If you want to get the lot size of the last trade, then put "Start trades loop" block with "Not more than n trades" parameter set to 1, and then you can get the lot size of the last trade from "(in loop) Attributes of the loaded trade/order", not from "(Event trade)...."[/quote:2r6nofk9]

                            I think that SLPipsDistPriceChannel is ok, the value that "toDigits(SLPipsDistPriceChannel)" gives in MQL4 is 0.0003, as expected.

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

                              I forgot to tell that this is also opening a new order to hedge the hedge before. But the work must always hedge the initial order, and will not open a hedge to hedge.

                              I forgot to tell that this is also opening a new order to hedge the hedge before. But the work must always hedge the initial order, and will not open a hedge to hedge.

                              I'll be checking what I said.

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

                                __Check this again...[/quote:1jufzxq6]
                                Checked

                                __I think that SLPipsDistPriceChannel is ok, the value that "toDigits(SLPipsDistPriceChannel)" gives in MQL4 is 0.0003, as expected.[/quote:1jufzxq6]
                                I think I did as I said in past messages. This does not correct this way? If not, how should I do?

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

                                  I think that your indicator (Price Channel.ex4) is missing 🙂

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

                                    __I think that your indicator (Price Channel.ex4) is missing :)[/quote:12fb9sbq]

                                    The indicator had previously posted here, but here goes again.

                                    ......
                                    Price Channel.mq4

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

                                      No, no, I have it. Check your logs, I think it's missing on your PC.

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

                                        Yes .. would not have a way to make this indicator already is within the code, without the necessity of having it on MT4 platform?

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

                                          No indicator can be within the code! What is in the code is a simple function named "iCustom" that links to the external indicator that must be located in "/experts/indicators" folder.

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

                                          Online Users

                                          L
                                          K
                                          H
                                          N
                                          J

                                          17
                                          Online

                                          146.7k
                                          Users

                                          22.4k
                                          Topics

                                          122.6k
                                          Posts

                                          Powered by NodeBB Forums | Contributors