bigmit2011
New member
Hi everyone.
I am attempting to create a study for a full green body (give or take 10% tails).
However, I have two concerns I would like your help on.
First does my logic and code look okay? Secondly, how do I turn this into a function/study
that allows me to reuse as a function in other custom studies I will create?
Here is my code:
Since I am looking for nearly full green bar,
my logic is as follows:
1)I am making sure close is greater than open,
2)high wick and lock wick are less than 10% of body and
3) finally since I want the body not to be those compact/compressed bodies,
I am looking for the body to be greater than or equal to average of the past 15 day bodies.
My code below.
However, I don't know what I am supposed to use instead of plot if I want to make this
into a study/function that I can reference.
For example in another study,
I want to put arrows on all full bars that
just crossed the simple moving average of 10 day.
Thank you!
Thank you!
I am attempting to create a study for a full green body (give or take 10% tails).
However, I have two concerns I would like your help on.
First does my logic and code look okay? Secondly, how do I turn this into a function/study
that allows me to reuse as a function in other custom studies I will create?
Here is my code:
Since I am looking for nearly full green bar,
my logic is as follows:
1)I am making sure close is greater than open,
2)high wick and lock wick are less than 10% of body and
3) finally since I want the body not to be those compact/compressed bodies,
I am looking for the body to be greater than or equal to average of the past 15 day bodies.
My code below.
However, I don't know what I am supposed to use instead of plot if I want to make this
into a study/function that I can reference.
For example in another study,
I want to put arrows on all full bars that
just crossed the simple moving average of 10 day.
Thank you!
Code:
def upDay = close - open > 0;
def body = close - open;
def meatyBody = body > Average(AbsValue(close- open), 15);
def noHighWick = (high - close) < (.10 * body);
def noLowWick = (open - low) < (.10 * body);
def noWick = noHighWick and noLowWick;
plot result = upDay and meatybody and noWick;
Thank you!