![](/img/trans.png)
[英]PineScript multi frame indicator alert not triggering at closing candle
[英]Pinescript: How to isolate a section of an indicator to calculating based on another candle stick pattern
我對 Pinescript 還是很陌生,但我非常渴望學習這門語言。 我從來都不是真正的技術專家,在修補 Pinescript 之前不知道編程語言。
我想修改為我的交易風格的指標稱為 Vumanchu Cipher B: https ://www.tradingview.com/script/Msm4SjwI-VuManChu-Cipher-B-Divergences/
這是資金流量指標,可以從第 314-316 行找到計算結果:
// RSI + MFI Area
rsiMFI = f_rsimfi(rsiMFIperiod, rsiMFIMultiplier, timeframe.period)
rsiMFIColor = rsiMFI > 0 ? #3ee145 : #ff3d2e
如果你能幫助我,提前謝謝你!!
我一直在盡力看看我是否可以隔離資金流以使用基於 Heiken Ashi (HA) 蠟燭的計算,而不是使用我與之交易的日本蠟燭。
我知道我必須使用類似這些命令的東西:
useHA=input(true,"Use heikin ashi candles?")
ha_AP=security(heikinashi(syminfo.tickerid), timeframe.period, AP)
但是,當我嘗試將它們放在一起時,總是會出錯。 :'(((
所以我想總結一下,我希望 Vumanchu 指標基於日本蠟燭進行計算,而資金流量基於 Heiken Ashi 進行計算。
我希望這是有道理的:')
在此腳本中, f_rsimfi
是:
f_rsimfi(_period, _multiplier, _tf) => security(syminfo.tickerid, _tf, sma(((close - open) / (high - low)) * _multiplier, _period) - rsiMFIPosY)
可以看到,這個函數已經使用了security
函數,所以不能再調用security
函數了。
但是,您可以更改security
函數的symbol
參數以使用heikinashi
而不是“常規”蠟燭。 例如,您可以首先根據需要設置input
:
useHA=input(true,"Use heikin ashi candles?")
然后根據這個輸入決定使用哪個syminfo.tickerid
:
t = useHA ? heikinashi(syminfo.tickerid) : syminfo.tickerid
最后更改函數,使其進行相應計算:
f_rsimfi(_period, _multiplier, _tf) => security(t, _tf, sma(((close - open) / (high - low)) * _multiplier, _period) - rsiMFIPosY)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.