0

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!

  • Sorry for not mentioning it. I use pine v5 in tradingview. – Andre Asser Apr 06 '23 at 19:43
  • Thanks for adding it. I have retracted my close vote. It may be difficult to attract attention to a question that is now nearly 6 days old. It would have been better to include it from the outset, but I am crossing my fingers for you. – Ole V.V. Apr 07 '23 at 07:46

0 Answers0