créer un screener basé sur TN alerts + RSI + bull trend

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #233433 quote
    francis59francis59
    Participant
    Junior

    Bonjour,

    Serait-il possible de créer un screener qui valide les 3 critères suivants :

    Si ces critères ne sont pas pertinents ou s’il faudrait compléter d’un indicateur supplémentaire, n’hésitez pas à apporter votre connaissance! 🙂

    De même, si ce n’est pas pertinent de créer ce type de screener, ne perdez pas votre temps avec ma demande… 🙂

    D’avance merci et belle journée

    #233482 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Holà. Il suffit d'unifier les indicateurs dans le même code et de supprimer les variables non utilisées et les commandes non adaptées à un écran. Ici vous avez le code :

    // --- settings
    inpPeriod = 9
    once alpha=1.0/max(inpPeriod,1)
    once FLTMIN=ticksize
    if barindex>inpPeriod then
    diff = high - close[1]
    ChangeHigh = ChangeHigh[1] + alpha*(diff - ChangeHigh[1])
    ChangaHigh = ChangaHigh[1] + alpha*(abs(diff) - ChangaHigh[1])
    RSIHigh = 50.0*(ChangeHigh/max(ChangaHigh,FLTMIN)+1)
    endif
    //-----Inputs----------------------------------------//
    length = 9 //Period of evaluation
    smooth = 3 //Period of smoothing
    src = customclose
    Mode = 1 //RSI = 1 / Stochastic = 2 / ADX = 3
    Matype = 2 //Moving average Type - WMA by default
    //---------------------------------------------------//
    //-----Bull and Bear Trends calculation-------------//
    if mode = 2 then //Stochastic
    Bulls = src - lowest[length](src)
    Bears = highest[Length](src)-src
    elsif mode = 3 then //ADX
    Bulls = 0.5*(abs(high-high[1])+(high-high[1]))
    Bears = 0.5*(abs(low[1]-low)+(low[1]-low))
    else //RSI
    Bulls = 0.5*(abs(src-src[1])+(src-src[1]))
    Bears = 0.5*(abs(src-src[1])-(src-src[1]))
    endif
    
    avgbulls = average[length,maType](Bulls)
    avgbears = average[length,maType](Bears)
    
    SmthBulls = average[Smooth,maType](avgbulls)
    SmthBears = average[Smooth,maType](avgbears)
    
    //inputs
    TS = 20 //% Trailing stop
    //TSswitch = 1 // Display Stoploss
    //BGswitch = 1 // Display BG color
    //REswtich = 1 // Display Re-entry
    ////
    wma62 = average[62,2](close)
    wma4 = average[4,2](close)
    tsPercent = TS/100 //Trailing stop
    
    enterlong = wma62>wma62[1] and close>wma4 and close[1]>wma4[1] and close>close[1]
    entershort = wma62<wma62[1] and close<wma4 and close[1]<wma4[1] and close<close[1]
    
    once trailTop = close
    
    if close>trailtop[1] or close<trailtop[1]*(1-tspercent) or entershort then
    trailTop = close
    else
    trailTop = trailTop[1]
    endif
    
    once trailBot = close
    
    if close<trailBot[1] or close>trailBot[1]*(1+tspercent) or enterlong then
    trailBot = close
    else
    trailBot = trailBot[1]
    endif
    
    exitlong = trailTop < trailTop[1]
    exitsh = trailBot > trailBot[1]
    
    if enterlong then
    inlong = 1
    elsif entershort or exitlong then
    inlong = 0
    else
    inlong = inlong[1]
    endif
    
    if entershort then
    inshort = 1
    elsif enterlong or exitsh then
    inshort = 0
    else
    inshort = inshort[1]
    endif
    
    SCREENER[RSIHigh>50 and SmthBulls>SmthBears and (enterlong and not inlong[1])](close as "close")
    
    francis59 thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

créer un screener basé sur TN alerts + RSI + bull trend


ProScreener : Scanners de Marché & Détection

New Reply
Author
author-avatar
francis59 @francis51 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván GonzálezIván González
2 years, 3 months ago.

Topic Details
Forum: ProScreener : Scanners de Marché & Détection
Language: French
Started: 06/03/2024
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...