Cumulative Delta 請問XQ 有這個指標嗎? 假如沒有 有辦法自己做嗎?

  •   290 
  • 最後發表   安安大好  2022 三月 14
安安大好 發文於   2022/03/10

inputs: 

UpColor(darkgreen), 

DownColor(red), 

MaxBlock(9999),

MinBlock(0),

ResetDeltaEachBar(0); 

 

variables: 

MyVol(0), 

Block(0),

color(yellow), 

firstrunthrough(true),

intrabarpersist MyCurrentBar(0), 

intrabarpersist VolTmp(0), 

intrabarpersist Deltac (0), 

intrabarpersist DeltaH (0), 

intrabarpersist DeltaL (0), 

intrabarpersist DeltaO (0); 

 

if firstrunthrough then begin // We need to do this in case indicator starts mid bar

    Voltmp = Iff(BarType < 2, Ticks, Volume);

    firstrunthrough = False;

    end;

 

if LastBarOnChart then begin   

if CurrentBar > MyCurrentBar then begin 

VolTmp = 0; 

MyCurrentBar = CurrentBar; 

if ResetDeltaEachbar = 1 then Deltac =0;

DeltaO = Deltac; 

DeltaH = Deltac; 

DeltaL = Deltac; 

end; 

    MyVol = Iff(BarType < 2, Ticks, Volume);

Block = Myvol - VolTmp;

if (Block >= MinBlock) and (Block <= MaxBlock) then

if Close <= InsideBid then

Deltac  = Deltac - MyVol + VolTmp

else if Close >= InsideAsk then 

Deltac = Deltac + MyVol - VolTmp ;  

VolTmp = MyVol ;

 

 

 

DeltaH = maxlist(DeltaH, Deltac); 

DeltaL = minlist(DeltaL, Deltac); 

 

 

 if Deltac <= Deltal[1] then 

 color = DownColor 

 else 

 if Deltac >= Deltah[1] then 

 color = UpColor

 else

 color = color[1]; 

 

plot1(DeltaO, "DO",color); 

Plot2(DeltaH, "DH",color); 

Plot3(DeltaL, "DL",color); 

plot4(Deltac, "DC",color); 

end;  

這是我在MultiCharts 找到的程式碼 但我不會轉換成XQ 感謝

 

排序方式: 標準 | 最新
XQ小幫手 發文於   2022/03/11

Hello 安安大好,

 

您提供的指標無法使用在XQ上,主要是因為指標內有需要用委買1和委賣1來判斷,在XQ中指標無法取得該數值。

小幫手看說明覺得您可以考慮使用內盤量外盤量來計算。

附上指標腳本供您參考。

附加文件

  • 按讚來自於
  • dk123423124110
安安大好 發文於   2022/03/11

謝謝 有類似的感覺了(我是給它用成柱狀圖 跟漲跌 但都在0的中線)

 

但有辦法弄成這樣圖表嗎?

寶塔線 那種感覺 只是改成 成交量的加減狀態 感恩

 

https://support.atas.net/en/knowledge-bases/2/articles/412-cumulative-delta

附加文件

XQ小幫手 發文於   2022/03/14

Hello 安安大好,

 

XQ並沒有提供Bar的繪圖方式,最接近的作法是用兩個plot疊起來的方式來達到近似的效果,但是並不好看。

舉例來說,您要畫一個 80 ~ 100 的實體柱的話,可以用像是:

plot1(100);

plot2(20);

然後將兩者都選為柱圖,plot2選為跟底色相同(黑色),這樣看起來就會是一根80到100的Bar。

附上指標腳本供您參考。

附加文件

發表回覆
Close