Percentage Price Over SMA traduzione da TradingView

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #223280 quote
    Actaru5Actaru5
    Participant
    Veteran

    Buongiorno , su TradingView è inserito e condiviso l’indicatore in questione, questo il codice dall’autore:

    // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © alexgrover
    
    //@version=4
    study("Percentage Price Over SMA","%PMA's")
    min    = input(14,"Minimum MA Length Value",minval=1)
    max    = input(28,"Maximum MA Length Value",minval=1)
    smooth = input(14)
    src    = input(close)
    //------------------------------------------------------------------------------
    csum = cum(src),p = 0
    for i = min to max
        ma = (csum - csum[i])/i
        p := src > ma ? p + 1 : p
    per = p/(max - min + 1)*100
    //------------------------------------------------------------------------------
    plot(per,"%Price Over SMA",#2157f3)
    plot(ema(per,smooth),"Smoothed Result",#e65100)
    a = hline(80),b = hline(20),fill(a,b,#2157f3)

    Ringraziando anticipatamente per la traduzione.

    Saluti

    Percentage-Price-Over-SMA.jpg Percentage-Price-Over-SMA.jpg
    #223317 quote
    jesus1975jesus1975
    Participant
    Veteran
    mini    = 14
    maxi    = 28
    smooth = 14
    src    = close
    //------------------------------------------------------------------------------
    p = 0
    for i = mini to maxi
    ma = average[i](src)
    if src> ma then
    p=p+1
    else
    endif
    next
    per = p/(maxi - mini + 1)*100
    ema=exponentialaverage[smooth](per)
    return per as "%Price Over SMA",ema as "Smoothed Result",80 as "superior",20 as "inferior"
    
    robertogozzi thanked this post
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

Percentage Price Over SMA traduzione da TradingView


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
Actaru5 @actaru5 Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 11/07/2023
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...