Error

 MS Support #1 Posted : Friday, July 28, 2017 10:16:57 PM(UTC) Quote Multi-Quote Rank: Advanced MemberGroups: Moderators, Registered, Registered Users, SubscribersJoined: 10/8/2010(UTC)Posts: 1,372Thanks: 28 timesWas thanked: 104 time(s) in 101 post(s) Ken Calhoun's article, “Mean-Reversion Swing Trading”, presented a visual trading system designed to take advantage of pullbacks in uptrends.  The formula below, used as a filter in the explorer, will find such trading opportunities.   The first two lines of the formula allow the user to adjust the parameters of the scan: "Z" is the minimum percentage increase in the initial upswing."fudge" is the percentage difference allowed between the close on the pullback and the actual 50% mean reversion.The formula is presented using values of 10% minimum move and a 0.1% allowance on the difference at the reversion level. Exploration filter: Code:``````z:= 10; fudge:= 0.1;  p1:= LastValue(TroughBars(1, C, z)); pv1:= Trough(1, C,z); p2:= LastValue( HHVBars( C, p1 )); pv2:= HHV( C, p1); meanrev:= (pv1 + pv2) / 2; pv3:= LLV(C, p2); p1 < PeakBars(1, C, z) AND pv2 >= pv1 * (1 + (z/100)) AND Ref(Abs(pv3 - meanrev) <= pv3 * (fudge/100), -1) AND C > Ref(C, -1) AND LLVBars(C, p2) = 1 AND pv1 >= 20 AND pv2 <= 70`````` Edited by user Monday, July 31, 2017 5:14:20 PM(UTC)  | Reason: Not specified