OPEN-SOURCE SCRIPT

LA SOÑADA 7000 4h

403
//version=5



strategy(title='LA SOÑADA 7000 4h', calc_on_order_fills=true, calc_on_every_tick=false, initial_capital=10000, commission_type=strategy.commission.percent, commission_value=0.04, overlay=true, default_qty_type=strategy.cash, default_qty_value=60000)

buffer = input.float(title='buffer', defval=0.3, minval=0, step=0.1)

b1 = close[1] * (1 + buffer / 100)

b2 = close[1] * (1 - buffer / 100)

strategy.entry('Long', strategy.long, when=close > b1, comment='entry')

strategy.close('Long', when=close < b2, comment='exit')

//money management

stop_loss = input.int(15, 'Stop loss %', minval=1, step=1)

sl = strategy.position_avg_price * (1 - stop_loss / 100)

close_Stop = close < sl

strategy.close('Long', when=close_Stop, comment='Stop loss')

Target_profit = input.int(50, 'Target Profit %', minval=1, step=1)

tp = strategy.position_avg_price * (1 + Target_profit / 100)

close_Target = close > tp

strategy.close('Long', when=close_Target, comment='Target')

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.