fxDreema

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

    Formula - calculating difference

    Questions & Answers
    3
    13
    2749
    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.
    • R
      rafaels919 last edited by rafaels919

      Hi,
      Can somebody tell me what I'm doing wrong in this configuration?
      I'm trying to calculate the difference between "Kijun-sen line" and "Tenkan-sen line" and use that as an order entry condition.
      https://fxdreema.com/shared/xAOZV0gLc
      alt text

      alt text

      alt text

      T 1 Reply Last reply Reply Quote 0
      • T
        trader.philipps @rafaels919 last edited by

        @rafaels919 What is your code doing? Does it not open any trades? Or in wromg direction?

        I like to share my knowledge, but expect the others to contribute as well.

        1 Reply Last reply Reply Quote 0
        • R
          rafaels919 last edited by rafaels919

          @trader-philipps It opens trades, but it ignores the condition.
          It is supposed to enter orders only when the difference between the two lines (line1 - line2) is greater than 0.0002 ticks or 2 pips.
          alt text

          T 1 Reply Last reply Reply Quote 0
          • T
            trader.philipps @rafaels919 last edited by

            @rafaels919 You didn't secify a candle ID such as ID1 as ID0 is the current candle and values may change during the candle is not closed. May that be the problem?

            I like to share my knowledge, but expect the others to contribute as well.

            1 Reply Last reply Reply Quote 0
            • R
              rafaels919 last edited by rafaels919

              Alright, I had the values wrong. For a buy order, instead of (Kijun - Tenkan) I should've had (Tenkan - Kijun). The setup wasn't wrong. It works now.
              Am just trying to get familiar with Constants and Variables. They seem to be crucial if one wants to be creative or test things quicker. @trader-philipps

              1 Reply Last reply Reply Quote 0
              • R
                rafaels919 last edited by

                @trader-philipps After testing it carefully, it appears to be not working again...
                Project link: https://fxdreema.com/shared/rJPfeS8Ob

                I don't know what I'm doing wrong here, maybe someone could point me at the right direction?

                • I'm selling when Tenkan (minus) Kijun difference is within 2 pips limit.
                • And buying when Kijun (minus) Tenkan is within the same limit^.

                alt text

                alt text

                1 Reply Last reply Reply Quote 0
                • C
                  casebefx last edited by

                  Mayby better way would be this : put Tekan to Formula, in formula multiply Tekan ( Id1 ) x 1 and put it at variable. This same Formula make with a Kijun. In third Formula subtraction this two variables and put result to the third variable.

                  1 Reply Last reply Reply Quote 0
                  • R
                    rafaels919 last edited by

                    Hi @casebefx
                    I'm not sure if I fully understand what you described. Could demonstrate that in the project that I linked above?
                    That would be greatly appreciated.

                    1 Reply Last reply Reply Quote 0
                    • C
                      casebefx last edited by

                      https://fxdreema.com/shared/GUeD7QKUc

                      T R 2 Replies Last reply Reply Quote 0
                      • T
                        trader.philipps @casebefx last edited by

                        @casebefx What is the reason for multiplication *1 ?

                        I like to share my knowledge, but expect the others to contribute as well.

                        1 Reply Last reply Reply Quote 0
                        • R
                          rafaels919 @casebefx last edited by

                          @casebefx @trader-philipps Still doesn't work, it opens orders below and above the 2 pip limit, doesn't make sense:
                          https://fxdreema.com/shared/K2rBUELKc

                          T 1 Reply Last reply Reply Quote 0
                          • T
                            trader.philipps @rafaels919 last edited by

                            @rafaels919 I'd do like that - especially calculating in pips, so it should work on JPY pairs as well.

                            0_1575804229007_TenkanKijun_DivTest_0001.mq4

                            Project

                            I like to share my knowledge, but expect the others to contribute as well.

                            1 Reply Last reply Reply Quote 1
                            • R
                              rafaels919 last edited by

                              @trader-philipps That works well, thank you!

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

                              Online Users

                              M
                              B
                              T
                              S
                              O

                              20
                              Online

                              146.7k
                              Users

                              22.4k
                              Topics

                              122.6k
                              Posts

                              Powered by NodeBB Forums | Contributors