0

这个计算的依据是什么?体积,浮动?Idk,但希望得到一些帮助来理解。

虽然我了解 pinescript/thinkscript 的基础知识,并且已经将其他一些简单的脚本从 pinescript 转换为 thinkscript,但我无法理解这一点。

谢谢

// © blackcat1402
//@version=4

study("[blackcat] L1 Banker Entry Indicator", overlay=false)

//functions
xrf(values, length) =>
    r_val = float(na)
    if length >= 1
        for i = 0 to length by 1
            if na(r_val) or not na(values[i])
                r_val  :=  values[i]
                r_val
    r_val
xsa(src,len,wei) =>
    sumf = 0.0
    ma = 0.0
    out = 0.0
    sumf  :=  nz(sumf[1]) - nz(src[len]) + src
    ma  :=  na(src[len]) ? na : sumf/len
    out  :=  na(out[1]) ? ma : (src*wei+out[1]*(len-wei))/len
    out


//model of banker model with customized input threshold
bankerthreshold = input(3, title="banker entry threshold", type=input.integer, minval = 1)
bankermodel = (3)*(xsa(((close - lowest(low,27))/(highest(high,27) - lowest(low,27)))*(100),5,1)) - (2)*(xsa(xsa(((close - lowest(low,27))/(highest(high,27) - lowest(low,27)))*(100),5,1),3,1))
pumpdumpsoon = iff(crossover(bankermodel,bankerthreshold),100,0)
longshortentry = iff((bankermodel <= 3),50,0)
bankermove = iff((bankermodel < 5),25,0)

//model banker pump or dump start soon
ppumpdumpsoon = plot(pumpdumpsoon,color=color.green, linewidth=3,style=plot.style_area, transp=30)
//model long short entry
plongshortentry = plot(longshortentry,color=color.orange, linewidth=3,style=plot.style_area, transp=30)
//model banker move
pbankermove = plot(bankermove,color=color.yellow, linewidth=3,style=plot.style_area, transp=70)
4

1 回答 1

0

首先,该功能xrf从未使用过。其次,使用变量和的xsa组合调用函数。组合是:closelowhigh

((close - lowest(low,27))/(highest(high,27) - lowest(low,27)))

这似乎在和close之间调整价格。这是一个例子:01

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/

//@version=5
indicator("My Script")

src = ((close - ta.lowest(low,27))/(ta.highest(high,27) - ta.lowest(low,27)))

plot(src)
hline(0.5)

这会产生这样的图像: 收盘价

于 2022-01-24T12:30:50.423 回答