Plot Previous Day Close in ThinkorSwim

P

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:
P

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

lrc11239

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

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);
 
lrc11239

lrc11239

Member
VIP
@BenTen - the code for the chart Bubble is showing invalid.. What am I missing...??LOL
 
BenTen

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);
 
J

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!
 

Similar threads

Top