NexusFi: Find Your Edge


Home Menu

 





Linear Regression Slope Angle Label


Discussion in ThinkOrSwim

Updated
    1. trending_up 2,693 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

Linear Regression Slope Angle Label

  #1 (permalink)
madeinnyc
Highland Park, TX
 
Posts: 36 since Jan 2020
Thanks Given: 17
Thanks Received: 20

I slightly modified this linear regression slop study to include an angle label. I'm looking to further improve it by adding another angle label that changes the angel value as I hover my pointer over the slope line. Can someone please help:


 
Code
declare lower;

input price = close;
input length = 14;
input displace = 0;
def avg = ExpAverage(close, length);
def height = avg - avg[length];
def Angle_deg = ATan(height/length) * 180 / Double.Pi;
addLabel(1, "Angle Deg " + Angle_deg, Color.WHITE);


Assert(length > 1, "'length' must be greater than one: " + length);

plot LRS = 6 * ( wma(price, length) -  Average(price, length) ) / (length - 1);
plot ZeroLine = 0;

LRS.setDefaultColor(getColor(8));
ZeroLine.setDefaultColor(getColor(5));

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
VanDriver
Jackson, MS
 
Posts: 34 since Dec 2015
Thanks Given: 1
Thanks Received: 5

Hello, currently, TOS script is not given the ability to interact with mouse over or drawing items. It will not do what you are asking. Yet you can script a second label to appear or change colors when certain criteria occur, such as slope change of x% or from n bars past. Perhaps that idea will help.

Reply With Quote
  #3 (permalink)
madeinnyc
Highland Park, TX
 
Posts: 36 since Jan 2020
Thanks Given: 17
Thanks Received: 20



VanDriver View Post
Hello, currently, TOS script is not given the ability to interact with mouse over or drawing items. It will not do what you are asking. Yet you can script a second label to appear or change colors when certain criteria occur, such as slope change of x% or from n bars past. Perhaps that idea will help.

@VanDriver, I appreciate the idea, Thank you!

Reply With Quote




Last Updated on July 19, 2020


© 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