stop e target diversi

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #198721 quote
    leo di mennoleo di menno
    Participant
    Average

    salve, come potrei fare per mettere stop e target diversi tra long e short? ho provato a metterli in un ulteriore riga if,,, tipo

    if longonmarket then
    set stop %loss 1.72
    set target %profit 9.3
    endif
    if shortonmarket then
    set stop %loss 0.8
    set target %profit 4.7
    endif

    frunziona bene cosi però mi piazza gli stop e target un ora dopo gli ingressi con tf ad 1 ora, ho provato a metterli nella riga if delle condizioni di ingresso

    if mie condizioni then

    buy 1 share at market

    set stop loss x

    set target profit y

    endif

    facendo cosi mi confonde quelli dei long con quelli degli short…. qual’è il modo corretto per metterli contemporaneamente agli ordini?

    grazie

    #198729 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Va bene il secondo esempio:

    if mie condizioniLONG  then
       buy 1 share at market
       set stop   loss   x
       set target profit y
    elsif mie condizioniSHORT then
       sellshort 1 share at market
       set stop   loss   x1
       set target profit y1
    endif

    non si confondono, in quanto hanno valori diversi e NON possono essere entrambi i tipi a mercato contemporaneamente.

    #198739 quote
    MaoRai54MaoRai54
    Participant
    Master

    Anch’io spesso uso diversi SL e TP per short e long.

    Visto che tu usi TF 1h, il mio modo per settarli in modo che vedano gli obiettivi senza aspettare la fine dell’ora è usare 2 TF.

    Per esempio:

    Timeframe (1h, updateonclose)

    if mie condizioniLONG  then

       buy 1 share at market
      
    else
    if mie condizioniSHORT then
       sellshort 1 share at market
    endif
    endif
    Timeframe (3 minutes, default)
    if longonmarket then
    set stop ploss x
    set target pprofit y
    else
    if shortonmarket then
    set stop ploss x1
    set target pprofit y1
    endif
    endif
    Prego Roberto e Nicolas di commentare questo mio metodo. Grazie
    #198742 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Va bene, ma perché attendere 3 minuti per settarli, quando puoi metterli subito all’entrata?

    Timeframe (1h, updateonclose)
    if mie condizioniLONG  then
       buy 1 share at market
       set stop ploss x
       set target pprofit y
    else
    if mie condizioniSHORT then
       sellshort 1 share at market
       set stop ploss x1
       set target pprofit y1
    endif
    endif
    Timeframe (3 minutes, default)
     .
     .
    #198747 quote
    MaoRai54MaoRai54
    Participant
    Master

    @ ROBERTO

    Scusa ma se li metto sopra, come dici tu, il sistema controlla TP e SL ogni ora, alla chiusura della candela, mentre se li metto come ho fatto io il controllo è fatto ogni 3 minuti.

    Giusto o sbaglio ?

    #198750 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    No, quelli settati dal sistema vengono comunicati al broker al momento dell’apertura e restano li finchè non li modifichi tu o fino alla chiusura dell’operazione. Li gestisce il broker in tempo reale.
    Sono le uscite usando ordini pendenti dall’interno della strategia (in particolare i trailing stop) che vengono eseguiti solo alla chiusura di ogni candela, per cui tra H1 e 1 mninuto ci può essere una bella differenza!

    MaoRai54 thanked this post
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

stop e target diversi


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by robertogozzirobertogozzi
4 years, 1 month ago.

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