Turning Exit Rule Blocks off with button on chart.
-
Re: Button: Turn off some blocks.
Is this still the valid method for turning blocks off with a selector button? I've copied this and it doesn't work in either on init, chart or ontick - Help anyone?
I have exit rules that I want to manually turn off at times... whats the best method to use a button on chart?
-
@pan4pips Well, if the button executes the blocks correctly, you might use one of the Switch ON / OFF or Toggle blocks. If you don't like the output in the logs, you might use flags for achieving the same.
-
@trader-philipps said in Turning Exit Rule Blocks off with button on chart.:
@pan4pips Well, if the button executes the blocks correctly, you might use one of the Switch ON / OFF or Toggle blocks. If you don't like the output in the logs, you might use flags for achieving the same.
Button doesn’t allow or stay pressed. On init and onchart it doesn’t show up when applying to live chart
Ontick button shows but doesn’t allow interaction
-
If I'm not mistaken, that project creates a button using OBJECTS. The objects would be "Text"
If you have a specific button that you use, maybe an external indicator. Then I have a solution for you.
It will take a little bit of work, and it won't be a "fix all" but if you use the same charts, it shouldn't be a problem.
Simply, place your OBJECT underneath your existing button. You will need the X and Y coordinates and choose a size big enough for your button.
If the logic tree is correct, then it should work.
If you don't have an existing button, it's the same rule. If you've tried it, then it's possible your logic tree is not routed correctly.
-
@pan4pips Ok, I just build it. I couldn't manage to use the toggle block or at least there were no messages in the journal. So I decided to use flags.
First I created a button on the On Init tab.

Then on the on Chart tab I did the following ..

In order to display the message, I created a boolean variable and it is set to true if block 332 is passed and to false if block 331 is passed. The result I display in the alert text.
Now, on every click on the button I receive a message .. it toggles the flag ..

So, for your issue, you'd use the same check flag block with the desired condition /true or false to check) and place your exit logic behind the corresponding dot (orange or yellow depending).
-
I responded on the wrong thread. That's some skill you got there Trader Philipps!
-
FOUND THE SOLUTION! Learned how to create buttons in the process. Can you imagine I was creating TEXT messages to control my blocks. Such a hassle.
Any who, here's your solution.
https://fxdreema.com/shared/QstMKBHE


The button didn't change to "Exit Rules OFF" since I made the program terminate itself. But it should work once you replace it with the correct ON/OFF blocks. You can delete the Pass button. I was just testing it.
-
@titangeorge Well, the issue ist that the google block or turn Off/On blocks didn't show any message in the journal that the defined block turned off. That's why I used the flags. One could also just define a boolean variable and check it's state which is set by button click.
I think there are several options once the buttons work well. -
That is correct! Many different options to incorporate, thanks to you, I've learned how to create alerts!
-
Hey, I noticed my Button Logic is off. I assumed that the button would "reset" but it doesn't. It stays pressed. If I "click" again, it would technically get stuck in an infinite loop of being pressed.
Would you happen to know how I could cause an On Off On Off button? Once per click deal. Maybe a custom code but I don't know how to.