Как нарисовать линии уровня в трейдинг вью
Перейти к содержимому

Как нарисовать линии уровня в трейдинг вью

  • автор:

Инструменты рисования

С помощью инструментов рисования TradingView можно делать пометки, добавлять комментарии, отмечать тренды и паттерны, проводить измерения и прогнозирование, рассчитывать уровни цен. Найти их можно в левой панели графика

Любой инструмент имеет настройки стиля и видимости на различных интервалах — изменить их можно в меню, открывающимся двойным кликом или с помощью кнопки “Настройки” на плавающей панели. Стиль можно сохранить в шаблон, чтобы в будущем применять его в один клик.

Для быстрого доступа есть функция добавления в избранное — в меню выбора кликните на иконку звездочки напротив нужных инструментов, и они появятся на отдельной плавающей панели.

  1. Линии тренда позволяют отмечать направления движения и уровни цены. Эти инструменты нужны наиболее часто. Большинство из них имеют функцию добавление текста.

Подробнее о каждом инструменте можно узнать здесь.

Trend Line

The Trend Line drawing tool has several useful applications. It is predominantly used to manually draw lines illustrating trends in the market or associated indicators. It can also be used as arrows (there is an option to put an arrow on one or both ends) which are used to designate points of interest. To draw a trend line at 45-degree angle, keep the Shift key pressed while drawing.

Style

In Style property dialog it is possible to change the appearance of a Trend Line:

Line

Sets the color, opacity, thickness and style of a trend line. The second drop-down menu contains options of setting the line style and extending one or both line’s ends to infinity. Also, in the last two drop-downs of Line, an arrow-shaped end may be set instead of a normal one for the left and right ends of the line.

Show Middle Point

Toggles the visibility of the trend line’s mid-point.

Text

Checkboxes Show Price Range, Bars Range, Date/Time Range, Show Distance, Show Angle allow to display the text with the relevant information beside the Trend Line on a chart. Stats Text Color drop-down menu allows to change the color, font type and font size for this text. Position for this text is to be selected in Stats Position drop-down menu.

Show Price Range

Toggles the visibility of text displaying the price range (absolute, percent values and ticks) between the trend line’s two points.

Show Bars Range

Toggles the visibility of text displaying the number of bars between the trend line’s two points.

Show Date/Time Range

Toggles the visibility of text displaying the date/time range between the trend line’s two points.

Show Distance

Toggles the visibility of text displaying the specific distance (in terms of periods) between the trend line’s two points.

Show Angle

Toggles the visibility of text displaying the inclination angle of a trend line (in degrees).

Always Show Stats

If this checkbox is not selected, Stats Text will appear beside only when the Trend Line is selected by mouse click.

Coordinates

In Coordinates properties dialog you can set precisely the position of the Trend Line’s end points on the price scale (by setting the price) and the time scale (by setting the bar number):

Price 1

Allows for the precise placement of the trend line’s first point (Price 1) using a bar number and price.

Price 2

Allows for the precise placement of the trend line’s second point (Price 2) using a bar number and price.

Visibility

In visibility properties dialog you can switch displaying of a Trend Line on charts of different timeframes:

Alert

It is possible to set an alert to get notified about a series crossed the Trend Line on a chart. Use the clock icon in floating drawing toolbar or in right click menu on the Trend Line itself:

Горизонтальная линия

Горизонтальные линии часто используются, чтобы отмечать определенные уровни цен. Они также могут быть полезны, когда необходимо отметить уровни поддержки и сопротивления. Так же как и Удлиненные линии (которые могут быть нарисованы в любом направлении), Горизонтальные линии продолжаются бесконечно в необходимом направлении.

Стиль

В окне настроек Стиля можно изменить внешний вид Горизонтальной линии:

Линия

Здесь вы можете изменить цвет и прозрачность Горизонтальной линии, а также ее толщину и стиль.

Отображать цену

Данная настройка показывает ценовое значение Горизонтальной линии на ценовой оси.

Показать текст

Когда активна данная настройка, можно добавить текст, который будет отображаться рядом с Горизонтальной линией. Цвет текста и прозрачность, размер шрифта, жирность и курсив можно настроить в выпадающем меню рядом с флажком Показать текст. Настройки Выравнивания текста позволяют установить позицию текста вдоль Горизонтального луча.

Координаты

В окне настроек координат вы можете установить точное положение Горизонтальной линии, выбрав позицию начальной точки на ценовой шкале (для этого установите цену) и шкале времени (для этого выберите номер бара):

Отображение

В окне настроек Отображения вы можете настроить отображение Горизонтальной линии на графиках на разных отрезках времени:

Оповещения

У вас есть возможность настроить оповещения, когда серия пересекает Горизонтальный луч на графике. Воспользуйтесь значком будильника в плавающей панели инструментов рисования или в контекстном меню самой Горизонтальной линии:

Затем выберите условие, периодичность и способ уведомления, измените, если необходимо, текст уведомления, и нажмите Создать:

How to draw a vertical line in TradingView pine script?

I’m trying to use the web based TradingView platform to make my own custom scripts to display various financial market properties. This is possible through its pine scripting engine/interpreter. At the moment I’m trying to simply display a vertical line on either the main chart or on an indicator chart. However, it doesn’t seem that their scripting engine is supporting vertical lines, except by using the plot’s histogram or column types. Either way, I am not able to get any satisfactory lines. SOME TESTS (1) I’ve had some minor success with using bgcolor() like this:

//@version=3 study(title="vbar1", overlay = false) trange(res, sess) => not na(time(res, sess)) vlinecol = #000000 // black plot(n, color = na) // check last value from plot but don't display vline = (n < 5710) ? na : trange("1", "0700-0701") ? vlinecol : na bgcolor(vline, transp=0) 

enter image description here

This results in: (2) A much better result when using plot() with the style=histogram argument:

//@version=3 study(title="vbar2", overlay = true) // scale=scale.none only for overlay=true vlinecol = #000000 // black cond = barstate.islast bh = 10*high // Use 10 x the window max price height for top of vbar (or use 1e20) bo = -10 // Set offset from last bar plot(cond ? bh : na, color=vlinecol, linewidth=2, offset=bo, style = histogram, transp=0) 

enter image description here

with the following result:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *