Page 1 of 1

6 moving average strategy

PostPosted: Sun Feb 11, 2018 12:09 pm
by davidxiao
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

Re: 6 moving average strategy

PostPosted: Mon Feb 12, 2018 7:54 am
by Apprentice
Try this version.
viewtopic.php?f=31&t=65727