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