Drawing a horizontal line across a given point in the chart

 
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") 
 
rhodium1trading:
 Already tried few options, but failed. 

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

 
rhodium1trading :
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?

iMA Line

 
Vladimir Karputov:

Do you want something like this?

Yes. Anyway my problem was sorted. Thanks for the reply!
 
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?

How To Ask Questions The Smart Way. 2004
     When You Ask.
          Follow up with a brief note on the solution.

 

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

MA horizontal line

Reason: