After spending weeks on trying to solve this problem I have come up with the following answer. I want to know if you all agree agree. I want my chart to display the buy,sell,short,cover arrows when 1 occurs in the corresponding array. That I can accomplish.
But I have short arrows occuring while I am in the middle of a long trade and long arrows occuring in the middle of a short trade. I have tried a whole bunch of solutions to this problem but at the end of the day to no avail. I saw that zeek/mike had and excahnge about this and so did barry. I have tried a) the exrem function- but that does not solve much even if i do buy=exrem(buy,short or sell); as u suggested in an earlier email .because then a buy can still occur once a short has occured or even i change to cover a buy can still occur if there are 2 short trades in a row. b) i tried setting static vars - but can't backtest them or see them in exploration. so that does me know good. c) I tried using the backtester interface to plot only real trades. that does plot real trades and there are no conflicting signals plotted. but in real time I still get a 1 in the short array while in the middle of a long trade. d) i even tried the flip funciton. but it will always be reset to zero when the code reproccesses the array bc it needs to be initialized. Is there anyway to avoid getting a 1 in the short array while the last signal in the buy/sell array was one in the buy array ( meaning in the middle of a long trade). I am starting to think there is not. PLease correct me if I am wrong. I have seen posts on the forum with similar frustrations. thanks
