Candles red, Candles green – period

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #203850 quote
    bearbullbearbull
    Participant
    Average

    Hi,

    I am using the coral moving average which flashes green and red. Is there something that measures over a set period and would tell you which is greater…………….the red side of the indicator or the green side in percentage terms say?

    Or is there a way of setting the indicator for that?

     

    Thanks

    #204009 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    I’ll make an example with a 10-period Simple Moving Average (you will easily replace it with any other one of your choice) over the last N bars:

    N = 20
    Sma     = average[10,0](close)
    Green   = Sma > Sma[1]
    Red     = Sma < Sma[1]
    tallyG  = summation[N](Green)
    tallyR  = summation[N](Red)
    Return tallyG AS "Green SMA",tallyR AS "Red SMA"

    Set the two returned values as (coloured) histograms, if you don’t love lines.

    x-2.jpg x-2.jpg
Viewing 2 posts - 1 through 2 (of 2 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

Candles red, Candles green – period


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
bearbull @bearbull Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
3 years, 10 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/09/2022
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...