Calculate wicks percent of the body

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #136828 quote
    Sprattelgubbe
    Participant
    Junior

    Hi,

    I would like to calculate the wicks percent and if it is below 15 percent of the body (close – open in an upward market) I would like an upward arrow to print.

    Example: Body is 100 points and the wick is 13 points then I would the arrow to print at the close of the bar.  If the wick is 16, then no print of arrow

    I know how to print the arrow, its just the calculation that is my issue. It would be nice if the 15 percent could be a variable so I can easily change that number, for testing.

    #136834 quote
    robertogozzi
    Moderator
    Master

    There you go, when x = 1 then it’s < PerCent:

    PerCent = 15
    Bullish = close > open
    Body    = close - open
    Wicks   = range - Body
    x       = 0
    If Wicks < (Body * PerCent / 100) Then
       x = 1
    Endif
    #136837 quote
    Sprattelgubbe
    Participant
    Junior

    Thank you for your quick reply.

    But I get an error massage that “This variables is not used in the code” for both Bullish and x.

    I´m on version 10.3

    #136839 quote
    robertogozzi
    Moderator
    Master

    You can remove line 2 to get rid of BULLISH, which is actually not used.

    As to X it’s up to you using it according to what you want to do.

    If you just want to plot signals then you’ll have to add, at the end:

    RETURN x
    #136840 quote
    Sprattelgubbe
    Participant
    Junior

    Now it works great!!

    Thank you very much.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Calculate wicks percent of the body


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Sprattelgubbe
5 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 06/22/2020
Status: Active
Attachments: No files
Logo Logo
Loading...