OPEN-SOURCE SCRIPT

Pip distance by Jim Belardi

39
//version=5
indicator("Pip-Distanz zum Hoch/Tief (EURUSD)", overlay=true)

// Pip-Faktor fix for EURUSD (5 Nachkommastellen, 1 Pip = 0.0001)
pip_factor = 10000.0

// live candle
current_price = close
candle_high = high
candle_low = low

// calculate distance in pips
dist_high_pips = (candle_high - current_price) * pip_factor
dist_low_pips = (current_price - candle_low) * pip_factor

// create table (once)
var table pipTable = table.new(position.bottom_right, 2, 2, border_width=1, frame_color=color.gray)

// updating table
if barstate.islast
table.cell(pipTable, 0, 0, "Distanz zum Hoch", text_color=color.red, text_size=size.large)
table.cell(pipTable, 1, 0, str.tostring(dist_high_pips, format.mintick) + " Pips", text_color=color.red, text_size=size.large)

table.cell(pipTable, 0, 1, "Distanz zum Tief", text_color=color.green, text_size=size.large)
table.cell(pipTable, 1, 1, str.tostring(dist_low_pips, format.mintick) + " Pips", text_color=color.green, text_size=size.large)

면책사항

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