adding labels that always stay on the left on horizonal lines - futures io
futures io futures trading



adding labels that always stay on the left on horizonal lines


Discussion in ThinkOrSwim

Updated by lukeskywalker1
    1. trending_up 386 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 2 replies
    2. attach_file 2 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Thread Tools Search this Thread
 

adding labels that always stay on the left on horizonal lines

  #1 (permalink)
sfo + CA
 
 
Posts: 7 since Feb 2016
Thanks: 3 given, 0 received

adding labels that always stay on the left on horizonal lines

Hi,
I have the following code to draw line on previous close:
 
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);
1) How do I programmatically draw a label that always stays to the left on the chart. I created
one manually like so:

How do I do it programmatically ?

2) This draws a line further away from the start of the close on the previous day.
How do I draw the line all the way from the actual close point ?

Thanks.

Reply With Quote

Can you help answer these questions
from other members on futures io?
Convert NinjaTrader NT7 indicator to Tradestation EasyLanguage and RADARSCREEN
Platforms and Indicators
Issue meeting order entry conditions
Elite Automated NinjaTrader Trading
Last 5 minutes Label
ThinkOrSwim
Moving average with Lag reduction
NinjaTrader
Linux?
ThinkOrSwim
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Spoo-nalysis ES e-mini futures S&P 500
77 thanks
June Charity Fundraiser - Feeding hungry families
47 thanks
FIO Journal Challenge - June 2020 edition w/SharkIndicators
46 thanks
Fixed vs trailing stops
31 thanks
AMP Futures / AMP Global Review
26 thanks
 
  #2 (permalink)
fertile
 
 
Posts: 2 since Aug 2019
Thanks: 1 given, 0 received

I don't think you can program the name of a line and it's orientation in thinkscript.
You could add a chart bubble and have it appear x bars back.

Reply With Quote
 
  #3 (permalink)
Los Angeles (CA)
 
Experience: Master
Platform: ThinkOrSwim
Trading: Currency Future, Stocks
 
lukeskywalker1's Avatar
 
Posts: 19 since Apr 2019
Thanks: 0 given, 5 received



maindoor View Post
Hi,
I have the following code to draw line on previous close:
 
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);
1) How do I programmatically draw a label that always stays to the left on the chart. I created
one manually like so:

How do I do it programmatically ?

2) This draws a line further away from the start of the close on the previous day.
How do I draw the line all the way from the actual close point ?

Thanks.

Hey. If I understand you correctly, this code will help you.
This is a very useful indicator that I would install first.
it can be modified for you



 
Code
#Study:Info
#by thetrader.top

input ATRLength = 14;        

input ShowATR = {default "1", "0"};       
input AvgVolume = {default "1", "0"};    
input Volume_ = {default "1", "0"};    
input ATRPlay = {default "1", "0"};    
input VolumePlay = {default "1", "0"};    

def _ATR_D = TrueRange(high(period = "DAY"), close(period = "DAY"), low(period = "DAY"));
def iATR_D = Round(Average(_ATR_D, ATRLength)[1], 2);
AddLabel (!ShowATR, "ATR("+ATRLength+") " + iATR_D, Color.GRAY);

def iAvgVolume = Round(Average (volume(period = "DAY")[1], 65) / 1000, 0);
AddLabel (!AvgVolume, "AvgVol " + iAvgVolume + "k", Color.GRAY);

def iVolume = Round(volume(period = "DAY") / 1000, 0);
AddLabel (!Volume_, "Vol " + iVolume + "k", Color.LIGHT_GREEN);

def iATRPlay = Round((high(period = "DAY") - low(period = "DAY")) / iATR_D, 1);
AddLabel (!ATRPlay, "ATRPlay " + iATRPlay + "(" + Round(high(period = "DAY") - low(period = "DAY"), 2) + ")", Color.LIGHT_GREEN);

def iVolumePlay = Round(iVolume / iAvgVolume, 2);
AddLabel (!VolumePlay, "VolPlay " + iVolumePlay, Color.LIGHT_GREEN);

def Gap = Round((Open(period = "DAY")-Close(period = "DAY")[1])/Close(period = "DAY")[1]*100, 2);
AddLabel (Yes, "Gap " + Gap+"%", Color.LIGHT_GREEN);

def ATRcur = Round (Average(TrueRange(high, close, low)[1],5));
AddLabel (Yes, "ATR(5) " + ATRcur, if(ATRcur<=0.20) then Color.GREEN else Color.Red);

2020-04-24_18-34-28
[

More indicators in telegram. Follow the link ... https://t.me/thinkorswim_view

Want to fix delay in ThinkOrSwim? Contact here ... thetrader.top
Visit my Facebook Visit my futures io Trade Journal Reply With Quote



futures io Trading Community Platforms and Indicators ThinkOrSwim > adding labels that always stay on the left on horizonal lines




Upcoming Webinars and Events
 

Free BloodHound Licenses to everyone!

June
 

Every journal equals ten meals for the hungry

June
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts