How to draw a horizontal line at specific price by programming  [SOLVED]

Questions about MultiCharts and user contributed studies.
ragdoll
Posts: 49
Joined: 04 Apr 2019
Has thanked: 4 times

How to draw a horizontal line at specific price by programming

Postby ragdoll » 08 May 2019

Hi,

Say like try to draw a horizontal line through the whole screen at a specific price. It is easy to do it by inserting a horizontal line in the chart. However, the price would be changing so that I'd like to do it by programming. How to draw a horizontal line through the whole screen in the programming way?

Thanks.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: How to draw a horizontal line at specific price by programming  [SOLVED]

Postby Henry MultiСharts » 09 May 2019

Hello ragdoll,

The attached indicator plots a horizontal line on current close.
The line is always extended to the right. Days_back input controls extension to the left:
0 up to current bar only,
1 - 1 days back,
2 - 2 days back, etc...

Show_price_marker - true - show current price marker above the horizontal line; false - hide the price marker.
Background/Text colors, size, font, amount of decimals are hardcoded in the function and can be modified in it.

Another sample can be found here:
http://www.multicharts.com/discussion/v ... =1&t=46123
Attachments
horizontal line on close.pla
(4.06 KiB) Downloaded 359 times


Return to “MultiCharts”