Hi Guys,
I am trying to implement a basic moving average algorithm. The gist of the algorithm is
(1) Daily compute the 35 day moving average and a 1 day moving average for a given security. (2) If the value for 1 day moving average is lower than the 35 day moving average then short the security (3) Conversely if the value 1 day moving average is greater than the 35 day moving average then take a long position in the security
I coded up the algorithm and I am showing a 80% loss in capital :( I have a couple of basic questions
- Is there a particular kind of security that is more suitable for these kind of algorithms? I chose Apple just on a whim.
- What are the best practices for determining how much quantity of stock to buy/ short? Again I chose 100 units on a whim?
- For this particular algorithm, how do you decide whats the ideal time to get out of your position?
Lastly how do I link my algorithm/ results to this post?