- Katılım
- 23 Eki 2020
- Mesajlar
- 1,826
Q: Is it possible to write the "4% Rule" intoa custom formula? A: The "4% Rule", popularized by Martin Zweig, among others, states that you enter the market after it has gone UP 4%, and exit the market after it has gone DOWN 4%. This counter-intuitive rule is intended to get you into (or out of) the big price moves. This is a good strategy for a strongly-trending market, but a poor strategy for a sideways market. The following formula uses the PREV function and is slow to calculate onlarge amounts of data. The formula returns +1 in buy mode, -1 in sellmode, and 0 before there is a signal. |
|
4% Rule If(PREV = 1, If(CLOSE < HighestSince(1,PREV <> 1,CLOSE)*.96, -1,PREV), If(PREV = -1, If(CLOSE>LowestSince(1,PREV <> -1,CLOSE)*1.04, +1,PREV), If(PREV = 0, If(CLOSE>Lowest(CLOSE)*1.04, +1, If(CLOSE<Highest(CLOSE)*.96, -1, PREV)),PREV))) |
|