STRATEGIA PIN BAR E ENGULFING

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #134593 quote
    GaspareGaspare
    Participant
    Veteran

    Salve

    non riesco a trovare nessuna strategia sulle pin bar, sia long che short:

    le candele potrebbero avere un corpo del 20- 25% e l’ombra del 75-80%.

    Si puo’ avere un codice relativo? Grazie

    Se possibile aggiungere anche Bearish e Bullish Engulfing, sarebbe un ottimo codice. Grazie

    #134595 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Basta che cerchi PINBAR e troverai molte cose, tra cui:

    https://www.prorealcode.com/topic/strategia-pinbar/

    #135205 quote
    GaspareGaspare
    Participant
    Veteran

    Ciao Roberto,grazie

    ho visto ma  io chiederei, cortesemente, un TS che faccia quanto segue:

    candela con un corpo variabile tra il 10 e 30% dell’intero range, mentre l’ombra varia dal 70 al 90%

    media esponenziale in chiusura a 21 periodi

    si va short se siamo sotto la media, se ha rotto il massimo della candela precedente,  con un ordine stop sell sotto il minimo della pinbar entro le prossime 3 candele successive e stop loss limite al massimo della stessa pinbar + 5 pip

    si va long se siamo sopra la media, se ha rotto il minimo della candela precedente, con un ordine stop long sopra il massimo della pinbar entro le prossime 3 candele successive e stop loss limite sotto il minimo della stessa pinbar + 5 pip.

    Ti ringrazio per la tua collaborazione.

    #135255 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Eccola:

    DEFPARAM CumulateOrders = false
    //
    ONCE MaxBars = 3
    ONCE Flag    = 1
    //
    IF StrategyProfit <> StrategyProfit[1] THEN
       Flag      = 0
    ENDIF
    //
    //Bullish    = close > open
    //Bearish    = close < open
    Body         = abs(close - open)
    UpperShadow  = high - max(close,open)
    LowerShadow  = min(close,open) - low
    Ema21        = average[21,1](close)
    //
    // Condizioni LONG
    //
    L1           = (Body >= (Range * 0.10)) AND (Body <= (Range * 0.30))
    L2           = (LowerShadow >= (Range * 0.70)) AND (LowerShadow <= (Range * 0.90))
    L3           = close > Ema21
    L4           = close < low[1]
    LongCond     = L1 AND L2 AND L3 AND L4
    IF LongCond AND Not OnMarket THEN
       EntryLong = high + 1 * pipsize
       SLlong    = abs(EntryLong - (low - 5 * pipsize))
       TPlong    = SLlong * 2
    ENDIF
    IF LongCond  AND Not OnMarket THEN
       Flag      = 1
    ENDIF
    IF Flag = 0 THEN
       LongCond = 0
    ELSE
       IF summation[MaxBars](LongCond) THEN
          BUY 1 Contract AT EntryLong STOP
          SET TARGET PROFIT TPlong
          SET STOP   LOSS   SLlong
       ELSE
          LongCond = 0
       ENDIF
    ENDIF
    //
    //Condizioni SHORT
    //
    S1           = L1
    S2           = (UpperShadow >= (Range * 0.70)) AND (UpperShadow <= (Range * 0.90))
    S3           = close < Ema21
    S4           = close > high[1]
    ShortCond    = S1 AND S2 AND S3 AND S4
    IF ShortCond AND Not OnMarket THEN
       EntryShort   = low - 1 * pipsize
       SLshort      = abs(EntryShort - (high + 5 * pipsize))
       TPshort      = SLshort * 2
    ENDIF
    IF ShortCond AND Not OnMarket THEN
       Flag      = 1
    ENDIF
    IF Flag = 0 THEN
       ShortCond = 0
    ELSE
       IF summation[MaxBars](ShortCond) THEN
          SELLSHORT 1 Contract AT EntryShort STOP
          SET TARGET PROFIT TPshort
          SET STOP   LOSS   SLshort
       ELSE
          ShortCond = 0
       ENDIF
    ENDIF
    #135366 quote
    GaspareGaspare
    Participant
    Veteran

    Ciao Roberto

    scusami ma il ts non credo che vada bene,

    non apre posizioni sul Gold Wall Wall Street Dax ecc. su TF diversi, 15-60 giornaliero

    Forse qualcosa non va, lo vuoi provare tu?

    Grazie

    #135403 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Usato come indicatore funziona (immagine X):

    Body         = abs(close - open)
    UpperShadow  = high - max(close,open)
    LowerShadow  = min(close,open) - low
    Ema21        = average[21,1](close)
    //
    // Condizioni LONG
    //
    L1           = (Body >= (Range * 0.10)) AND (Body <= (Range * 0.30))
    L2           = (LowerShadow >= (Range * 0.70)) AND (LowerShadow <= (Range * 0.90))
    L3           = close > Ema21
    L4           = close < low[1]
    LongCond     = L1 AND L2 AND L3 AND L4
    //
    //Condizioni SHORT
    //
    S1           = L1
    S2           = (UpperShadow >= (Range * 0.70)) AND (UpperShadow <= (Range * 0.90))
    S3           = close < Ema21
    S4           = close > high[1]
    ShortCond    = S1 AND S2 AND S3 AND S4
    //
    Result       = (1 * LongCond) OR -(1 * ShortCond)
    return Result AS "Result",0 AS "0"

    Però funziona anche la strategia (immagine Y).

    x-5.jpg x-5.jpg y.jpg y.jpg
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

STRATEGIA PIN BAR E ENGULFING


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Gaspare @gaspare Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
6 years, 3 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 06/04/2020
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...