
Tradingview Pinescript. Add Lines & Alarms to Provided Script
- or -
Post a project like this1069
€100(approx. $116)
- Posted:
- Proposals: 4
- Remote
- #3718724
- Completed
Description
Experience Level: Entry
I have a Tradingview Pinescript which plots the MACD. The MACD Line changes colour based on the MACD Slope. So goes from Red to Blue and Blue to Red. See image.
Requirements:
1. If the MACD Line colour changes from Blue to Red (on Bar Close) - Alarm1 is played
2. If the MACD Line colour changes from Red to Blue (on Bar Close) – Alarm2 is played
3. When the MACD Line Colour changes a vertical line is drawn on the chart. Ability to turn this option on or off. See Example Image
4. If MACD Line Colour changes from Blue to Red, Vertical Line Colour is Red – Vertical line must go through all indicator windows
5. If MACD Line Colour changes from Red to Blue, Vertical Line Colour is Blue – Vertical line must go through all indicator windows
6. Option that only the most current vertical line is shown or All the previous vertical lines are shown.
7. The ability to set the number of Bars that must be Blue or Red (MACD Line) such that the alarm will trigger or not and if the Vertical line is drawn or not. See the attached image: Number of Red Bars; Number of Blue Bars.
So for example:
If Number_of_Blue_Bars >= 10 then a vertical Red line will be drawn and the alarm sound, otherwise not.
So inputs would look like:
Draw Vertical Lines – Yes or No
Draw Most Recent Vertical Line Only or ALL Previous Vertical Lines – Yes or No
Buy Alarm (Alarm2 Sound & Blue Vertical Line) – On or Off
Sell Alarm (Alarm1 Sound & Red Vertical Line) – On or Off
Minimum Number of Blue Bars = Integer Value
Minimum Number of Red Bars = Integer Value
Raw Source Code to be Provided
Current Script:
//@version=1
//@Author: Leen
study(title="MACD", shorttitle="MACD", overlay=false)
fastMA = input(title="Standard MACD - Fast Length", type = integer, defval = 12)
slowMA = input(title="Standard MACD - Slow Length", type = integer, defval = 26)
MACDLine = ema(close, fastMA) - ema(close, slowMA)
UpDown1 = MACDLine > MACDLine[1]
MACDColor = UpDown1 ? color(blue, 0) : color(red, 2)
plot(MACDLine, title = "MACD Line", linewidth = 3, style = line, color = MACDColor)
plot(0,title = "Zero line", linewidth = 1,color = black)
Requirements:
1. If the MACD Line colour changes from Blue to Red (on Bar Close) - Alarm1 is played
2. If the MACD Line colour changes from Red to Blue (on Bar Close) – Alarm2 is played
3. When the MACD Line Colour changes a vertical line is drawn on the chart. Ability to turn this option on or off. See Example Image
4. If MACD Line Colour changes from Blue to Red, Vertical Line Colour is Red – Vertical line must go through all indicator windows
5. If MACD Line Colour changes from Red to Blue, Vertical Line Colour is Blue – Vertical line must go through all indicator windows
6. Option that only the most current vertical line is shown or All the previous vertical lines are shown.
7. The ability to set the number of Bars that must be Blue or Red (MACD Line) such that the alarm will trigger or not and if the Vertical line is drawn or not. See the attached image: Number of Red Bars; Number of Blue Bars.
So for example:
If Number_of_Blue_Bars >= 10 then a vertical Red line will be drawn and the alarm sound, otherwise not.
So inputs would look like:
Draw Vertical Lines – Yes or No
Draw Most Recent Vertical Line Only or ALL Previous Vertical Lines – Yes or No
Buy Alarm (Alarm2 Sound & Blue Vertical Line) – On or Off
Sell Alarm (Alarm1 Sound & Red Vertical Line) – On or Off
Minimum Number of Blue Bars = Integer Value
Minimum Number of Red Bars = Integer Value
Raw Source Code to be Provided
Current Script:
//@version=1
//@Author: Leen
study(title="MACD", shorttitle="MACD", overlay=false)
fastMA = input(title="Standard MACD - Fast Length", type = integer, defval = 12)
slowMA = input(title="Standard MACD - Slow Length", type = integer, defval = 26)
MACDLine = ema(close, fastMA) - ema(close, slowMA)
UpDown1 = MACDLine > MACDLine[1]
MACDColor = UpDown1 ? color(blue, 0) : color(red, 2)
plot(MACDLine, title = "MACD Line", linewidth = 3, style = line, color = MACDColor)
plot(0,title = "Zero line", linewidth = 1,color = black)

Joseph L.
100% (21)Projects Completed
16
Freelancers worked with
10
Projects awarded
68%
Last project
15 Dec 2024
Ireland
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies