fxDreema

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

    Simple button to change a variable output

    Questions & Answers
    2
    2
    974
    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.
    • A
      adamghous last edited by

      Hey,

      I have been trying to create a simple button that changes a variables state from TRUE to False. When True the EA is allowed to take a specific set of trades and when false it takes no trades.

      The image below shows my 'on chart' button logic which is simple. The variable is initially set to False. So when the variable is False the condition block allows it through and when the button is clicked the variable is changed from False to True and the EA can take trades. This part works fine and I can see this on my chart via a comment block which shows the out of the variable 'Trade on'.

      However, i am struggling to change the variable back to false when i click the button again. Can anybody see a reason why it wouldn't change back to False?

      Thanks for any help, Adam.

      0_1542017378647_c0964b20-0679-4ae5-9dbe-a5005c7f92e9-image.png

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

        I will suggest to put those purple blocks always on the top. I think logically it is better. Because that "on Chart" event fires on wide range of chart events and it's better to filter the events first and then do something else.

        Try this example: https://fxdreema.com/shared/sKFJN0Ffb I'm setting the value in the variable in the Condition block, you will see. Then on the Alert you will see values 0 or 1, but it is the same as false and true.

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

        Online Users

        F
        E
        T
        S
        A
        I
        A
        E
        S
        E

        23
        Online

        146.7k
        Users

        22.4k
        Topics

        122.6k
        Posts

        Powered by NodeBB Forums | Contributors