Break out candela IDNR4

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #232979 quote
    Gabriele Battista
    Participant
    Senior

    una volta identificata una candela IDNR4 (di seguito le condizioni per definirla tale)

    inside=(high<high[1]) and (low>low[1]) //candela inside
    narrowrange=(range<(range)[1]) and (range<range[2]) and (range<range[3]) //candela narrow range 4

     

    vorrei entrare LONG o SHORT al break out di massimo e minimo, grazie.

    Carburo thanked this post
    #233006 quote
    Iván González
    Moderator
    Master

    Ciao, ecco il codice per aprire le posizioni. Dovrai solo programmare la partenza:

    inside=(high<high[1]) and (low>low[1]) //candela inside
    narrowrange=(range<(range)[1]) and (range<range[2]) and (range<range[3]) //candela narrow range 4
    
    setup=inside and narrowrange
    
    if not onmarket and setup then
    buy 1 contract at high stop
    sellshort 1 contract at low stop
    endif
    Gabriele Battista and Carburo thanked this post
    #233038 quote
    Gabriele Battista
    Participant
    Senior

    grazie, se volessi mettere un target ed uno stop loss pari al range della candela IDNR4 come dovrei fare?

    Carburo thanked this post
    #233122 quote
    Iván González
    Moderator
    Master

    Di niente. Per inserire una fermata e un target è necessario introdurre 2 righe in più di codice:

    inside=(high<high[1]) and (low>low[1]) //candela inside
    narrowrange=(range<(range)[1]) and (range<range[2]) and (range<range[3]) //candela narrow range 4
    
    setup=inside and narrowrange
    
    if not onmarket and setup then
    buy 1 contract at high stop
    sellshort 1 contract at low stop
    set stop loss range
    set target profit range
    endif
    Carburo thanked this post
    #240772 quote
    Carburo
    Participant
    Junior

    Grazie Ivan,

    ho notato che quando in certi casi il sistema apre la posizione correttamente (p.es. LONG al tocco del massimo della candela IDNR4), la chiude in Stop Loss (al minimo della candela) e immediatamente la riapre (SHORT nel caso dell’esempio) in quanto il prezzo ha battuto almeno due volte al minimo della candela, come si vede nell’immagine.

    L’apertura della seconda posizione è in pratica uno Stop&Reverse, ma poiché a volte non avviene (scattato lo SL, non sempre viene aperta l’operazione contraria) sarebbe bene che il sistema evitasse la seconda posizione.

    C’è modo di evitare l’apertura della seconda posizione nel corso della stessa candela nella quale il sistema ha chiuso la prima posizione?

    Grazie mille.

    Immagine-per-forum-PRC.jpg Immagine-per-forum-PRC.jpg
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Break out candela IDNR4


ProOrder: Trading Automatico & Backtesting

New Reply
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by Carburo
1 year, 3 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 05/24/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...