Stop sui minimi delle ultime 5 candele

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

    Ciao a tutti,

    Vorrei impostare un sistema che abbia come Stop Loss il minimo delle ultime 5 candele calcolato nel momento di apertura della posizione. E’ corretto il codice come l’ho scritto?

    Grazie in anticipo per la disponibilità

    Ind1 = Average[50](close)
    Ind2 = Average[200](close)
    
    Col1 = (ind1 crosses over ind2)
    
    //Minimo delle ultime 5 candele
    PrezzoStop = lowest[5](low)
    
    
    IF Col1 then
    BUY 1 CONTRACT AT MARKET
    Set Stop Price PrezzoStop
    ENDIF
    
    SET TARGET PPROFIT 10
    
    #236423 quote
    robertogozzi
    Moderator
    Master

    Si, è corretto perché anche se PrezzoStop cambia ad ogni barra, viene utilizzato comunque il valore al momento dell’entrata.

    Però la riga 10 devi cambiarla in

    IF Col1 AND Not OnMarket  then

    altrimenti fai entrate multiple ed inoltre ti varierebbe lo stop loss ogni volta che Col1 è vera, anche se sei già a mercato.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Stop sui minimi delle ultime 5 candele


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
MICH @mich Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
1 year, 5 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 08/15/2024
Status: Active
Attachments: No files
Logo Logo
Loading...