I am trying to run a simple timer function which runs every 10 seconds to monitor position(s) in the stock market. More specifically, I have created a variable called tradeFlag, which initializes as an empty variable () and takes the value 1 if a trade is executed. What I am trying to do is prevent another trade from being executed by using simple if statements, like below:
tradeFlag = ;
function timer(hObj, eventdata, tradeFlag)
if isempty(tradeFlag) &
However when I run this function, I either get a "Not enough input arguments error" or or an else block will not be executed. Is there a better way to do this? What am I missing here?