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
    1. trending_up 646 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 2 posts
    2. attach_file 2 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,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)

 
Search this Thread
 

adding labels that always stay on the left on horizonal lines

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

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?
Trying to transform single contracts into a continuous contract from historical data
NinjaTrader
Simulated Playback Trading
EasyLanguage Programming
Incomprehensible divergence between price action and cumulative delta bars
Sierra Chart
Multicharts Custom instrument
MultiCharts
Does anyone use options levels in trading?
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on futures io
How did you learn to trade?
129 thanks
Big Mike in Ecuador
79 thanks
2020 profit and loss results
74 thanks
NinjaTrader buys TransAct Futures (Infinity Brokers), plans its own FCM
62 thanks
Whos afraid of the big bad Glitch
47 thanks
 
(login for full post details)
  #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
 
(login for full post details)
  #3 (permalink)
Los Angeles (CA)
 
Experience: Master
Platform: ThinkOrSwim
Trading: Currency Future, Stocks
 
lukeskywalker1's Avatar
 
Posts: 29 since Apr 2019
Thanks: 0 given, 16 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
[

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


Last Updated on April 24, 2020


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Are you doing what it takes to trade right? w/FuturesTrader71

Jan 21
 

Journal Challenge!

February
 

Battlestations!

March
     



Copyright © 2021 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