Code help


Category:
0
0

I have the code:

def highestMonthlyHigh = Highest(high[1], 21);
def highestMonthlyLow = Lowest(low[1], 21);

How would I plot this on a lower chart study?

plot highestMonthlyLow;

doesn’t work

Marked as spam
Posted by (Questions: 34, Answers: 56)
Asked on February 18, 2017 7:15 pm
81 views
0

Also, how would I plot the 52 wk high and the 52 wk low? Thank you!

( at February 18, 2017 7:45 pm)
0

I would really prefer to see a title that is more specific than ”Code Help”. Think about the other viewers who will be searching for the same answer.

( at February 18, 2017 8:49 pm)
0

Sorry, I will give a better title next time.

( at February 19, 2017 3:49 am)
0
Private answer

Add:
declare lower;

Change:

def highestMonthlyHigh = Highest(high[1], 21); def highestMonthlyLow = Lowest(low[1], 21);

to:

plot highestMonthlyHigh = Highest(high[1], 21); def highestMonthlyLow = Lowest(low[1], 21);

Omit the last statement in your example.

The solution for 52 week high and low is similar. Merely change the value used for the monthly (21 days) to a value that represents 1 year of trading days. Roughly 252

Reference here: https://en.wikipedia.org/wiki/Trading_day

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on February 18, 2017 8:47 pm