【问题标题】:How to Access data of current price of stocks in Pine Editor Tradingview using ticker id如何使用股票代码在 Pine Editor Tradingview 中访问当前股票价格数据
【发布时间】:2021-03-05 09:43:47
【问题描述】:

我想在我的 tradingview pine 编辑器中对指标进行编码,为此,我需要股票的当前价格或我的编码关键字的任何其他脚本来执行操作并在图表上生成新的输出,

【问题讨论】:

    标签: python editor indicator tradingview-api


    【解决方案1】:

    试试这个

    src = input(close, title="Source")
    
    price = security(syminfo.tickerid, timeframe.period, src)
    
    plot(price) 
    

    这里是我用来在图表上显示当前价格的股票代码

    参考intradaygeeks如果需要更多帮助请联系twitter

    【讨论】:

      【解决方案2】:

      这似乎有效。

      currentPrice = security(syminfo.tickerid, "", ema(close, 1), barmerge.gaps_on, barmerge.lookahead_off)

      你也许可以使用 ema() 以外的东西。如果您正在编写策略,请确保您对策略的调用包括 calc_on_every_tick=true

      strategy("DCA Bot", overlay=true, calc_on_every_tick=true)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-03-15
        • 1970-01-01
        • 2014-10-16
        • 2011-01-23
        • 1970-01-01
        相关资源
        最近更新 更多