PIN BAR EMA21 EMA200

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #182351 quote
    sivispacemsivispacem
    Participant
    Junior

    Buonasera a tutti,

    avrei bisogno di un aiuto. Mi piacerebbe realizzare una strategia uno screener di questo tipo :

    Long –> INGRESSO SU HAMMER CHE TOCCA LA MEDIA MOBILE 21. CON EMA21 > EMA200

    Short –> INGRESSO SU SHOOTING STAR CHE TOCCA LA MEDIA MOBILE 21. CON EMA21 < EMA200

    Allego immagini per comprendere meglio le entrate e le uscite.

    Grazie in anticipo.

    Fausto

    HammerEma21Ema200.jpg HammerEma21Ema200.jpg ShootingEMA21Ema200.jpg ShootingEMA21Ema200.jpg
    #182420 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Eccolo (l’ho provato sul DAX, H1, 200K unità):

    DEFPARAM CumulateOrders = false
    //
    body         = close-open
    abody        = abs(body)
    if range > 0 then
       ratio     = abody / range
    else
       ratio     = 0
    endif
    bodytop      = max(open, close)
    bodybottom   = min(open, close)
    shadowtop    = high-bodytop
    shadowbottom = bodybottom-low
    longcandle   = (ratio > 0.6)
    //
    Hammer       = (body[1]<0 and longcandle[1] and low<low[1]   and shadowbottom>2*abody and shadowtop<0.3*abody)
    ShootingStar = (body[1]>0 and longcandle[1] and high>high[1] and shadowtop>2*abody    and shadowbottom<0.3*abody)
    //
    Ema21        = average[21,1](close)
    Ema200       = average[200,1](close)
    //
    // Condizioni LONG
    CondL1       = Ema21 > Ema200
    CondL2       = low  <= Ema21
    CondL3       = close > Ema21
    CondL        = CondL1 AND CondL2 AND CondL3 AND Not LongOnMarket  AND Hammer
    //
    // Condizioni SHORT
    CondS1       = Ema21 < Ema200
    CondS2       = high  >= Ema21
    CondS3       = close < Ema21
    CondS        = CondS1 AND CondS2 AND CondS3 AND Not ShortOnMarket AND ShootingStar
    //
    IF CondL THEN
       BUY 1 CONTRACT AT MARKET
    ELSIF CondS THEN
       SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    #182427 quote
    sivispacemsivispacem
    Participant
    Junior

    Ciao, grazie.

    Gentilissimo sempre.

    Purtroppo mi dice che ci sono condizioni “Cumulate”, “Buy”, etc…che valgono solo per la sezione ProBacktest e non per Proscreener.

    Mi puoi aiutare?

    Grazie, ciao

    #182430 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Non avevo fatto caso al fatto che hai pubblicato nel forum ProScreener, ho solo letto la tua richiesta di una strategia e l’ho creata.

    Appena possibile la converto in uno screener.

    #182434 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Eccolo:

    body         = close-open
    abody        = abs(body)
    if range > 0 then
       ratio     = abody / range
    else
       ratio     = 0
    endif
    bodytop      = max(open, close)
    bodybottom   = min(open, close)
    shadowtop    = high-bodytop
    shadowbottom = bodybottom-low
    longcandle   = (ratio > 0.6)
    //
    Hammer       = (body[1]<0 and longcandle[1] and low<low[1]   and shadowbottom>2*abody and shadowtop<0.3*abody)
    ShootingStar = (body[1]>0 and longcandle[1] and high>high[1] and shadowtop>2*abody    and shadowbottom<0.3*abody)
    //
    Ema21        = average[21,1](close)
    Ema200       = average[200,1](close)
    //
    // Condizioni LONG
    CondL1       = Ema21 > Ema200
    CondL2       = low  <= Ema21
    CondL3       = close > Ema21
    CondL        = CondL1 AND CondL2 AND CondL3 AND Hammer
    //
    // Condizioni SHORT
    CondS1       = Ema21 < Ema200
    CondS2       = high  >= Ema21
    CondS3       = close < Ema21
    CondS        = CondS1 AND CondS2 AND CondS3 AND ShootingStar
    //
    x = 0
    IF CondL THEN
       x = 1
    ELSIF CondS THEN
       x = 2
    ENDIF
    SCREENER[x](x AS "1=Ham,2=Shoot")
    #182440 quote
    sivispacemsivispacem
    Participant
    Junior

    Grazie davvero tanto Roberto.

    Mi ritorna perfettamente il settaggio.

    Grazie davvero.

    A presto, Fausto

    robertogozzi thanked this post
Viewing 6 posts - 1 through 6 (of 6 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

PIN BAR EMA21 EMA200


ProScreener: Scansione Mercati & Screener

New Reply
Author
author-avatar
sivispacem @sivispacem Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by sivispacemsivispacem
4 years, 9 months ago.

Topic Details
Forum: ProScreener: Scansione Mercati & Screener
Language: Italian
Started: 11/26/2021
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...