Help with my code

I’m trying to create
the following sequence

  • any object on the chart
  • 1st click on the object (selected line)
  • 2 Then I click on the candle (line placed) __ same shows on the gif__

but I am not able to create I can not understand logic