Jump to content
Medved Trader Forums
  • 0

Trendline Alert on Indicator



Would it be possible to add the Alert function to Trendlines drawn on indicators?  It may be a lot of coding, so for an initial code release, the alert would sound if any unhidden indicator line crossed above or below the trendline.  Follow up code release would include a setting to allow the user to configure the specific indicator line (eg, on a MACD indicator, the MACD line versus the signal line; on ADX, +DMI versus -DMI versus ADX lines).

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

You can (kinda) do this yourself. All you have to do is do a paintbar or scan that would look at the indicator and compare it to the trendline formula.


The trendline formula is Y=X*A+B where


Y = Y value of the trendline

X = X value - basically the timestamp

A = slope

B = offset

if X1, Y1 and X2, Y2 are the anchor points of the trendline then you precalculate the slope and offset thus:

A = (Y2-Y1)/(X2-X1)

B = Y1-X1*A


Of course, X1 and X2 are also timestamps of the anchor points.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...