Inserimento ordine limit e stop contemporaneamente

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #227262 quote
    Fabbri Fausto
    Participant
    New

    Poichè non è possibile inserire contemporaneamente un ordine stop e limit, ho cercato di aggirare il problema con una programmazione che opera su time frame di default di 1 secondo, per prendere quasi ogni variazione di prezzo, e con multiTimeFrame di 1 ora.

    Semplifico:

    timeframe(1 hours, updateonclose)

    myOrdineStop = 0.0001

     

    if close <= high[1] + ordStp * 2 then   //condizione limit

    ord = 1  //condizione rispettata

    endif

     

    IF NOT LongOnMarket then
    IF ord = 1 then
    BUY 1 CONTRACTS AT myOrdineStop STOP
    ENDIF

    Potrebbe funzionare?

    Grazie

    #227264 quote
    robertogozzi
    Moderator
    Master

    Per vedere se funziona devi provarlo.

    Ad ogni modo, perché usi una condizione LIMIT e poi piazzi un ordine STOP?

    Gli ordini LIMIT vanno usati quando il prezzo d’entrata è migliorativo rispetto a quello corrente, STOP quando è peggiorativo.

    Se li piazzi in modo errato entra a mercato (esempio Long:  se il prezzo attuale è 100 e vuoi entrare a 90, devi usare LIMIT, non STOP altrimenti entra A MERCATO, cioè subito).

    #227288 quote
    Fabbri Fausto
    Participant
    New

    Faccio un esempio, forse sbaglio ma la programmazione l’ho fatta così:

    se il prezzo è a 10, io voglio entrare a mercato quando il prezzo raggiunge 11 (ordine stop), ma non deve essere superiore a 12 (ordine limit)

    così concepito può andare bene la programmazione che ripropongo in quanto nell’esempio precedente ho lasciato una riga

    timeframe(1 hours, updateonclose)

    myOrdineStop = 0.0001

     

    if close <= high[1] + ordStp * 2 then   //condizione limit

    ord = 1  //condizione rispettata

    endif

    timeframe(default) //1 secondo

    IF NOT LongOnMarket then
    IF ord = 1 then
    BUY 1 CONTRACTS AT myOrdineStop STOP
    ENDIF

    #227302 quote
    robertogozzi
    Moderator
    Master

    Si, va bene (manca solo un ENDIF finale, ma questo ti verrà segnalato).

    #227305 quote
    Fabbri Fausto
    Participant
    New

    Grazie Roberto

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

Inserimento ordine limit e stop contemporaneamente


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Fabbri Fausto
2 years ago.

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