jryan3

Label_Trades Enter your trade information to display on chart

This indicator is an overlay for your main chart. It will display your trade entry and trade close positions on your chart.

After you place the indicator on you shart you will need to enter the trade information that you want to display.

You can open thte input setting by clicking on the gear sprocket that appears when you hover your mouse over the indicator name. There are 7 seting you will want to fill in.

Date and Time Bought
Date and Time Sold
Trade Lot Size
Select whether the trades was 'long' or 'short'
The price for buying the Trade
The price for selling the Trade

On the third tab

The code is straightforward. Using a conditional based on whtehr the trade was 'long' or 'short' determines where the labels will be placed and whether they show a long trade or short trade. It also displays a tool tip when you hover over the label. The tooltip will display the number of lots bought or sold and the price.

The lable.new() function is the meat of the indicator. I will go over a line to explainthe options available.

Pinscript manual(www.tradingview.com/...v5/Introduction.html)
The function parameters can be called out as in the example above or the values can be placed comma seperated. If you do the latter you must enter the parameters in order. I like anming the parameters as I place them so I can easily see what I did.

label.new(
x=t_bot, // x is the time the transaction occured
y=na, // y is the for the y-axis it is not used here so 'na' tells pinescript to ignore the parameter
xloc=xloc.bar_time, // x_loc is specifying that x is a time value
yloc=yloc.belowbar, // y-loc specifies to place the label under the bar. There are other locations to use. See language reference ((www.tradingview.com/...script-reference/v5/)
style=label.style_triangleup, // This parameter selects the lable style. There are many other style to use, see the manual.
color=color.green, // the Label fill color
size=size.small, // the label size
tooltip=str.tostring(lot_size) + " lots bought at $" + str.tostring(bot_val)) // Some parameters are tricky. This one needs to be a string but we are using an integer value(lot_size) and a float value(bol_val). They are all concatenated via the "+" sign. In oorder to do this the numeric values need to be cast or converted into strings. The string function str.tostring() does this.
오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?