NexusFi: Find Your Edge


Home Menu

 





Add previous close line to thinkorswim charts intraday


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one phamta with 4 posts (0 thanks)
    2. looks_two Nube with 3 posts (4 thanks)
    3. looks_3 Depiero with 2 posts (0 thanks)
    4. looks_4 Thatsoundgye with 2 posts (0 thanks)
    1. trending_up 15,432 views
    2. thumb_up 5 thanks given
    3. group 9 followers
    1. forum 13 posts
    2. attach_file 0 attachments




 
Search this Thread

Add previous close line to thinkorswim charts intraday

  #1 (permalink)
Depiero
Charlotte, nc
 
Posts: 8 since Feb 2014
Thanks Given: 0
Thanks Received: 2

Hello,
I would like to know how can I add a little tittle with the number or closed day, I can see the link but would like to see a number too.. how can I do that?

 
Code
input aggregationPeriod = AggregationPeriod.DAY;
input length = 1;
input displace = -1;
input showOnlyLastPeriod = no;
plot PrevDayClose;
if showOnlyLastPeriod and !IsNaN(close(period = aggregationPeriod)[-1]) {
    PrevDayClose = Double.NaN;
} else {
    PrevDayClose = Highest(close(period = aggregationPeriod)[-displace], length);
}
PrevDayClose.SetDefaultColor(GetColor(9));
PrevDayClose.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
Futures True Range Report
The Elite Circle
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Exit Strategy
NinjaTrader
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
27 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #2 (permalink)
 
rmejia's Avatar
 rmejia 
Puerto Rico
 
Experience: Intermediate
Platform: thinkorswim
Broker: TD Ameritrade
Trading: Options
Posts: 379 since Oct 2010
Thanks Given: 3,614
Thanks Received: 441

Add a tittle where? A "label" on the top left area of the chart?

Learning Center ? Charting

Reply With Quote
  #3 (permalink)
Depiero
Charlotte, nc
 
Posts: 8 since Feb 2014
Thanks Given: 0
Thanks Received: 2


I think I figured it out..

I somehow came up with this and it looks like its working

AddChartBubble(GetYYYYMMDD() != GetYYYYMMDD()[1], high, "Day: " + GetDayofWeek(GetYYYYMMDD()) + " - Close: " + PrevDayClose, Color.white, yes);

Reply With Quote
  #4 (permalink)
 
WilleeMac's Avatar
 WilleeMac 
Prospect, KY. USA
 
Experience: None
Platform: Sierra Chart
Broker: Infinity
Trading: /CL
Posts: 687 since Jan 2012
Thanks Given: 309
Thanks Received: 617

I don't know if this is still active or not...

See if the attached will do you any good

-Bill

Price Line Study

https://nexusfi.com/download/thinkorswim/

Follow me on Twitter Reply With Quote
  #5 (permalink)
Daniel S
Malaysia
 
Posts: 1 since May 2019
Thanks Given: 0
Thanks Received: 0

Hi guys, the script above is included the after market hour close price. How can I exclude the after market hour close price? Kindly assist. Thanks

Reply With Quote
  #6 (permalink)
Nube
Minneapolis Minnesota
 
Posts: 24 since Jul 2019
Thanks Given: 0
Thanks Received: 13


Daniel S View Post
Hi guys, the script above is included the after market hour close price. How can I exclude the after market hour close price? Kindly assist. Thanks


def RTHClose = if GetTime() crosses above RegularTradingEnd(GetYYYYMMDD()) then
close[1] else RTHClose[1];

plot RegularTradingClose = RTHClose;

Reply With Quote
Thanked by:
  #7 (permalink)
phamta
Monroe
 
Posts: 3 since Dec 2019
Thanks Given: 0
Thanks Received: 0

Could you guys help me to make a code for an open and close levels for the first 5 minutes opening bar please

Reply With Quote
  #8 (permalink)
 
Massive l's Avatar
 Massive l 
OR/USA
Legendary /NQ Trader
 
Experience: None
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,106

initial balance was the first thing that came to my mind. try this.

might need to change def pastOpeningRange

input showOnlyToday = YES;
input InitialBalanceMinutes = 5;
input Market_Open_Time = 0630;
input Market_Close_Time = 1415;


def day = GetDay();
def lastDay = GetLastDay();
def isToday = If(day == lastDay, 1, 0);
def shouldPlot = If(showOnlyToday and isToday, 1, If(!showOnlyToday, 1, 0));
def pastOpen = If((SecondsTillTime(Market_Open_Time) > 0), 0, 1);
def pastClose = If((SecondsTillTime(Market_Close_Time) > 0), 0, 1);
def marketOpen = If(pastOpen and !pastClose, 1, 0);
def firstBar = If (day[1] != day, day - 1, 0);
def secondsUntilOpen = SecondsTillTime(Market_Open_Time);
def regularHours = SecondsTillTime(Market_Close_Time);
def secondsFromOpen = SecondsFromTime(Market_Open_Time);
def pastOpeningRange = If(secondsFromOpen >= (InitialBalanceMinutes * 60), 1, 0);

rec displayedHigh = If(high > displayedHigh[1] and marketOpen, high, If(marketOpen and !firstBar, displayedHigh[1], high));
rec displayedLow = If(low < displayedLow[1] and marketOpen, low, If(marketOpen and !firstBar, displayedLow[1], low));

rec IBHigh = If(pastOpeningRange, IBHigh[1], displayedHigh);
rec IBLow = If(pastOpeningRange, IBLow[1], displayedLow);

plot IBH = If(pastOpeningRange and marketOpen and shouldPlot, IBHigh, Double.NaN);
plot IBL = If(pastOpeningRange and marketOpen and shouldPlot, IBLow , Double.NaN);
IBH.SetDefaultColor(Color.CYAN);
IBH.SetStyle(Curve.FIRM);
IBH.SetLineWeight(1);
IBL.SetDefaultColor(Color.CYAN);
IBL.SetStyle(Curve.FIRM);
IBL.SetLineWeight(1);

#AddCloud(IBH, IBL, Color.DARK_GRAY, Color.DARK_GRAY);

def ORWidth = IBH - IBL;

plot Mid = (IBH + IBL) / 2;
Mid.SetDefaultColor(Color.CYAN);
Mid.SetStyle(Curve.SHORT_DASH);
Mid.SetLineWeight(2);


input InitialBalance_Label = Yes;
AddLabel(InitialBalance_Label, Concat("IB: ", AbsValue(IBH - IBL)), Color.DARK_ORANGE);

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #9 (permalink)
phamta
Monroe
 
Posts: 3 since Dec 2019
Thanks Given: 0
Thanks Received: 0

Thanks
Should we use 930 for the regular trading hour?

Reply With Quote
  #10 (permalink)
Nube
Minneapolis Minnesota
 
Posts: 24 since Jul 2019
Thanks Given: 0
Thanks Received: 13



phamta View Post
Thanks
Should we use 930 for the regular trading hour?

 
Code
def RTHOpen;
def FiveMinuteClose;
if GetTime() crosses above RegularTradingStart(GetYYYYMMDD()) {
    RTHOpen = open;
    FiveMinuteClose = close(period = AggregationPeriod.FIVE_MIN);
}else{
    RTHOpen = RTHOpen[1];
    FiveMinuteClose = FiveMinuteClose[1];
}

plot o = RTHOpen;
plot c = FiveMinuteClose;

Reply With Quote
Thanked by:




Last Updated on March 12, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts