Entrata con Supertrend dopo divergenza

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #138547 quote
    michelebazzonimichelebazzoni
    Participant
    New

    Buongiorno

    vorrei implementare una strategia ovvero alla identificazione di una divergenza sul CCI  col supetrend:

    Identificazione divergenza rialzista -> entrata long quando il supertrend diventa verde e stop quando il supetrend diventa rosso.

    Identificazione divergenza ribassista -> entrata short quando il supertrend diventa rosso e stop quando il supetrend diventa verde.

    Se possibile inserire anche un tempo limite per l’entrata es. dopo 10 barre dalla segnalazione della divergenza se non è partita l’entrata, annullare l’operazione.

    Riporto di seguito il codice che ho fatto per individuazione della divergenza col CCI.

    Period = 20
    OverSold = -150
    OverBought = 150
    MinBarRange = 5
    
    Rge = averagetruerange[10](close)
    MyCCI = cci[Period](typicalprice)
    
    ONCE ShiftText = 3
    
    CCIMax = MyCCI < MyCCI[1] and MyCCI[1] > MyCCI[2] and MyCCI[1] > OverBought
    CCIMin = MyCCI > MyCCI[1] and MyCCI[1] < MyCCI[2] and MyCCI[1] < OverSold
    
    if CCIMax then
    CCIMax1 = MyCCI[1]
    High1 = High[1]
    
    for I = MinBarRange to  80
    if CCIMax[I] then
    CCIMax2 = MyCCI[I + 1]
    High2 = High[I + 1]
    If High1 > High2 and RSIMax1 < RSIMax2 then
    DRAWARROWDOWN(barindex, High + Rge / ShiftText)coloured(255,192,203,255)
    DRAWTEXT("dd", barindex, High + Rge / ShiftText / 0.3,SansSerif,Italic,10)coloured(0,0,255,255)
    endif
    break
    endif
    next
    endif
    
    if CCIMin then
    CCIMin1 = MyCCI[1]
    Low1 = Low[1]
    
    for I = MinBarRange to  80
    if CCIMin[I] then
    CCIMin2 = MyCCI[I + 1]
    Low2 = Low[I + 1]
    If Low1 < Low2 and RSIMin1 > RSIMin2 then
    DRAWARROWUP(barindex, lOW - Rge / ShiftText)coloured(0,0,255,255)
    DRAWTEXT("dd", barindex, lOW - Rge / ShiftText / 0.3,SansSerif,Italic,10)coloured(0,0,255,255)
    endif
    break
    endif
    next
    endif
    
    return
    
    #145823 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Posta il codice funzionante, altrimenti è impossibile creare qualcosa.

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

Entrata con Supertrend dopo divergenza


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
5 years, 12 months ago.

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