fxDreema

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

    How to EA draw an indicator on the chart automatic?

    Questions & Answers
    4
    9
    2032
    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.
    • khacdiepvnc
      khacdiepvnc last edited by

      Hi Admin and Bro
      How to EA draw indicators on the chart automatic?

      Thanks

      M khacdiepvnc 2 Replies Last reply Reply Quote 0
      • M
        miki @khacdiepvnc last edited by

        @khacdiepvnc if you use MT5 to add an indicator on the chart in automatic mode, in on init tab open a custom mql block and copy paste this code :

        long handle=ChartID();
        if(!ChartIndicatorAdd(handle,1,v::atrcurrent))
        PrintFormat("Failed to add ATR indicator on %d chart window. Error code %d",
        handle,GetLastError());
        if(!ChartIndicatorAdd(handle,0,v::imacurrent))
        PrintFormat("Failed to add EMA indicator on %d chart window. Error code %d",
        handle,GetLastError());

        First "if" is for a subwindow indicator like ATR in this case, second "if" is for an indicator in main chart like EMA.
        v::atrcurrent and v::imacurrent you have to replace them with the handles of the indicators you want to use.

        U 1 Reply Last reply Reply Quote 1
        • khacdiepvnc
          khacdiepvnc last edited by

          thanks Bro.
          But i need find how to do with MT4

          M 1 Reply Last reply Reply Quote 0
          • M
            miki @khacdiepvnc last edited by

            @khacdiepvnc from what i know you can't in mql4, one more reason to switch to mt5 😁

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

              thanks Bro

              1 Reply Last reply Reply Quote 0
              • khacdiepvnc
                khacdiepvnc @khacdiepvnc last edited by

                @khacdiepvnc up!

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

                  I could be wrong but, any indicators & chart settings I want to use with EA I save as template so I can add in a couple of clicks, there is a block called apply template which would probably do this for you, also this post link text may help.

                  Learn fxDreema Without the Wait!

                  My comprehensive book, available on Amazon, is packed with examples and invaluable insights to help you fast-track your learning journey.

                  The paperback and hardback editions include MT4 & MT5 QR codes for easy access to all prebuilt projects and robots, including my latest gold trading robot!

                  Don’t miss out

                  Click here➡️ https://mybook.to/fxDreema to get your copy today!

                  Enjoy! 😊

                  U 1 Reply Last reply Reply Quote 1
                  • U
                    Uriel 0 @jstap last edited by

                    @jstap thanks

                    1 Reply Last reply Reply Quote 0
                    • U
                      Uriel 0 @miki last edited by

                      @miki I was just trying and look

                      0_1642183358192_780a9656-36d8-414a-aac1-f92dca0832cb-image.png

                      I'm not programmer yet, sorry:(

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

                      Online Users

                      P
                      R
                      S
                      E
                      M
                      P
                      C

                      20
                      Online

                      146.7k
                      Users

                      22.4k
                      Topics

                      122.6k
                      Posts

                      Powered by NodeBB Forums | Contributors