Hi,
I have a study called projection tool and I am using different displacement figures for the different time frames I'm using. These are in a dropdown menu. I was wondering if it's possible to select from the dropdown menu the desired displacement and automatically populate it to the displacement input field.
I have attached an image. See below
Here's the study:
http://tos.mx/TMuBGyQ
I have a study called projection tool and I am using different displacement figures for the different time frames I'm using. These are in a dropdown menu. I was wondering if it's possible to select from the dropdown menu the desired displacement and automatically populate it to the displacement input field.
I have attached an image. See below
Here's the study:
http://tos.mx/TMuBGyQ
Ruby:
#JJ Projection tool
#Definitions
def na = Double.NaN;
def h = HighestAll(high);
def l = LowestAll(low);
# Inputs for EMA2 and Inversion
input priceChartDisplay = close;
input avg_type = AverageType.SIMPLE;
#Switch for Chart Time Frame
input TimeFrame_Displacement = {default Daily_82, Hourly_140, Fifteen_Minute_520, Five_Minute_1560};
input avg_len = 5;
input displace = -82;
#MovingAverage
def ma1 = MovingAverage(avg_type, close, avg_len);
input show_ma1 = yes;
plot z1 = if show_ma1 then ma1[-displace] else na;
z1.SetDefaultColor(Color.CYAN);
def lowdiff = ma1 - l;
def ma1_inv = h - lowdiff;
input show_inverted_ma1 = yes;
plot z2 = if show_inverted_ma1 then ma1_inv[-displace] else na;
z2.SetDefaultColor(Color.YELLOW);
z2.SetStyle(Curve.SHORT_DASH);
#AddLabel(1, " Normal ", Color.CYAN);
#AddLabel(1, " Inversion ", Color.YELLOW);
Last edited by a moderator: