COCO研究院

 找回密碼
 註冊
搜索
查看: 5574|回復: 15

[其他程式語言] 目前的是累積當根成交量 怎麼改成持續累積

[複製鏈接]
發表於 16-4-25 21:48 | 顯示全部樓層 |閱讀模式
inputs:VL(20) ;
vars : intrabarpersist TUpVol(0),intrabarpersist TDVol(0),
intrabarpersist TUpTicks(0),intrabarpersist TDownTicks(0),
intrabarpersist TPreTime_s(0),intrabarpersist TTime_s(0), intrabarpersist TTimes_s(0), intrabarpersist TUVol(0),
TColor(0);

if LastBarOnChart_s then begin
TPreTime_s=TTime_s;
TTimes_s=BarNumber;


if TPreTime_s<>TTime_s then begin
TUVol=0;
TDVol=0;
end;

if  UpTicks -  TUpTicks >= VL then TUVol=TUVol+UpTicks-TUpTicks;
if  DownTicks -TDownTicks >= VL then TDVol=TDVol+DownTicks-TDownTicks;
if  TUVol  > TDVol then TColor = Red else TColor = green ;
TUpTicks=UpTicks;
TDownTicks = DownTicks;
end;

Plot1(TUVol-TDVol,"",TColor);

謝謝了新手真的不是很懂
發表於 16-4-26 09:28 | 顯示全部樓層
如果 Ticks 資料完整 ,當日分K棒的 Ticks的累積量如下 (不曉得是否為你要的持續累計量)

vars: TodayVol(0);

if date <> date[1] then TodayVol = Ticks {換日第一根K記錄成交量}
  else TodayVol = TodayVol[1] + Ticks;  { 當日其它K棒累計 }

Plot1(TodayVol,"TodayVol") ;

評分

參與人數 1金錢 +2 收起 理由
xxyyzzxyz627 + 2 太強了

查看全部評分

發表於 16-4-26 09:43 | 顯示全部樓層
你貼文的內容應是顯示上漲量與下跌量的差值 ,可以簡化如下

vars: Energy(0);
if date <> date[1] then   Energy = Upticks-DownTicks
else  Energy = Energy + Upticks-DownTicks;

Plot1(Energy,"Energy",iff(Energy >= 0 ,Red,Green))

這樣在主觀交易時可以作為參考基準

評分

參與人數 1金錢 +2 收起 理由
xxyyzzxyz627 + 2 太強了

查看全部評分

發表於 16-4-26 09:45 | 顯示全部樓層
另外 Volume , Upticks , DownTicks , Ticks 定義

參考這裡 http://www.multicharts.com.tw/di ... ;D_ID=2&SN=1731

評分

參與人數 1金錢 +2 收起 理由
xxyyzzxyz627 + 2 感謝分享

查看全部評分

發表於 16-4-26 10:08 | 顯示全部樓層
easytrader788 發表於 16-4-26 09:43
你貼文的內容應是顯示上漲量與下跌量的差值 ,可以簡化如下

vars: Energy(0);

請教E大,如果想要做出Energy(0)的10ma及20ma兩條均線,要程式要如何寫?  有試過用average 及 averageFC  都不被接受.

發表於 16-4-26 12:06 | 顯示全部樓層
Plot2(Average(Energy,10),"Avg10") ;
Plot3(Average(Energy,20),"Avg20") ;

評分

參與人數 2金錢 +4 收起 理由
joelhuang + 2 感謝分享
xxyyzzxyz627 + 2 太強了

查看全部評分

 樓主| 發表於 16-4-26 17:22 | 顯示全部樓層
本帖最後由 xxyyzzxyz627 於 16-4-26 17:24 編輯
easytrader788 發表於 16-4-26 12:06
Plot2(Average(Energy,10),"Avg10") ;
Plot3(Average(Energy,20),"Avg20") ;

你好 我上面的指標 主要是想做 主力指標 口數大於20才紀錄 當天持續累積 隔天重新計算 但上面的指標好像只會紀錄當根 下根會重新計算  請問有比較好的方法嗎 我用在 大台上面的

如果小於 10口當散戶紀錄 要怎麼寫呢??   非常謝謝你 E大
發表於 16-4-26 18:31 | 顯示全部樓層
我寫的會累計當天其它K棒的量

評分

參與人數 1金錢 +2 收起 理由
xxyyzzxyz627 + 2 太強了

查看全部評分

 樓主| 發表於 16-4-26 19:21 | 顯示全部樓層
easytrader788 發表於 16-4-26 18:31
我寫的會累計當天其它K棒的量

vars: Energy(10);
if date <> date[1] then   Energy = Upticks-DownTicks
else  Energy = Energy + Upticks-DownTicks;

Plot1(Energy,"Energy",iff(Energy >= 0 ,Red,Green))
Plot2(Average(Energy,10),"Avg10") ;
Plot3(Average(Energy,20),"Avg20") ;
E大真的不好意思 麻煩你 我身邊因為沒有人會程式碼 真的很不好意思 我用者個出現 錯誤 不能編碼
請問 有辦法顯示 成交口數大於20的加總 跟成交口數小於10的加總嗎 
1461669313135.jpg 像這樣子 這個圖是20口以上的在做空 10以下的在做多

最後一個問題真的麻煩了 加權預估量的寫法 我網路已經找了3天找步道@@ 找到的也少函數程式

1461669390703.jpg  像這樣子 拜託你了



發表於 16-4-26 21:03 來自手機 | 顯示全部樓層
這是我以前po文在 wen 大的部落格文章,裡面有完整程式碼(大盤預估量)
發表於 16-4-26 21:03 來自手機 | 顯示全部樓層
http://wenschair.blogspot.tw/2013/10/by-easytrader.html?m=1
發表於 16-4-26 21:55 來自手機 | 顯示全部樓層
我自己的部落格 ,有空多來停留分享 http://easytrader788.blogspot.tw/?m=1

評分

參與人數 1金錢 +2 收起 理由
dahlia1981 + 2 感謝分享

查看全部評分

 樓主| 發表於 16-4-27 10:40 | 顯示全部樓層
easytrader788 發表於 16-4-26 21:03
這是我以前po文在 wen 大的部落格文章,裡面有完整程式碼(大盤預估量)

大大 原來這篇是你寫的 受益良多 這幾天都在看這個部落格 全部都找玩了 因為裡面的是台指期的 預估量
請問也可以帶到 加權指數裡面嗎??  多謝你

發表於 16-4-27 11:38 | 顯示全部樓層
將原程式碼裡相對應時間的數字作修改
9:05 14.99  --> 9點5分 ,係數 14.99
9:10 9.48
9:15 7.12
9:20 5.83
9:25 4.99
9:30 4.42
9:35 3.99
9:40 3.66
9:45 3.39
9:50 3.18
9:55 2.99
10:00 2.83
10:05 2.70
10:10 2.58
10:15 2.48
10:20 2.39
10:25 2.30
10:30 2.23
10:35 2.15
10:40 2.09
10:45 2.03
10:50 1.97
10:55 1.92
11:00 1.87
11:05 1.83
11:10 1.79
11:15 1.74
11:20 1.71
11:25 1.67
11:30 1.63
11:35 1.60
11:40 1.57
11:45 1.54
11:50 1.51
11:55 1.48
12:00 1.46
12:05 1.43
12:10 1.41
12:15 1.38
12:20 1.36
12:25 1.34
12:30 1.32
12:35 1.30
12:40 1.28
12:45 1.25
12:50 1.23
12:55 1.21
13:00 1.19
13:05 1.17
13:10 1.14
13:15 1.12
13:20 1.09
13:25 1.06
13:30 1.00

評分

參與人數 1金錢 +2 收起 理由
xxyyzzxyz627 + 2 太強了

查看全部評分

 樓主| 發表於 16-4-27 12:36 | 顯示全部樓層
easytrader788 發表於 16-4-27 11:38
將原程式碼裡相對應時間的數字作修改
9:05 14.99  --> 9點5分 ,係數 14.99
9:10 9.48

1461731672160.jpg

E大不好意思 請問一下綠色的線根黃色的是什麼東西???  還有請問一下為什麼 收盤的量跟卷商給的收盤量差了9億??

附上程式碼

Input: Ratio(0.3) ;
vars: V_sum(0),V_est(0),TodayVol(0),YesterDayVol(0);
if date <> date[1] then begin
        YesterDayVol = TodayVol[1] ;
    V_sum = ticks;
end
else begin
   V_sum = V_sum + ticks;
end;
if time<=0905 then V_est = V_sum * 14.99
else if Time >0905 and time <= 0910 then V_est = V_sum * 9.48
else if Time >0910 and time <= 0915 then V_est = V_sum * 7.12
else if Time >0915 and time <= 0920 then V_est = V_sum * 5.83
else if Time >0920 and time <= 0925 then V_est = V_sum * 4.99
else if Time >0925 and time <= 0930 then V_est = V_sum * 4.42
else if Time >0930 and time <= 0935 then V_est = V_sum * 3.99
else if Time >0935 and time <= 0940 then V_est = V_sum * 3.66
else if Time >0940 and time <= 0945 then V_est = V_sum * 3.39
else if Time >0945 and time <= 0950 then V_est = V_sum * 3.18
else if Time >0950 and time <= 0955 then V_est = V_sum * 2.99
else if Time >0955 and time <= 1000 then V_est = V_sum * 2.83
else if Time >1000 and time <= 1005 then V_est = V_sum * 2.70
else if Time >1005 and time <= 1010 then V_est = V_sum * 2.58
else if Time >1010 and time <= 1015 then V_est = V_sum * 2.48
else if Time >1015 and time <= 1020 then V_est = V_sum * 2.39
else if Time >1020 and time <= 1025 then V_est = V_sum * 2.32
else if Time >1025 and time <= 1030 then V_est = V_sum * 2.23
else if Time >1030 and time <= 1035 then V_est = V_sum * 2.15
else if Time >1035 and time <= 1040 then V_est = V_sum * 2.09
else if Time >1040 and time <= 1045 then V_est = V_sum * 2.03
else if Time >1045 and time <= 1050 then V_est = V_sum * 1.97
else if Time >1050 and time <= 1055 then V_est = V_sum * 1.92
else if Time >1055 and time <= 1100 then V_est = V_sum * 1.87
else if Time >1100 and time <= 1105 then V_est = V_sum * 1.83
else if Time >1105 and time <= 1110 then V_est = V_sum * 1.79
else if Time >1110 and time <= 1115 then V_est = V_sum * 1.74
else if Time >1115 and time <= 1120 then V_est = V_sum * 1.71
else if Time >1120 and time <= 1125 then V_est = V_sum * 1.67
else if Time >1125 and time <= 1130 then V_est = V_sum * 1.63
else if Time >1130 and time <= 1135 then V_est = V_sum * 1.60
else if Time >1135 and time <= 1140 then V_est = V_sum * 1.57
else if Time >1140 and time <= 1145 then V_est = V_sum * 1.54
else if Time >1145 and time <= 1150 then V_est = V_sum * 1.51
else if Time >1150 and time <= 1155 then V_est = V_sum * 1.48
else if Time >1155 and time <= 1200 then V_est = V_sum * 1.46
else if Time >1200 and time <= 1205 then V_est = V_sum * 1.43
else if Time >1205 and time <= 1210 then V_est = V_sum * 1.41
else if Time >1210 and time <= 1215 then V_est = V_sum * 1.38
else if Time >1215 and time <= 1220 then V_est = V_sum * 1.36
else if Time >1220 and time <= 1225 then V_est = V_sum * 1.34
else if Time >1225 and time <= 1230 then V_est = V_sum * 1.32
else if Time >1230 and time <= 1235 then V_est = V_sum * 1.30
else if Time >1235 and time <= 1240 then V_est = V_sum * 1.28
else if Time >1240 and time <= 1245 then V_est = V_sum * 1.25
else if Time >1245 and time <= 1250 then V_est = V_sum * 1.23
else if Time >1250 and time <= 1255 then V_est = V_sum * 1.21
else if Time >1255 and time <= 1300 then V_est = V_sum * 1.19
else if Time >1300 and time <= 1305 then V_est = V_sum * 1.17
else if Time >1305 and time <= 1310 then V_est = V_sum * 1.14
else if Time >1310 and time <= 1315 then V_est = V_sum * 1.12
else if Time >1315 and time <= 1320 then V_est = V_sum * 1.09
else if Time >1320 and time <= 1325 then V_est = V_sum * 1.06
else if Time >1325 and time <= 1330 then V_est = V_sum * 1.00;

if time = 1300 then TodayVol = V_sum ;


plot1(V_sum, "Daily V sum");
plot2(V_est, "Volume Est");
plot3(YesterDayVol,"LastdayVol");
plot4(YesterDayVol*Ratio, "VolumeRatio");


非常感謝E大
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-5-5 06:51

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook