Your button should be created on the OnInit tab and controlled on the OnChart tab. All your logic seems to be looped in a mess when it could be much more simple. That's probably why it doesn't work.
I don't see how and when the button is created. I guess this is just part of your structure, not the complete project. All blocks closing partially should be positioned in the 'on chart' tab connected below the 'mouse clicked on object' block. That way it will only happen once when you click the button.
I'm afraid I don't fully understand what you need. Do you mean using the 'turn on/off' blocks on other blocks or just executing any block with an ID number in the 'on tick' tab?
Yes, but as I explained, there is no guarantee it will stop exactly at $40.00 all the time. That will depend on the quote arriving to the terminal when conditions is true.
Because you have it on top, needs to be in the middle, when action passes through it, it stops any other actions from passing through it, then when reset another action can pass.
I end up uploading the Ea as ex4,and ex5 , so the same Ea on both platform, the only change was to change the name of the Ea ex5 by adding mt5 to the end of the name.