Advertisement
Maurizio-Ciullo

6 Ingressi A Fasce Di Prezzo

Jul 3rd, 2021
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //                                                   (Ingressi A Fasce Di Prezzo)
  2.  
  3. //@version=4
  4.  
  5. strategy(title="6 Buy and Sell a delle fascie di prezzo specifico",
  6.      overlay=true,
  7.      pyramiding=100,
  8.      initial_capital=1000,
  9.      default_qty_type=strategy.percent_of_equity,
  10.      default_qty_value=20,
  11.      commission_type=strategy.commission.cash_per_order,
  12.      commission_value=1,
  13.      slippage=2,
  14.      default_qty_type=strategy.percent_of_equity,
  15.      default_qty_value=1000)
  16.  
  17. //Input fasce di prezzo
  18.  
  19. Inp_Long_Sup=input(defval=0.9815)
  20. Inp_Long_Inf=input(defval=0.9692)
  21.  
  22. Inp_Exit_Sup=input(defval=1.0310)
  23. Inp_Exit_Inf=input(defval=1.0158)
  24.  
  25. //Visualizzazione plot deisegnato in aree non riuscito
  26.  
  27. //plot(Inp_Long_Sup, color=color.green, style=plot.style_area)
  28. //plot(Inp_Long_Inf, color=color.white, style=plot.style_area)
  29.  
  30. //plot(Inp_Long_Sup, color=color.red, style=plot.style_area)
  31. //plot(Inp_Exit_Inf, color=color.white, style=plot.style_area)
  32.  
  33. //Condizioni di entrata
  34.  
  35. Cond_Entry_Long=close > Inp_Long_Inf and close < Inp_Long_Sup
  36. Cond_Exit_Long=close > Inp_Exit_Inf and close < Inp_Exit_Sup
  37.  
  38.  
  39. //Stop loss da mettere per imparare
  40.  
  41. //Ordine entry ed exit
  42.  
  43. strategy.entry("Compra", true, when=Cond_Entry_Long)
  44. strategy.close("Compra", when=Cond_Exit_Long)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement