replace high, low and close with user input values


Category:
0
0

Hi Pete, 

I am looking for to add the user defined OHLC into this code? Can you please help?

Thank you.

input aggregationPeriod = AggregationPeriod.DAY;

def highValue = high(period = aggregationPeriod)[1];
def lowValue = low(period = aggregationPeriod)[1];
def closeValue = close(period = aggregationPeriod)[1];
def range = highValue – lowValue;

plot ProfitTarget2R5 = (highValue / lowValue) * closeValue;
plot LBreakOrRBreakoutR4 = closeValue + range * (1.1) / 2;
plot GoShortR3 = closeValue + range * (1.1) / 4;
plot R2 = closeValue + range * (1.1) / 6;
plot R1 = closeValue + range * (1.1) / 12;
plot HH = highValue;
plot PP = (HIGHValue+ LOWValue + CLOSEValue)/3;
plot LL = LOWValue;
plot S1 = closeValue – range * (1.1) / 12;                  
plot S2 = closeValue – range * (1.1) / 6;
plot GoLongS3 = closeValue – range * (1.1) / 4;
plot SupportBreakoutS4 = closeValue – range * (1.1) / 2;
plot ProfitTarget2S5 = (closeValue – (ProfitTarget2R5   – closeValue));

Marked as spam
Posted by (Questions: 49, Answers: 62)
Asked on October 27, 2019 10:58 am
82 views
0
You will need to explain what you mean by "user defined OHLC". The OHLC is present in each and every candle on the chart. There is no "user defined" version of OHLC. The question title should reflect the context of your request. "Support Resistance levels" does not describe what you are requesting. The code you provided is taken from a standard pivot level study. With a few extra items added. I might call this something like "daily pivot breakout signals". So once we understand what you are requesting I will update the title to make sure it accurately reflects the context of your request.
( at October 27, 2019 11:16 am)
0
If I use the existing code, I can use them for the TFs which are supported by TOS but if I want to plot the levels for example- 8 hr TF then I will have to enter the OHLC values for the previous 8 hr manually then it will plot the levels. I hope I am being clear. Thank you.
( at October 28, 2019 1:30 pm)
0
Private answer

After getting clarifications on the request we have the following solution. The request was to replace the existing statements reading the high, low and close from the higher time frame with adjustable user inputs. The value for high, low and close will need to be manually changed to fit the instrument being plotted on the chart.

input highValue = 100.00;
input lowValue = 90.00;
input closeValue = 95.00;
def range = highValue – lowValue;
plot profitTarget2R5 = (highValue / lowValue) * closeValue;
plot lBreakOrRBreakoutR4 = closeValue + range * (1.1) / 2;
plot goShortR3 = closeValue + range * (1.1) / 4;
plot r2 = closeValue + range * (1.1) / 6;
plot r1 = closeValue + range * (1.1) / 12;
plot hh = highValue;
plot pp = (HIGHValue+ LOWValue + CLOSEValue)/3;
plot ll = LOWValue;
plot s1 = closeValue – range * (1.1) / 12;
plot s2 = closeValue – range * (1.1) / 6;
plot goLongS3 = closeValue – range * (1.1) / 4;
plot supportBreakoutS4 = closeValue – range * (1.1) / 2;
plot profitTarget2S5 = (closeValue – (profitTarget2R5 – closeValue));

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on October 28, 2019 5:41 pm
0
Thank you so much Pete. Appreciated and God Bless You.
( at November 6, 2019 5:25 pm)