INSERIRE LINEE ORIZZONTALI SUL PREZZO DA INDICATORE KASE

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #84547 quote
    tradingpro
    Participant
    Senior

    VORRE INSERIRE LE LINEE ORIZZONTALI SUL PREZZO ALLA CHIUSURA  COME DA ALLEGATO .

    GRAZIE

    KASE.png KASE.png
    #84651 quote
    robertogozzi
    Moderator
    Master

    Questo è un indicatore a se stante che stampa una line orizzonatale alla chiusura della candela:

    DEFPARAM DrawOnLastBarOnly = True
    DRAWHLINE(close) COLOURED(0,255,0,255)
    RETURN

    Per inserirlo all’interno di un altro indicatore (purché tu abbia il codice sorgente modificabile) basta che aggiungi la linea:

    DRAWHLINE(Prezzo) COLOURED(0,255,0,255)

    sostituendo a PREZZO il valore dove vuoi la linea, CLOSE, OPEN, una MEDIA o qualunque altra cosa t’interessi eveidenziare.

    #86589 quote
    tradingpro
    Participant
    Senior
    salve volevo inserire questo indicatore nel grafico del prezzo 
    grazie
    
    
    //PRC_Kase Peak Oscillator V2 | indicator
    //19.07.2017
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //translated from MT4 code
    
    // --- settings
    //kpoDeviations  = 2.0 // Kase peak oscillator deviations
    //kpoShortCycle  = 8   // Kase peak oscillator short cycle
    //kpoLongCycle   = 65  // Kase peak oscillator long cycle
    //kpoSensitivity = 40
    //allPeaksMode = 0 //1=true ; 0=false
    // --- end of settings
    
    if barindex>kpoLongCycle*2 then
    ccLog = Log(Close[0]/Close[1])
    ccDev = std[9](ccLog)
    
    avg = average[30](ccDev)
    
    if (avg>0) then
    max1 = 0
    maxs = 0
    
    for k = kpoShortCycle to kpoLongCycle-1 do
    max1 = Max(Log(High[0]/Low[0+k])/Sqrt(k),max1)
    maxs = Max(Log(High[0+k]/Low[0])/Sqrt(k),maxs)
    next
    x1 = max1/avg
    xs = maxs/avg
    endif
    
    xp    = kpoSensitivity*(average[3](x1)-average[3](xs))
    xpAbs = Abs(xp)
    
    kpoBuffer   = xp
    kphBuffer   = xp
    
    tmpVal = average[50](xpAbs)+kpoDeviations*std[50](xpAbs)
    maxVal = Max(90.0,tmpVal)
    minVal = Min(90.0,tmpVal)
    
    if (kpoBuffer > 0) then
    kpdBuffer =  maxVal
    kpmBuffer =  minVal
    else
    kpdBuffer = -maxVal
    kpmBuffer = -minVal
    endif
    
    kppbuffer=0
    if (not allPeaksMode) then
    if (kpoBuffer[1]>0 and kpoBuffer[1]>kpoBuffer[0] and kpoBuffer[1]>=kpoBuffer[2] and kpoBuffer[1]>= maxVal) then
    kppBuffer = kpoBuffer[1]
    endif
    if (kpoBuffer[1]<0 and kpoBuffer[1]<kpoBuffer[0] and kpoBuffer[1]<=kpoBuffer[2] and kpoBuffer[1]<=-maxVal) then
    kppBuffer = kpoBuffer[1]
    endif
    else
    if (kpoBuffer[1]>0 and kpoBuffer[1]>kpoBuffer[0] and kpoBuffer[1]>=kpoBuffer[2]) then
    kppBuffer = kpoBuffer[1]
    endif
    if (kpoBuffer[1]<0 and kpoBuffer[1]<kpoBuffer[0] and kpoBuffer[1]<=kpoBuffer[2]) then
    kppBuffer = kpoBuffer[1]
    endif
    endif
    endif
    
    return kphBuffer coloured(105,105,105) style(histogram), kpoBuffer coloured(105,105,105) style(line,2), kpdBuffer coloured(255,0,255), kpmBuffer coloured(0,191,255), kppBuffer coloured(255,0,255) style(histogram,2)
    
    #86634 quote
    robertogozzi
    Moderator
    Master

    Non puoi inserirlo perché ha una scala troppo diversa dal prezzo, questo oscillatore può andare da -200 a +200 circa, per cui già su Eur/Usd che vale circa 1.1400 vedresti le barre del prezzo tutte piatte (circa 1/200esimo del reale), mentre sul DAX che vale circa 10650 probabilmente non le vedresti neppure tanto sono distanti da quei valori!

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

INSERIRE LINEE ORIZZONTALI SUL PREZZO DA INDICATORE KASE


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
tradingpro @tradingpro Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 11/10/2018
Status: Active
Attachments: 1 files
Logo Logo
Loading...