Jason Posted June 22, 2019 Report Share Posted June 22, 2019 Not sure if this would be a feature request or if this achievable currently without my awareness but I would like to ask if it's possible to add a criteria to one of the candle stick patterns available in the paintbars. I wish to use the "StrongLine" pattern. Currently I can set the RangeAveragePeriod for the detection and as I understand it the pattern is matched when the candle's range becomes larger than this RangeAveragePeriod. What I would like is to be able to set a threshold for the match such that a match is not returned unless the candle range exceeds a percentage or multiple of that RangeAveragePeriod. For example, only if the candle is 2 times the length of the RangeAveragePeriod or 150% of the RangeAveragePeriod would an alert be issued. This would provide us with a huge degree of flexibility in avoiding false positives. Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted June 22, 2019 Report Share Posted June 22, 2019 that is a bit specific. What I can do to solve your problem is just give you the function for StrongLine - you can then put it into your Paintbar after the MainCalculation function, and then modify it however you want: public Boolean StrongLine(int Ago = 0, int RangeAveragePeriod = 10) { Double RangeAverage = CandlePattern.AverageCandleBody(RangeAveragePeriod); double body = CandlePattern.CandleBody(Ago); if (body >= RangeAverage * 3 && CandlePattern.BottomWick(Ago) <= body && CandlePattern.TopWick(Ago) <= body) { return true; } return false; } You can just copy/paste the above code in its entirety at the end of your paintbar and reference "Strongline" instead of CandlePattern.Strongline in your regular script code Quote Link to comment Share on other sites More sharing options...
Jason Posted June 23, 2019 Author Report Share Posted June 23, 2019 Great, thanks! Am I correct then to conclude from this that the function is already requiring the candle body to be at least 3 times the size of the average candle range across the period? I wouldn't have thought it to be so demanding just from seeing it at work in charts. Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted June 23, 2019 Report Share Posted June 23, 2019 yes, 3 times 10 candle average, unless you specify a different amount for RangeAveragePeriod Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.