fxDreema

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

    Button: Turn off some blocks.

    Questions & Answers
    2
    2
    1294
    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.
    • L
      lezaun last edited by

      I'm trying to create a button. When pressed, it should turn off some blocks. That's all! But I can't make it work. Please could you help me?

      Thanks đŸ™‚

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

        Try this: https://fxdreema.com/shared/WPSiKSY7b

        Here I create the button with name MyButtonName in "on Init", because I only need to do it once when the EA starts. Then in "on Chart" I detect when it was clicked (block 3). Then I load that button (block 4), check whether it is pressed or not (block 5) and do some actions depending on that. I change its name (6 and 7).

        Blocks 4-5-6-7 can also be used at any time in "on Init". Depends on how what you want to do. You say that you want to turn off blocks, so in my example you can replace block 8 with the turn off block. Or set the value of some variable, which will then be checked in "on Init". But also, blocks 4-5 would do pretty much the same job if they are in "on Tick".

        It seems that the Chart event (OnChartEvent() MQL function) doesn't work when testing on visual mode, it only works when you run the EA live.

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

        Online Users

        O
        G
        B
        A
        P
        I
        M
        M
        J
        T
        S
        T
        M
        E
        P
        B

        47
        Online

        146.7k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors