Donation to this community:
Trend-line indicator with buffers – SQ3 friendly
You can visual back-test in mt4 to find settings which draw the lines the way you want. There are 3 buffers buffer 1 is the upper trend-line if one exists if it does not then it is returning the ceiling. buffer 2 is the lower trend-line level if one exists if not then its at the floor. Buffer 3 is the one we should use in SQ. It is returning the closest line to the market.
The settings are:
extern int minbars=34; //min bars in between swingpoints
extern int lookback=750; //maximum lookback for calculation in bars
extern int Shortest=150; //shortest line allowed in bars
extern int breaktime=0; //most recent bars ignored so you can see the break / bars allowed before a redraw after a break
extern double tol=1; // the atr tolerance for spillover or shortcomings for touchpoints.
extern double ATRPeriod=100; // the period bars for the atr calculations of tol, bounce and patcon
extern double minD=3; // min distance from line for each bounce in atr
extern bool anglefilter=false; // if true: upper lines drawn downward only / lower lines drawn upward only
extern double patcon=0; // if non 0 will not register any lines to buffer unless it’s a consoladation pattern where the consolodation is smaller than patcon in atr. Try from about 5 to 25 with anglefilter off to find flags and wedges.
extern int maxage=250; // maximum bars in the past allowed for the last touchpoint before trendline expires
extern string uppername=”a”; // upper line name. change to ca for an alert on close when using shmen-dash (at some point about 10 years ago I published a version of this as a drawer and an alerter that it works with. Maybe it still works!)
extern string lowername=”b”; // lower line name. change to cb for an alert on close when using shmen-dash
extern double UpperCap = 999; // sent to upper buffer if there is no upper line detected (ceiling)
extern double LowerCap = 0.001; // sent to lower buffer if there is no lower line detected (floor)
Mods go ahead and move this to the appropriate forum section if you want. I wasn’t allowed to post as I am not officially a customer yet….. Ah! Not even allowed to attache here. I’ll try and post the source:…nope! spam filter didnt like it. pm me I guess for it….
You must be logged in to reply to this topic.