NexusFi: Find Your Edge


Home Menu

 





Linear Regression Slope Angle Label


Discussion in ThinkOrSwim

Updated
    1. trending_up 2,696 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?
MC PL editor upgrade
MultiCharts
Quantum physics & Trading dynamics
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
ZombieSqueeze
Platforms and Indicators
About a successful futures trader who didnt know anythin …
Psychology and Money Management
 
  #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