Onchart Kase Peak 2 Colored

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #130617 quote
    finplus
    Participant
    Master

    Bonjour,

    j’ai récupéré ce code sur ce site et j’aimerai uniquement avoir la partie du code qui représente la partie du bas de l’image. Quelqu’un peut il m’aider SVP ? Merci.

    //PRC_OnChart Kase Peak 2 Coloured | indicator
    //08.09.2018
    //Ale @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //WWW.AUTOMATICTRADING.IT
     
    DEFPARAM CALCULATEONLASTBARS=1000
    ///////////////////////INDICATOR_KASE PEAK2
    maPrice = customclose
    // --- 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 = 1 //1=true ; 0=false
    AveragePeriod=20
    AverageMethod=1
    TightenChannel=5
    ATRperiod=20
    // --- 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
     
    ///////////////////////////////////////////////////
     
    dTR = 0
    for i = 0to ATRperiod-1
     dTR=dTR+max(abs(Dhigh(i)-Dlow(i)),max(abs(Dhigh(i)-Dclose(i+1)),abs(Dlow(i)-Dclose(i+1))))
    next
    dtr=dtr/MAX(1,TightenChannel)
    avgRange = dTR
     
    maValue = average[max(1,AveragePeriod),AverageMethod](maPrice)
    KPMValue=kpMBuffer
    KPOValue=kpoBuffer
    KPHValue=kphBuffer
    KPDValue=kpdBuffer
    KPPValue=kppBuffer
    Buffer1=maValue
    Buffer4=maValue+(KPMValue)/100*avgRange
    buffer5=maValue+(KPOValue)/100*avgRange
    buffer6=maValue+(KPHValue)/100*avgRange
    buffer7=maValue+(KPDValue)/100*avgRange
    buffer8=maValue+(KPPValue)/100*avgRange
     
    r = 50+(100-(KPHBUFFER))*2
    g = 50+(100+(KPHBUFFER))*2
    DRAWCANDLE(open, high, low, close)coloured(R,G,50)
    IF not ViewHistogram then
     buffer6=mavalue
     buffer5=mavalue
    endif
     
    DRAWCANDLE(open, high, low, close)coloured(R,G,50)
    DRAWSEGMENT(barindex, maValue, barindex,buffer6)coloured(0,0,50,50)
     
    return Buffer1 coloured(0,0,0) style(line,1) as "0 level", Buffer4 coloured(0,191,255) style(LINE,2) as "KPM",Buffer5 coloured(255,0,255) style(LINE,2) as "KPO",Buffer6 coloured(R,G,50) style(LINE,2) as "KPH",Buffer7 coloured(255,0,255) style(LINE,2) as "KPD",Buffer8 coloured(155,30,255) style(LINE,2) as "KPP"
    
    Capture-d’écran-2020-05-08-à-14.46.14.png Capture-d’écran-2020-05-08-à-14.46.14.png
    #131068 quote
    Nicolas
    Keymaster
    Master

    Si tu veux parler de l’oscillateur dans la fenêtre du dessous, alors tu n’as pas récupéré le bon code. As-tu cherché les sujets qui portent sur le “Kase Peak” ?

    #131086 quote
    finplus
    Participant
    Master

    oui je parle bien de l’oscillateur dans la fenêtre. Non, je n’ai pas cherché dans la mesure où il me semblait que son code était intégré dans le code que j’ai inséré. Je vais faire une recherche. Merci.

    #131151 quote
    finplus
    Participant
    Master

    Rebonjour,

    je n’ai pas retrouvé dans mes recherches l’oscillateur tel qu’il apparaît dans la fenêtre du bas (le rendu au niveau des couleurs m’intéresse énormément). Une aide serait appréciable. Merci encore.

    #131166 quote
    Nicolas
    Keymaster
    Master

    Le code n’étant pas disponible, je l’ai refait pour t’être appréciable 🙂

    //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
    r = 50+(100-(KPHBUFFER))*2
    g = 50+(100+(KPHBUFFER))*2
    
    return kphBuffer coloured(r,g,0) style(histogram), kpoBuffer coloured(r,g,0) style(line,2), kpdBuffer coloured(255,0,255), kpmBuffer coloured(0,191,255), kppBuffer coloured(255,0,255) style(histogram,2)
    mcha thanked this post
    kase-peak-colored.png kase-peak-colored.png
    #131180 quote
    finplus
    Participant
    Master

    Merci beaucoup. J’apprécie ! Bonne soirée et soyez prudent.

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

Onchart Kase Peak 2 Colored


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
finplus @finplus Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by finplus
5 years, 10 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 05/08/2020
Status: Active
Attachments: 2 files
Logo Logo
Loading...