# Drawing a horizontal line across a given point in the chart

31

Hi.. I wanted to draw a horizontal line across the 50MA position at candle 1. I tried and now I know how to code for calculating the 50MA value at candle 1. If the 50MA value at candle 1 is "x", I want to draw a horizontal line across "x" in the chart. (It will be a dynamic line which changes its position as new candles appear) Already tried few options, but failed. Could someone please tell me how to code to draw a horizontal line across "x"? (Please note that in this example, I know how to calculate the value "x" creating handle for MA. Only problem is drawing a line across "x")
Moderator
30306

Already tried few options, but failed.

Show the code that you have done and maybe we will see your errors.

Moderator
250613

Hi.. I wanted to draw a horizontal line across the 50MA position at candle 1. I tried and now I know how to code for calculating the 50MA value at candle 1. If the 50MA value at candle 1 is "x", I want to draw a horizontal line across "x" in the chart. (It will be a dynamic line which changes its position as new candles appear) Already tried few options, but failed. Could someone please tell me how to code to draw a horizontal line across "x"? (Please note that in this example, I know how to calculate the value "x" creating handle for MA. Only problem is drawing a line across "x")

Do you want something like this?

31

Do you want something like this?

Yes. Anyway my problem was sorted. Thanks for the reply!
24765

rhodium1trading: Yes. Anyway my problem was sorted. Thanks for the reply!

Don't do that. Someone searching might find this thread and still be clueless. What was the problem? What solved what?

Moderator
250613

If anyone is interested - here is an example ( MA horizontal line )