Hi all,
I feel a bit embarassed since I have to bother you here, but been trying to understand this issue for a couple days and I am a step away from giving up. Feeling (sort of) comfortable with basic formulas and systems, but there came a twist that is sort of above me.
To make it a bit organized, wanna tell you a buit about the background. Developed some external indicator for investment strategy. Calling it investment strategy, since the signals come once a year only and, as of now, I am focused on making the best of these.
Converted it into MS file as if it was some security, call it "the Thingy". One signal per year, so it's the same value for each day of the year.
The strategy is simplistic. When the Thingy is positive, I go long. When it turns negative, I reverse and go short. Decided to optimize it to know the best day to enter (and exit). Turned out that moving averages do the trick.
So for I got something like this (writing from memory, but it works like a charm):
Buy:
Security("...\THINGY",C)>0
AND
C>MOV(C,200,S)
Sell:
Security("...\THINGY",C)<0
AND
C<MOV(C,200,S)
Sell short:
Security("...\THINGY",C)<0
AND
C<MOV(C,200,S)
Buy to cover:
Security("...\THINGY",C)>0
AND
C>MOV(C,200,S)
As you may see, there are no stops or capital management: once the position is open, it will stay there until (at least) the next year. However, I would like to add certain condition that would close the position and wait until the next year. Intuitively, it would be something like (referring to long positions only):
Sell:
(
Security("...\THINGY",C)<0 {the old condition}
AND {the old condition}
C<MOV(C,200,S) {the old condition}
)
OR {assuming that coming back under MOV50 means we want to disappear from the market}
C>MOV(C,200,S)
Problem:
As you may see already, stop may take me out easily. However, in the very same year, I can be taken back (and, possibly out again and back again), which is not what I want. I am desperate for a solution that would allow to either limit the number of entries per year (eg. 1 would mean that trade is entered, but once the stop is triggered, I won't be taken back) or set some cooldown period (eg. once the stop is triggered, there won't be any new positions for as long as, say 100 days).
How can I do it without getting PhD in programming?
Bonus question:
I have noticed that:
C<MOV(C,200,S)
produces slightly different results than:
CROSS(C,MOV(C,200,S))
Could you please explain why?
Thank you in advance - have a great week!