Untitled
// XU100 verisi alma xu100Symbol = "BIST:XU100" // Bugünkü kapanış fiyatı (anlık fiyat) xu100CloseToday = request.security(xu100Symbol, timeframe.period, close) // Dünün kapanış fiyatı xu100ClosePrevious = request.security(xu100Symbol, "D", close[1]) // Günlük yüzde değişim hesaplama xu100Change = 100 * (xu100CloseToday - xu100ClosePrevious) / xu100ClosePrevious xu100ChangeRounded = math.round(xu100Change * 100) / 100 table.cell(tbl, 9, 0, 'XU100', text_color=#ffffff, text_size=fontSizeMap) //XU100 yüzdesi ve fiyatı aynı hücrede xu100Text = str.tostring(xu100ChangeRounded, "#.##") + "%\n" + str.tostring(xu100CloseToday, "#.##") xu100Color = xu100ChangeRounded >= 0 ? #00ff08 : #dd0000 table.cell(tbl, 9, 1, xu100Text, text_color=xu100Color, text_size=fontSizeMap)
Leave a Comment