indicatore media della pendenza

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

    Buongiorno,  dai valori ricavati dalla pendenza di una media esponensiale vorrei ricavare a sua volta la media dei valori della pendenza. Qui ho il codice della pendenza

    Qualche idea per aggiungere la media esponenziale di questi valori?

    mme21 = ExponentialAverage[p]
    
    if (mme21[0] > mme21[1]) then
    pendenza = abs((mme21[0] - mme21[1]) / 10000) * 1000
    else
    pendenza = abs((mme21[1] - mme21[0]) / 10000) * 1000
    endif
    
    return pendenza as "pendenza media esponenziale"
    

    Grazie

    #83397 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Sostituisci l’ultima riga con:

    return exponentialaverage[p](pendenza) as "Ema della pendenza media esponenziale"
    remembers thanked this post
    #83398 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Se usi ABS() non ha senso inserire il calcolo in un blocco IF…ENDIF, basta:

    pendenza = abs((mme21[1] - mme21[0]) / 10000) * 1000

    che vale in entrambi i casi, visto che ABS() toglie il segno “-“.

    remembers thanked this post
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

indicatore media della pendenza


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
remembers @remembers Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
7 years, 11 months ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 10/23/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...