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.
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
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
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