Indicateur Jack Weinberg

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #31912 quote
    Carl
    Participant
    Average

    Ci-dessous une demande qui a été envoyée à ProRealTime :

    Pourriez-vous svp créer l’indicateur de range de Jack Weinberg ?

    La littérature sur internet est très limitée donc je n’ai trouvé qu’un code pour la plateforme AMIBROKER.

    /* TRI.AFL v 1.00 17/10/2001
    /* TRI - The Range Indicator
    /* Developed by Jack L. Weinberg
    /* From Technical Analysis of Stocks and Commodities, V13:6 (238-242)
    /* Coded by Marek Chlopek, October 2001
    /* Support from Tomasz Janeczko and Amibroker Mailing List members - THANKS!!!
    */
     
    /* **************************************************************************
    */
    /* StochRange - first step in constructing the TRI
    /* StochRange - an oscillator of the ratio of the daily true range with the intraday range
    /* Value1 - Today's True Range divided by today's close minus yesterday's close unless C-Ref(C,-1) < 0 then Value1 = True Range
    /* Value2 - the lowest value of Value1, over the last q days
    /* Value3 - the highest value of Value1, over the last q days */
    q = 10; /* stochastic period */
    Value1 = IIf(Close > Ref(Close, -1), ATR(1) / (Close - Ref(Close, -1)), ATR(1));
    Value2 = LLV(Value1, q);
    Value3 = HHV(Value1, q);
    StochRange = IIf((Value3 - Value2) > 0, 100 * (Value1 - Value2) / (Value3 - Value2), 100 * (Value1 - Value2));
     
    /* The Range Indicator - TRI by J.L Weinberg
    /* The Range Indicator - smooth StochRange using an exponential moving average
    of m periods */
    m = 3; /* exponential smoothing period */
    TRI = EMA(StochRange, m);
     
    /* **************************************************************************
    */
    /* Graphic presentation in Amibroker */
    MaxGraph = 1;
    Graph0 = TRI;
    Title = Name() + " - TRI = " + WriteVal(Graph0, 1.2) + " %";
     
    /* **************************************************************************
    */
    /* Exploration in Amibroker */
    Filter = 1;
    NumColumns = 2;
    Column0 = StochRange;   Column0Name = "StochRange"; Column0Format = 1.2;
    Column1 = TRI;      Column1Name = "TRI";        Column1Format = 1.2;
     
    /* **************************************************************************
    */
    /* END TRI Indicator Formula */

     

    Et une proposition de réponse :

    Once period = 10
    Once smoothing = 3
    
    atr = AverageTrueRange[1](Close)
    value1 = atr
    If Close > Close[1] then
       value1 = atr / (Close - Close[1])
    Endif
    
    value2 = Lowest[period](value1)
    value3 = Highest[period](value1)
    
    stochRange = 100*(value1 - value2)
    If (value3 - value2) > 0 then
       stochRange = 100*(value1 - value2) / (value3 - value2)
    Endif
    
    tri = ExponentialAverage[smoothing](stochRange)
    
    Return tri as "TRI"
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Indicateur Jack Weinberg


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Carl @carl Participant
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 04/13/2017
Status: Active
Attachments: No files
Logo Logo
Loading...