Advertisement
Maurizio-Ciullo

Bot Just-In-Time Bias VIX VX1! 1D SOLO LONG

May 8th, 2022
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  4. // © Maurizio-Ciullo
  5.  
  6. // Strategia Bias Sul Futurex Del Vix Che E' L'indice Di Volatilità Sull S&P 500
  7. // Ticker VX1!, Il Bot Dovrà Girare Sui Contratti Non Continuous, Il Continuous Serve Solo Per Il Backtest
  8. // Andranno Fatti I Rollower A Scadenza Del Contratto
  9. // La Strategia Non E' Completa Ma E' Solo Un'Idea Che Ci Si Può Lavorare
  10.  
  11. //@version=5
  12. strategy("Bot Just-In-Time Bias VIX VX1! 1D SOLO LONG", overlay=false)
  13.  
  14.  
  15. entrylong = input.int(1, "Giorno entrata long")
  16. exitlong = input.int(1, "Giorno uscita long")
  17. maxPrice = input.int(30, "Price max for trading") // Valore Del Volatilità Del Vix La Volglio Sotto Il 30
  18.  
  19. giornoDellaSettimana = dayofweek(time)
  20. plot(giornoDellaSettimana)
  21.  
  22. longCondition = giornoDellaSettimana == entrylong and strategy.opentrades == 0 and close <= open and open < maxPrice
  23.  
  24. if longCondition
  25.     strategy.entry("Long", strategy.long)
  26. strategy.close("Long", when = (giornoDellaSettimana == exitlong))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement