MACD LINE CHANGING COLOR

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #212975 quote
    MaryMary
    Participant
    Average

    Hello,

    Can you please help with what code to use to program MACD Line to be changing colors.

    Thank you in advance.

    MACD-LINE-CHANGE-COLOR.png MACD-LINE-CHANGE-COLOR.png
    #212997 quote
    NicolasNicolas
    Keymaster
    Legend

    Here is how to color the MACDline based on its ascending or descending slope:

    a = MACDline[12,26,9](close)
    if a>a[1] then 
     red=0
     green=255
    elsif a<a[1]then 
     red=255
     green=0
    endif 
    
    return a coloured(red,green,0)
    Mary thanked this post
    #213018 quote
    JSJS
    Participant
    Master

    Hi,

    Including SignalLine…

    a = MACDline[12,26,9](close)
    b = MACDSignal[12,26,9](close)
    if a>a[1] then
    red=0
    green=255
    elsif a<a[1]then
    red=255
    green=0
    endif
    
    if b>b[1] then
    redsignal=0
    greensignal=255
    elsif b<b[1]then
    redsignal=255
    greensignal=0
    endif
    
    return a as "MACDline" coloured(red,green,0),b as "SignalLine" coloured(redsignal,greensignal,0) style(DottedLine)
    Mary thanked this post
    Scherm­afbeelding-2023-04-07-om-16.18.30.png Scherm­afbeelding-2023-04-07-om-16.18.30.png
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

MACD LINE CHANGING COLOR


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Mary @mila Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by JSJS
3 years, 5 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 04/07/2023
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...