for back-testing on tradingview I wanted to open a trade on Thursday evening (CET, that is 12h server time...?) and close it on Monday morning:
rushLimit = input(100,"SL",type = input.float)
label.new(bar_index, low -2.5, style=label.style_none, textcolor=color.white, text=tostring(hour(time))+":"+tostring(minute(time)))
if dayofweek(time) == 5 and hour(time) == 12 and minute(time) == 0
label1 = label.new(bar_index, high)
label.set_text(label1, text="sl")
strategy.entry("EL", strategy.long, stop = rushLimit )
if dayofweek(time) == 2 and hour(time) == 2 and minute(time) == 0
label.new(bar_index, low, style = label.style_label_up, color = color.red)
strategy.close("EL")
What I did not understand:
- StopLoss is not set properly - backtesting result doesnt change at all when changing the sL via the input parameter...?
- The time is only plotted next to the bar for the most recent 20 bars or so, but not to all candles of the chart...?
Thanks for your help!