sell/buy rates

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #192462 quote
    lowbat
    Participant
    Senior

    //
    // @author LonesomeTheBlue
    //
    //@version=3
    study(“Sell / Buy Rates”, overlay = false, precision = 0)
    prd = input(title=”Period”, defval = 34, minval = 1)

    tw = high – max(open, close)
    bw = min(open, close) – low
    body = abs(close – open)

    _rate(cond) => 0.5 * (tw + bw + (cond ? 2 * body : 0)) / (tw + bw + body)

    volup = volume * _rate(open <= close) voldown = volume * _rate(open >= close)
    rate = linreg(volup – voldown, prd, 0)

    col = rate > 0 ? (falling(rate, 5) ? green : lime) : rate < 0 ? rising(rate, 5) ? maroon : red : na plot(rate, color = col, style = columns)

    1.png 1.png
    #192543 quote
    robertogozzi
    Moderator
    Master

    Eccolo:

    tw   = high - max(open,close)
    bw   = min(open,close) - low
    body = abs(close - open)
    IF (open <= close) THEN
       voldown = (0.5 * (tw + bw + (body * 2))) / (tw + bw + body)
    ELSE
       voldown = (0.5 * (tw + bw)) / (tw + bw + body)
    ENDIF
    IF (open > close) THEN
       volup   = (0.5 * (tw + bw + (body * 2))) / (tw + bw + body)
    ELSE
       volup   = (0.5 * (tw + bw)) / (tw + bw + body)
    ENDIF
    MyRate     = LinearRegression[34](volup - voldown)
    RETURN MyRate AS "Sell / Buy Rates"

    con le proprietà potrai definirlo come istogramma e deciderne i colori.

    lowbat thanked this post
    Sell-Buy-RATES.itf x.jpg x.jpg
    #192556 quote
    lowbat
    Participant
    Senior

    Grazie Roberto

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

sell/buy rates


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
lowbat @lowbat Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 04/30/2022
Status: Active
Attachments: 3 files
Logo Logo
Loading...