Hi all,
I am trying to draw previous day high, previous day low, last week high, last week low in the chart as 'Price Level'. [I know there is an option in thinkorswim to draw price level manually]. I wanted to draw this level in a study so that every time I input a new ticker, level will be automatically loaded.
def lastDayLow= low(period = 'Day')[1];
def lastDayHigh = high(period = 'Day')[1];
def lastWeekLow = low(period = 'Week')[1];
def lastWeekHigh = high(period = 'Week')[1];
plot dayLow = lastDayLow;
plot dayHigh = lastDayHigh;
plot weekLow = lastWeekLow;
plot weekHigh= lastWeekHigh;
When I tried this, I don't see price level line. I got a PaintingStrategy type - LINE. I tried with horizontal line and It draws on each bars. I did not get the horizontal line like 'Price Level' line.
Hence I used lowestAll like this,
plot dayLow = lowestAll(period = 'Day')[1]
I got the line as 'Price Level' line but it took the lowest price of the year though I have used the AggregationPeriod as 'Day'
Note:
When I try this - I draws the Price level line at 20.
plot a = 20;
So I thought of trying like this but it did not draw price level line
plot a = low(period="Day")[1];
Can someone help ?
I am trying to draw previous day high, previous day low, last week high, last week low in the chart as 'Price Level'. [I know there is an option in thinkorswim to draw price level manually]. I wanted to draw this level in a study so that every time I input a new ticker, level will be automatically loaded.
def lastDayLow= low(period = 'Day')[1];
def lastDayHigh = high(period = 'Day')[1];
def lastWeekLow = low(period = 'Week')[1];
def lastWeekHigh = high(period = 'Week')[1];
plot dayLow = lastDayLow;
plot dayHigh = lastDayHigh;
plot weekLow = lastWeekLow;
plot weekHigh= lastWeekHigh;
When I tried this, I don't see price level line. I got a PaintingStrategy type - LINE. I tried with horizontal line and It draws on each bars. I did not get the horizontal line like 'Price Level' line.
Hence I used lowestAll like this,
plot dayLow = lowestAll(period = 'Day')[1]
I got the line as 'Price Level' line but it took the lowest price of the year though I have used the AggregationPeriod as 'Day'
Note:
When I try this - I draws the Price level line at 20.
plot a = 20;
So I thought of trying like this but it did not draw price level line
plot a = low(period="Day")[1];
Can someone help ?
Last edited: