Creating a button
-
I'm trying to add a button to my EA that whenever I click on that it closes all the open positions. I should put 'draw button' block on chart tab but I don't know how to connect the close the positions with hitting that button on the chart.
-
If you search the forum you will find lots of info on this. Generally draw button off oninit, read button ontick, if on activate a close block, and redraw the button off
-
@nasserminaei You will need to use blocks on 2 tabs as jstap suggested: oninit, on chart and deinit. Like this:
-
@jstap thanks,
I have tried but couldn't find anything. probably I was checking wrong keywords -
@l-andorrà
thanks, I have checked the example you mentioned. it was very clear. now i know how to do that.
thanks a lot