Tripple Momentum with Errors

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #230021 quote
    gatowman
    Participant
    New

    Hi, i wonna code an Tripple Momentum Indi,
    my code is, but i have Errors, pls help
    Regards gatowman

    //@version=4
    study("Triple Momentum Indikator", shorttitle="TMI", overlay=true)
    
    // Berechne Momentum 1 (letzter Monat)
    mom1 = close / close[1] * 100
    
    // Berechne Momentum 2 (Monate m-1 bis m-3)
    mom2 = close / close[3] * 100
    
    // Berechne Momentum 3 (Monate m-3 bis m-6)
    mom3 = close / close[6] * 100
    
    // Berechne den Durchschnitt der drei Momenta
    avg_momentum = (mom1 + mom2 + mom3) / 3
    
    plot(avg_momentum, color=color.blue, linewidth=2, title="Triple Momentum")
    #230043 quote
    robertogozzi
    Moderator
    Master

    The code is not in the correct language, it requires a conversion.

    Someone might help, sooner or later.

    #230044 quote
    robertogozzi
    Moderator
    Master

    It seems to be an easy translation, try this one:

    //@version=4
    //study("Triple Momentum Indikator", shorttitle="TMI", overlay=true)
    
    // Berechne Momentum 1 (letzter Monat)
    mom1 = close / close[1] * 100
    
    // Berechne Momentum 2 (Monate m-1 bis m-3)
    mom2 = close / close[3] * 100
    
    // Berechne Momentum 3 (Monate m-3 bis m-6)
    mom3 = close / close[6] * 100
    
    // Berechne den Durchschnitt der drei Momenta
    avgmomentum = (mom1 + mom2 + mom3) / 3
     
    return avgmomentum as "Triple Momentum"
    #230061 quote
    JS
    Participant
    Senior

    When I read the accompanying text, I think this is the intention:

    // Berechne Momentum 1 (letzter Monat)
    mom1 = close / close[1] * 100
     
    // Berechne Momentum 2 (Monate m-1 bis m-3)
    mom2 = close[1] / close[3] * 100
     
    // Berechne Momentum 3 (Monate m-3 bis m-6)
    mom3 = close[3] / close[6] * 100
     
    // Berechne den Durchschnitt der drei Momenta
    avgmomentum = (mom1 + mom2 + mom3) / 3
     
    return avgmomentum as "Triple Momentum"
    
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Tripple Momentum with Errors


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
gatowman @gatowman Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by JS
1 year, 10 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/19/2024
Status: Active
Attachments: No files
Logo Logo
Loading...