Do this on tick, this way works on back test, condition block, object on chart with button name==1, this is for button on, do required settings, redraw button off, use if testing block above, once working copy on yo on trade tab without if testing.
_