(2018-07-24, 10:03 PM)pcabc Wrote:(2018-07-24, 12:30 AM)malaguti Wrote: ....
I updated it slightly for an earlier stage 3 since your post. and yes, its all about the investor method for me. on a weekly chart, its pretty good. allows for a long hold all the way to the end of a trend, also allows to add to positions on continuations
anyway, as you say many ways to skin a cat
I'll amend it to colour the bars as its probably easier visually
You seem to be comparing 30 (week?) moving averages with trendlines and a few other things. Any reason why you did not do something like the following psuedo code?
IF ((30 week MA rising) AND (close > 30 week MA)) {
  stage = 2
}
ELSE IF ((30 week MA falling) AND (close < 30 week MA)) {
  stage = 2
} ELSE {
  stage = 1/3
}
Or is it 'just because' you thought your way worked better? I assume it would whipsaw less than the code here?
BTW - 'just because' is fine!
Looking at your indicator it appears that you'd do OK following it slavishly?
Hi Pcabc, no trend lines. I could have used "slope" i could have used MA > MA[1] i just happened to choose the linear regression as that also signifies turning points. no other reason
if you use close is greater than 30, then you are too quickly going from one stage to another
take the S&P again with a recent rising 30SMA. if you are in a stage 3 when it closes below, you would be in a stage 2 a couple of weeks later, where ive added the text in my chart.Â
the book and method looks to break a "high" an area of some previous resistance. i haven't yet come across in any charting package this concept of a high (almost like a zig zag), so ive used the donchian 20. you can see that the recent donchian break of the 20 again does seem to be doing a good job.
thats all it does, a good job, by no means perfect.Â
thanks for the comments though. my code could indeed be simpler using "slope". I just did it last night having been using amibroker previously which is better at backtesting and yes, you could use my method slavishly although i only did it to backtest the methodÂ
if you can think of other entries happy to look at all of them
thanks again pcabc. I may open another thread simply for this topic