Traduction indicateur croisement RSI avec position cours au dessus des kama150

Forums ProRealTime forum Français Support ProScreener Traduction indicateur croisement RSI avec position cours au dessus des kama150

Viewing 12 posts - 1 through 12 (of 12 total)
  • #242795
    Bonsoir,
    est-il possible d’avoir un screener à partir de cet indicateur ?
    Merci.
    Timeframe (1 hour,updateonclose)
    Period1h = 150
    FastPeriod1h = 2
    SlowPeriod1h = 50
    Fastest1h = 2 / (FastPeriod1h + 1)
    Slowest1h = 2 / (SlowPeriod1h + 1)
    if barindex < Period1h+1 then
    Kama1h=close
    else
    Num1h = abs(closeclose[Period1h])
    Den1h = summation[Period1h](abs(closeclose[1]))
    ER1h = Num1h / Den1h
    Alpha1h = SQUARE(ER1h *(Fastest1h Slowest1h )+ Slowest1h)
    KAMA1h = (Alpha1h * Close) + ((1 Alpha1h)* Kama1h[1])
    endif
    Timeframe (15 minutes,updateonclose)
    /////////////////////////////////////////////////////////////////// parameters KAMA
    Period15min = 150
    FastPeriod15min = 2
    SlowPeriod15min = 50
    Fastest15min = 2 / (FastPeriod15min + 1)
    Slowest15min = 2 / (SlowPeriod15min + 1)
    if barindex < Period15min+1 then
    Kama15min=close
    else
    Num15min = abs(closeclose[Period15min])
    Den15min = summation[Period15min](abs(closeclose[1]))
    ER15min = Num15min / Den15min
    Alpha15min = SQUARE(ER15min *(Fastest15min Slowest15min )+ Slowest15min)
    KAMA15min = (Alpha15min * Close) + ((1 Alpha15min)* Kama15min[1])
    endif
    //————————————-//
    //PRC_RSI Cyclic Smoothed
    //version = 0
    //19.11.2024
    //Iván González @ http://www.prorealcode.com
    //Sharing ProRealTime knowledge
    //————————————-//
    //Inputs
    //————————————-//
    src15min=close
    domcycle15min=20
    cyclelen15min=domcycle15min/2
    vibration15min=10
    leveling15min=10
    cyclicmemory15min=domcycle15min*2
    once crsi15min=0
    //————————————-//
    // CRSI calculation
    //————————————-//
    torque15min=2/(vibration15min+1)
    phasinglag15min=floor((vibration15min1)/2)
    length15min = cyclelen15min
    alpha15min = 1/length15min
    srcUp15min = max(src15minsrc15min[1],0)
    if barindex = length15min then
    up15min = average[length15min](srcUp15min)
    else
    up15min = alpha15min*srcUp15min + (1alpha15min)*up15min[1]
    endif
    srcDw15min = min(src15minsrc15min[1],0)
    if barindex = length15min then
    dw15min = average[length15min](srcdw15min)
    else
    dw15min = alpha15min*srcdw15min + (1alpha15min)*dw15min[1]
    endif
    if dw15min=0 then
    myrsi15min=100
    elsif up15min=0 then
    myrsi15min=0
    else
    myrsi15min=100100/(1+up15min/dw15min)
    endif
    if barindex>cyclicmemory15min then
    crsi15min=torque15min*(2*myrsi15minmyrsi15min[phasinglag15min])+(1torque15min)*crsi15min[1]
    endif
    //————————————-//
    // LowBand and HighBand calculation
    //————————————-//
    Period15min=cyclicMemory15min
    percent15min = leveling15min/100
    periodMinusone15min = period15min1
    maxima15min = 999999.0
    minima15min = 999999.0
    for i15min=0 to periodMinusone15min do
    if crsi15min[i15min] > maxima15min then
    maxima15min = crsi15min[i15min]
    elsif crsi15min[i15min] < minima15min then
    minima15min = crsi15min[i15min]
    endif
    next
    stepfactor15min = (maxima15minminima15min)/100
    lowband15min = 0
    for steps15min=0 to 100 do
    testvalue15min = minima15min+stepfactor15min*steps15min
    below15min=0
    for m15min=0 to periodMinusone15min do
    if crsi15min[m15min]<testvalue15min then
    below15min=below15min+1
    endif
    next
    if below15min/period15min >= percent15min then
    lowband15min = testvalue15min
    break
    endif
    next
    highband15min=0
    for steps15min=0 to 100 do
    testvalue15min=maxima15minstepfactor15min*steps15min
    above15min=0
    for m15min=0 to periodMinusone15min do
    if crsi15min[m15min]>=testvalue15min then
    above15min=above15min+1
    endif
    next
    if above15min/Period15min >= percent15min then
    highband15min=testvalue15min
    break
    endif
    next
    mbb15min = average[50](crsi15min)
    CRSISmooth15min = average[7](crsi15min)
    LongPos =  (kama1h > kama1h[1]) and (close > kama1h) and (kama15min > kama15min[1]) and (close > kama15min) and (CRSI15min crosses over CRSISmooth15min)
    if longpos then
    buy 1 contract at market
    endif
    Timeframe (default)
    ///trailing stop function
    trailingstart = 5 //trailing will start @trailinstart points profit
    trailingstep = 5 //trailing step to move the “stoploss”
    //reset the stoploss value
    IF NOT ONMARKET THEN
    newSL=0
    ENDIF
    //manage long positions
    IF LONGONMARKET THEN
    IF newSL=0 AND closetradeprice(1)>=trailingstart*pipsize THEN
    newSL = tradeprice(1)+trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND closenewSL>=trailingstep*pipsize THEN
    newSL = newSL+trailingstep*pipsize
    ENDIF
    ENDIF
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND tradeprice(1)close>=trailingstart*pipsize THEN
    newSL = tradeprice(1)trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND newSLclose>=trailingstep*pipsize THEN
    newSL = newSLtrailingstep*pipsize
    ENDIF
    ENDIF
    //stop order to exit the positions
    IF newSL>0 THEN
    SELL AT newSL STOP
    EXITSHORT AT newSL STOP
    ENDIF
    // points based STOP LOSS and TRAILING STOP
    // initial STOP LOSS
    SET STOP pLOSS 50
    // trailing stop
    SET STOP pTRAILING 50
    #242798

    a verifier,voici le code et ITF

    1 user thanked author for this post.
    #242800

    merci Fifi743

    j’ai un retour erroné sur l’AUD/JPY (les cours sont au dessous de la KAMA1H. Je pense que la suppression de Updateonclose y est pour quelque chose.

    #242803

    peut etre ,mais on ne peut pas mettre updateonclose dans un screener

    #243070

    @finplus et en modifiant la ligne 82 par if LongPos=1 then
    tu as quoi comme resultat ?

    #243234

    @fifi743  : je vais essayer.

    Merci pour l’idée.

    #243262

    bonjour fifi743, j’ai testé le screener ce matin et il a l’air de fonctionner pour le croisement haussier du RSI.

    Pourrais tu m’écrire le même code pour une entrée courte ShortPos = (kama1h < kama1h[1]) and (close < kama1h) and (kama15min < kama15min[1]) and (close < kama15min) and (CRSI15min crosses under CRSISmooth15min)

    Après je bloque.

    Merci.

    1 user thanked author for this post.
    #243290

    regarde si c’est ok pour toi

    1 user thanked author for this post.
    #243310

    @fifi743, je viens de tester le screener. C’est parfait. Une toute petite chose : le screener renvoie soit un signal = 1 ou un signal = -1 en fonction du choix du critère de tri. Comment puis-je avoir les deux sur un seul rendu ?

    Merci et bon week-end.

    #243311

    rectificatif. C’est ok. Je continue le test et te reviens.

    Bon week end.

    1 user thanked author for this post.
    #243312

    ou tu préfere deux screeners un haussier et l’autre baissier

    #243313

    non non c’est bon comme cela. Il retourne bien la position des cours par rapport à la KAMA1h et la KAMA15min (les deux avec 150 périodes). C’était important pour moi. Par contre, pour mémoire, j’ai toujours aucun retour avec l’indicateur Range Buy & Sell Filter. C’est vraiment étonnant.

    merci encore pour ton aide.

Viewing 12 posts - 1 through 12 (of 12 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login