Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------------------------------------------*(Leazione 24 Personale Tipi Di Ordini)*--------------------------------------------
- Ci sono vari tipi di ordini che possono essere eseguiti:
- Market: Eseguiti al verificarsi di una condizione specifica "un incrocio", "una media" etc...
- Di solito con i trading system vengono eseguiti alla chiusura della candela
- Sullo study di tradingview possono inviare un segnale
- Limit: Eseguiti ad un prezzo specifico sia in target che in stop
- Di solito con i trading system a differenza dei market non aspettano la chiusura della candela
- Sullo study di tradingview possono inviare un segnale "Sono ordini più difficili da configurare"
- //entrata e uscita Long
- if cond_long// and strategy.opentrades == 0
- strategy.entry('operazioneLong', strategy.long) "Entrata Market chiusura candela"
- strategy.exit('SL e TP', from_entry='operazioneLong', loss=stop_loss_long, profit=take_profit_long) "Uscita Limit no chiusura candela"
- if cond_exit_long and strategy.opentrades == 1
- strategy.close('operazioneLong') "Uscita Market chiusura candela"
- -------------------------------- INGRESSO USCITE POSIZIONI PREZZO O TICKS --------------------------------
- Sulle uscite delle posizioni ci sono 2 modi per calcolare gli stop o i take profit: in modalità prezzo o in modalità ticks:
- uscita (stop/limit x prezzo) (loss/profit x ticks)
- // Entrata
- if (CondEntryLong1 or CondEntryLong2) and strategy.opentrades == 0
- strategy.entry('operazioneLong', strategy.long, alert_message = "Open Long Position",
- // Uscita Prezzo
- if strategy.opentrades ==1
- strategy.exit('SL e TP', from_entry='operazioneLong', stop = stop_loss_long_price, limit = take_profit_long_price, alert_message = "Your Long SL-TP Has Been Triggered."
- ---------- ---------- ---------- ---------- ----------
- // Entrata
- // Con "GMT+2" Prendo L'orario Corrente E Non L'orario Della Borsa
- longCondition = close > massimi and hour(time, "GMT+2") > 13 and hour(time, "GMT+2") < 18
- if longCondition
- strategy.entry("long", strategy.long)
- strategy.exit("long", profit=2250, loss=600)
- // Uscita Ticks
- shortCondition = close < minimi and hour(time, "GMT+2") > 13 and hour(time, "GMT+2") < 18
- if longCondition
- strategy.entry("short", strategy.long)
- strategy.exit("short", profit=2250, loss=600)
Add Comment
Please, Sign In to add comment