Hi again everyone
quick question, using the below code, I want the signal to become 1 when certain criteria are met, I want it to stay as a 1 until another set of criteria are met.
I do not want it to revert back to a zero simply because the first set of criteria no longer exist.
How can I tweak my code to accomplish this or must I use the IF function?
signal = zeros(size(eurUSDClose));
signal(fastMA>slowMA & rsi10mins < 65) = 1;
signal(fastMA<slowMA & rsi10mins > 35) = -1;
Thanks for your help and any tips :)