Candles red, Candles green – period

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #203850 quote
    bearbull
    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
    robertogozzi
    Moderator
    Master

    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.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

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 robertogozzi
3 years, 3 months ago.

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