Jump to content
Medved Trader Forums
Jason

Request for Additional Candle Pattern Criteria

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...