azakusa
Member
Looking to add an additional plot line to the thinkscript below.
The desired plot line would follow the current price -4%. Effectively making two lines. One with the current price, and one at 4% below it.
The idea is to use it as a quick visual reference for where my stoploss would reside to help me speed up the decision process on my entries.
I was poking around on the site the closest thing (visually) I came up with was this.
https://usethinkscript.com/threads/bid-ask-spread-lines-indicator-for-thinkorswim.1140/post-8476
Any thoughts anyone?
The desired plot line would follow the current price -4%. Effectively making two lines. One with the current price, and one at 4% below it.
The idea is to use it as a quick visual reference for where my stoploss would reside to help me speed up the decision process on my entries.
I was poking around on the site the closest thing (visually) I came up with was this.
https://usethinkscript.com/threads/bid-ask-spread-lines-indicator-for-thinkorswim.1140/post-8476
Any thoughts anyone?
Code:
#Plots a Horizontal Line that follows the price value selected
input price=close;
input offset=0;
input length = 300;
def sma = SimpleMovingAvg(price, 1, length);
rec line = if IsNaN(sma) then line[1] else sma[offset];
plot priceline=if isnan(sma) then line else double.nan;
priceline.setpaintingStrategy(paintingStrategy.LINE);
priceline.setlineWeight(3);
priceline.setdefaultColor(color.green);
priceline.hideBubble();