fxDreema

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

    Alert about how many candles ago price crossed MA

    Questions & Answers
    3
    6
    549
    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
      MMaarits last edited by

      Hello,

      I would like to get information about how many candles ago price crossed MA, I created EA for that, but unfortunately it doesn't work. What is wrong there, link to shared project is here https://fxdreema.com/shared/RANrLu32c?

      Thanks a lot!

      G TipsyWisdom 2 Replies Last reply Reply Quote 0
      • G
        GTOAT777 @MMaarits last edited by

        @mmaarits Your conditions dont make sense, that first condition says price is already above the MA and the next condition says when price crosses above. It cant cross above if it is ALREADY above the MA

        1 Reply Last reply Reply Quote 0
        • TipsyWisdom
          TipsyWisdom @MMaarits last edited by

          @mmaarits said in Alert about how many candles ago price crossed MA:

          Hello,

          I would like to get information about how many candles ago price crossed MA, I created EA for that, but unfortunately it doesn't work. What is wrong there, link to shared project is here https://fxdreema.com/shared/RANrLu32c?

          Thanks a lot!

          Yea, delete the first condition.

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

            Thank you very much for your help! I made this change, but unfortunately it still doesn't work as expected.
            The initial idea was to implement following logic:
            If price is above MA, check when it crossed above MA and alert
            If price is below MA, check when it crossed below MA and alert

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

              then any time after it crosses, you will be alerted every new candle...theoretically.

              But the way you are doing it is illogical.

              If you are above it, then it doesnt matter when it crossed it, unless you need that information to use later. You would then do a variable system...

              If price X MA, modify variable "MAX"

              If price is above MA, check MAX...

              But I dont understand why you would need to know...what you would need to know. The price at that moment? Thats what that variable will produce. If you are trying to seek a candle ID thats a bit more complicated and you will need a loop.

              It would probably be easier if you marked a chart and showed us what a perfect trade looks like, and then share a link of your current project attempt to make that happen.

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

                Thank you very much for your help! I created a screenshot to explain what I am searching for, the red indicator is 25SMA and I want to get as an alert how many candles ago the price crossed 25SMA. So, I want to get alert about the number that is marked as yellow.
                0_1648493988075_MA cross.png

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

                Online Users

                H
                R
                A

                16
                Online

                146.7k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors