Hi,
I often write indicators by muself, but I do not know how to write a stragety and a signal. Could you please write a 5 moving average strtegy? the method is as following:
for long position:
buy:MVA1<=MVA2<=MVA3<=MVA4<=MVA5<=MVA6 and all slopes are flat or positive,
(MVAs are 5,10,20,30,40,50; MVA can also be EMA)
close the position: close price of the last bar is lower than MVA=20 or others such as 40or 50.
for short position:
sell:MVA1>=MVA2>=MVA3>=MVA4>=MVA5>=MVA6 and all slopes are flat or negative,
(MVAs are 5,10,20,30,40,50; MVA can also be EMA)
close the position: close price of the last bar is higher than MVA=20 or others such as 40or 50.
it would be better if there is a trade size limit such as 0.1~10 lots and close all positions before 17:00 EST on Friday.
Thanks in advance,
David Xiao