Plot Previous Day Close in ThinkorSwim

Playstation

Active member
VIP
This is a really simple indicator code by me, Playstation, using Mr Yen's aka realBrianWatt method of trading within the zones of 40 handles on /ES.
Warning: Only use this on /ES, not for any other products. Change deviation according to what you want. 20 each side is the suggested value.

Code:
# Previous Day Close Made By Playstation using MrYen aka realBrianWatt method.
# This remains free for all to use.

input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = -1;
input showOnlyLastPeriod = no;
input deviation = 20;

plot PreviousDayClose;
if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) { PreviousDayClose = Double.NaN;}
else { PreviousDayClose = Highest(close(period = aggregationPeriod)[-displace], length);}

PreviousDayClose.SetLineWeight(3);
PreviousDayClose.SetDefaultColor(Color.GREEN);


def TC = PreviousDayClose + deviation;
def BC = PreviousDayClose - deviation;

def TC2 = TC+40;
def BC2 = BC-40;

AddCloud(TC, TC2, Color.RED, Color.RED);
AddCloud(BC, BC2, Color.GREEN, Color.GREEN);

Totally forgot about the Discord and here. Yes, please follow Mr Yen, aka realbrianwatt on twitter for understanding of his method. He does have a youtube channel where he does his live sessions, so it would be good to learn there on his methods of trading.

**fair warning, he cusses and rants alot...but what he teaches is golden.
 
Last edited:

Playstation

Active member
VIP
@BenTen updated post with more info on Mr Yen, hope others find it useful to watch how he trades live. I think you can move this post to yours though, it isn't that much different.
 

lrc11239

Member
VIP
Would you be able to plot the price labels for the previous close and the clouds/boxes?? Many thanks
 

BenTen

Administrative
Staff
VIP
@lrc11239 Here's the chart bubble. Just add it to the end of your script.

Code:
def SR = showBubble and !IsNaN(close) and IsNaN(close [-1] ) && HighestAll(BarNumber());
AddChartBubble(SR, PreviousDayClose, "PrevClose", Color.Dark_Orange);
 

BenTen

Administrative
Staff
VIP
@lrc11239 My apology, here is the updated code:

Code:
input showBubble = yes;
def SR = showBubble and !IsNaN(close) and IsNaN(close [-1] ) && HighestAll(BarNumber());
AddChartBubble(SR, PreviousDayClose, "PrevClose", Color.Dark_Orange);
 

jay_charting

New member
Is this available on the mobile app too? I tried to configure it but could not get it to work. Any advice would be apprecaited.

Thanks!
 

airsakuragi

New member
Hi Guys,
Im trying to make a scanner that shows stock crossing previous day close,

let say it opens -1% and then it will come out on the scanner when it goes +.01%

let say im using 5 minute time frame.

I have a script of previous day close but its on Day time frame and it goes error when i change it to 5 min,

Hope someone could help me,

Thanks
 

jngy2k

Member
VIP


Code:
def agPeriod = AggregationPeriod.DAY;

def cod = close(period=agPeriod);

def prevcl= cod[1];

plot PCl= prevcl;

Is there a way to get rid of the connecting line from one day to the next?
I only want the display to show the price line and not the vertical movement in post market.
 

Similar threads

Top