Maurizio-Ciullo

24 Tipi Di Ordini

May 12th, 2022 (edited)
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -----------------------------------------------*(Leazione 24 Personale Tipi Di Ordini)*--------------------------------------------
  2.  
  3. Ci sono vari tipi di ordini che possono essere eseguiti:
  4.  
  5. Market: Eseguiti al verificarsi di una condizione specifica "un incrocio", "una media" etc...
  6.         Di solito con i trading system vengono eseguiti alla chiusura della candela
  7.         Sullo study di tradingview possono inviare un segnale
  8.  
  9. Limit: Eseguiti ad un prezzo specifico sia in target che in stop
  10.        Di solito con i trading system a differenza dei market non aspettano la chiusura della candela
  11.        Sullo study di tradingview possono inviare un segnale "Sono ordini più difficili da configurare"
  12.  
  13. //entrata e uscita Long
  14. if cond_long// and strategy.opentrades == 0
  15.     strategy.entry('operazioneLong', strategy.long)                                                        "Entrata Market chiusura candela"
  16.     strategy.exit('SL e TP', from_entry='operazioneLong', loss=stop_loss_long, profit=take_profit_long)    "Uscita Limit no chiusura candela"
  17. if cond_exit_long and strategy.opentrades == 1  
  18.     strategy.close('operazioneLong')                                                                       "Uscita Market chiusura candela"
  19.  
  20.  
  21. --------------------------------       INGRESSO USCITE POSIZIONI PREZZO O TICKS    --------------------------------
  22.  
  23. Sulle uscite delle posizioni ci sono 2 modi per calcolare gli stop o i take profit: in modalità prezzo o in modalità ticks:
  24.  
  25.                                            uscita (stop/limit x prezzo) (loss/profit x ticks)
  26.  
  27.  
  28. // Entrata
  29. if (CondEntryLong1 or CondEntryLong2) and strategy.opentrades == 0
  30.     strategy.entry('operazioneLong', strategy.long, alert_message = "Open Long Position",
  31.  
  32. // Uscita Prezzo
  33. if strategy.opentrades ==1
  34.     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."
  35.  
  36. ----------                     ----------                           ----------                     ----------               ----------
  37.  
  38. // Entrata
  39. // Con "GMT+2" Prendo L'orario Corrente E Non L'orario Della Borsa
  40. longCondition = close > massimi and hour(time, "GMT+2") > 13 and hour(time, "GMT+2") < 18
  41. if longCondition
  42.     strategy.entry("long", strategy.long)
  43.     strategy.exit("long", profit=2250, loss=600)
  44.  
  45. // Uscita Ticks    
  46. shortCondition =  close < minimi and hour(time, "GMT+2") > 13 and hour(time, "GMT+2") < 18
  47. if longCondition
  48.     strategy.entry("short", strategy.long)
  49.     strategy.exit("short", profit=2250, loss=600)
  50.  
  51.  
Add Comment
Please, Sign In to add comment