最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

pine script v6 - Problem With Scaling Indicators Using PineScript in TradingView - Stack Overflow

programmeradmin6浏览0评论

in this code I am trying to put two scaled financial numbers on the chart after scaling them:

  1. Free Cash Flow
  2. Net Income

But they look similar after scaling them, I tried many ways to scale them but I get the same issue.

Can anyone tell me how to solve this issue?

Here is the code I wrote

//@version=6
indicator("Stocks In an Index", "Stocks Analysis", overlay=false)

//Free Cash Flow
FreeCashFlow = request.financial(syminfo.tickerid, "FREE_CASH_FLOW", "FY")
var float FreeCashFlowMin = na
var float FreeCashFlowMax = na
if not na(FreeCashFlow)
    FreeCashFlowMin := na(FreeCashFlowMin) ? FreeCashFlow : (FreeCashFlow < FreeCashFlowMin ? FreeCashFlow : FreeCashFlowMin)
    FreeCashFlowMax := na(FreeCashFlowMax) ? FreeCashFlow : (FreeCashFlow > FreeCashFlowMax ? FreeCashFlow : FreeCashFlowMax)
normalizedFreeCashFlow = not na(FreeCashFlow) and (FreeCashFlowMax != FreeCashFlowMin) ? (FreeCashFlow - FreeCashFlowMin) / (FreeCashFlowMax - FreeCashFlowMin) : na
plot(normalizedFreeCashFlow, color=color.purple, title="Normalized FREE_CASH_FLOW")

//Net Income
netIncome = request.financial(syminfo.tickerid, "NET_INCOME", "FY")
var float netIncomeMin = na
var float netIncomeMax = na
if not na(FreeCashFlow)
    netIncomeMin := na(netIncomeMin) ? netIncome : (netIncome < netIncomeMin ? netIncome : netIncomeMin)
    netIncomeMax := na(netIncomeMax) ? netIncome : (netIncome > netIncomeMax ? netIncome : netIncomeMax)
normalizednetIncome = not na(netIncome) and (netIncomeMax != netIncomeMin) ? (netIncome - netIncomeMin) / (netIncomeMax - netIncomeMin) : na
plot(normalizednetIncome, color=color.green, title="Normalized Net Income")
发布评论

评论列表(0)

  1. 暂无评论