Advertisement
Maurizio-Ciullo

Bot 3 Breakout

Sep 13th, 2021 (edited)
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  3. // © Quant Trader Academy - https://quantaste.com
  4. //@version=4
  5.  
  6. // Strategia Breakout The Quant Trader Academy Fatto Dal Corso Ma Non Testata
  7. // Operatività Solo Long
  8. // Timeframe Mostrata 4H Su Azionario HD Home Depot
  9.  
  10. strategy(title = "Strategia Breakout",
  11.      initial_capital = 10000,
  12.      currency = currency.EUR,
  13.      commission_value = 1,
  14.      commission_type = strategy.cash,
  15.      slippage = 10)
  16.  
  17. atrval = input(title = "ATR", type = input.integer, defval = 3)
  18. tp_mult = input(title = "TP Moltiplicatore", type = input.float, defval = 2.0, step = 0.1)
  19.  
  20. atr = atr(atrval)
  21.  
  22. //Ingresso Long= Chiusura maggiore candela precedente e trade aperti = 0
  23. //Uscita Long Stop= Low - Atr
  24. //UScita Long Profit= Moltiplicatore Della Grandezza Dello Stop Loss
  25.  
  26. if (close > high[1] and strategy.opentrades == 0)
  27.  
  28.     longSLPrezzo = low - atr
  29.     longSLTick = ((close - longSLPrezzo) / syminfo.mintick)
  30.     vol = (strategy.equity) * 0.01 / atr
  31.     strategy.entry("long", true, qty = vol)
  32.     strategy.exit("long", stop = longSLPrezzo, profit = (longSLTick * tp_mult))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement