【大智慧】昨買今賣及預(yù)測股價指標(biāo)公式
攻城獅 2016.01.04 20:14
{昨買今賣及預(yù)測股價公式}
{參數(shù)}
input:N(27,1,250);
{顯示買賣價}
BUYPRICE:=”SHOWINV@BUYPRICE”(1);
SALEPRICE:=”SHOWINV@SALEPRICE”(1);
IF BUYPRICE> 0 THEN BP:=BUYPRICE;{顯示昨低買今賣操作數(shù)據(jù)}
ppp:=0.015;{輸入賣出純利}
成本:=BP*1.006;
賣價:成本*(1+ppp),linethick0;
{四價運用}
開盤價:open,linethick0;
開盤價1:=REF(open,1);{昨天最低價}
最高價:high,linethick0;
最高價1:=REF(high,1);
最低價:low,linethick0;
最低價1:=REF(low,1);
最低價2:=REF(low,2);
收盤價:CLOSE,linethick0;
收盤價1:=REF(CLOSE,1);{預(yù)測系數(shù)B2計算公式1}
A1:=REF(開盤價,1);
A2:=ABS((REF(收盤價,1)-A1)/A1);
A3:=ABS((REF(最高價,1)-A1)/A1);
A4:=ABS((REF(最低價,1)-A1)/A1);
B1:=ABS((A2+A3+A4)/3);
B2:開盤價*B1,linethick0;
漲跌比:B2/開盤價*100,linethick0;
{預(yù)測公式一 有用到今天開盤價}
AA:=最高價1;
BB:=最低價1;
CC:=開盤價1;
DD:=收盤價1;
EE:=(AA+BB+CC+2*DD)/5;
AAA:=EE+(AA-BB);
BBB:=2*EE-BB;
CCC:=2*EE-AA;
DDD:=EE-(AA-BB);
上升突破價:=AAA;
上升阻力價:=BBB;
下跌支撐價:=CCC;
下跌反轉(zhuǎn)價:=DDD;
EEE:=(EE+上升突破價+上升阻力價+下跌支撐價+下跌反轉(zhuǎn)價)/5;{心理價}
FFF:=(EEE+開盤價)/2;
{顯示今買最低預(yù)測價}
預(yù)測低一:=開盤價-B2;{今天預(yù)測低價一}
預(yù)測低一1:=REF(預(yù)測低一,1);{昨天預(yù)測價}
預(yù)測低一2:=REF(預(yù)測低一,2);{前天預(yù)測價}
預(yù)測低二:=(預(yù)測低一+FFF)/2;{今天預(yù)測低價二}
預(yù)測低二1:=REF(預(yù)測低二,1);{昨天預(yù)測價}
預(yù)測低二2:=REF(預(yù)測低二,2);{前天預(yù)測價}
差額一:=預(yù)測低一-low;
差額二:=預(yù)測低二-low;
差比一:=(差額一/low)*100;
差比二:=(差額二/low)*100;
{顯示今日最高預(yù)測價公式}
預(yù)測高一:=開盤價+B2;{今天預(yù)測高價一}
{第二今日最高預(yù)測價公式}
預(yù)測高二:=MA(REF(HIGH,1)/REF(CLOSE,2),N)*REF(CLOSE,1);{今天預(yù)測高價二}
預(yù)測高二1:=ref(預(yù)測高二,1);{昨天預(yù)測價}
預(yù)測高二2:=ref(預(yù)測高二,2);{前天預(yù)測價}
{設(shè)定弱勢預(yù)測最高價,YPP可自行調(diào)整}
YPP一:=0.985;{預(yù)測高一弱勢價}
YPP二:=0.989;{預(yù)測高二弱勢價}
熊價一:=預(yù)測高一*YPP一;
熊價一1:=REF(熊價一,1);
熊價二:=預(yù)測高二*YPP二;
熊價二1:=REF(熊價二,1);
平均價一:=(預(yù)測高一+預(yù)測高二)/2;
平均價二:=(熊價一+熊價二)/2;
{測試昨最低及昨預(yù)測低賣出成功率}
check1:(high-預(yù)測低二1)/預(yù)測低二1*100,linethick0;
low1:=ref(low,1);
check2:(high-low1)/low1*100,linethick0;
DRAWTEXTREL(10,60,’ 【今日低買操作數(shù)據(jù)】 【昨低買今賣操作數(shù)據(jù)】 純利設(shè)定:’+NUMTOSTRN(ref(ppp*100,0),2)+’% 【依據(jù)預(yù)測價 計算賣出價】’ ),coloryellow,linethick1;
DRAWTEXTREL(10,200,’ 【今日低買】 預(yù)測價 目前差價 目前差比’),Color8000FF,linethick1;
DRAWTEXTREL(10,350,’ 預(yù)測低一: ‘+NUMTOSTRN(ref(預(yù)測低一,0),2)+’元 ‘+ NUMTOSTRN(ref(差額一,0),2)+’元 ‘+ NUMTOSTRN(ref(差比一,0),2)+’%’),colorffffff,linethick1;
DRAWTEXTREL(10,600,’ 預(yù)測低二: ‘+NUMTOSTRN(ref(預(yù)測低二,0),2)+’元 ‘+ NUMTOSTRN(ref(差額二,0),2)+’元 ‘+ NUMTOSTRN(ref(差比二,0),2)+’%’),colorffffff,linethick1;
DRAWTEXTREL(320,500,’ 今 最低價:’+NUMTOSTRN(ref(最低價,0),2)+’元 最高價:’+NUMTOSTRN(ref(最高價,0),2)+’元’),coloryellow,linethick1;
DRAWTEXTREL(320,745,’ 昨 最低價:’+NUMTOSTRN(ref(最低價1,0),2)+’元 最高價:’+NUMTOSTRN(ref(最高價1,0),2)+’元’),COLORD3A9FF,linethick1;
DRAWTEXTREL(320,615,’ 開盤價:’+NUMTOSTRN(ref(開盤價,0),2)+’元 收盤價:’+NUMTOSTRN(ref(收盤價,0),2)+’元’),coloryellow,linethick1;
DRAWTEXTREL(320,860,’ 開盤價:’+NUMTOSTRN(ref(開盤價1,0),2)+’元 收盤價:’+NUMTOSTRN(ref(收盤價1,0),2)+’元’),COLORD3A9FF,linethick1;
{顯示昨低買今賣操作數(shù)據(jù)}
DRAWTEXTREL(320,200,’ 【買入價】 稅后成本 賣出價 到位’),Colorffff80,linethick1;
DRAWTEXTREL(320,350,’ ‘+NUMTOSTR(BP)+’元 ‘+NUMTOSTR(成本)+’元 ‘+NUMTOSTR(賣價)+’元’),COLORffffff,linethick1;
{顯示依據(jù)預(yù)測價計算賣出價}
DRAWTEXTREL(660,200,’ 【預(yù)測數(shù)據(jù)】 強 勢 到位 弱 勢 到位’),Color8000FF,linethick1;
DRAWTEXTREL(660,350,’ 預(yù)測高一: ‘+NUMTOSTRN(ref(預(yù)測高一,0),2)+’元 ‘+ NUMTOSTRN(ref(熊價一,0),2)+’元’),colorffffff,linethick1;
DRAWTEXTREL(660,500,’ 預(yù)測高二: ‘+NUMTOSTRN(ref(預(yù)測高二,0),2)+’元 ‘+ NUMTOSTRN(ref(熊價二,0),2)+’元’),colorffffff,linethick1;
DRAWTEXTREL(660,650,’ 平均價 : ‘+NUMTOSTRN(ref(平均價一,0),2)+’元 ‘+ NUMTOSTRN(ref(平均價二,0),2)+’元’),colorffffff,linethick1;
{顯示賣出與否}
BBP1:=high>BP or high=BP;
BBP2:=highIF BARSTATUS=2 AND BBP1 THEN BEGIN
DRAWTEXTREL(320,350,’ ★’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND BBP2 THEN BEGIN
DRAWTEXTREL(320,350,’ ●’),COLORgreen,linethick1;
END
{顯示今日低買操作}
ssssu1:=預(yù)測低一>low or 預(yù)測低一=low;
ssssu2:=預(yù)測低一IF BARSTATUS=2 AND ssssu1 THEN BEGIN
DRAWTEXTREL(10,480,’ 到 位: ★’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND ssssu2 THEN BEGIN
DRAWTEXTREL(10,480,’ 到 位: ●’),COLORgreen,linethick1;
END
ssssu3:=預(yù)測低二>low or 預(yù)測低二=low;
ssssu4:=預(yù)測低二IF BARSTATUS=2 AND ssssu3 THEN BEGIN
DRAWTEXTREL(10,730,’ 到 位: ★’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND ssssu4 THEN BEGIN
DRAWTEXTREL(10,730,’ 到 位: ●’),COLORgreen,linethick1;
END
{昨日低買操作結(jié)果}
lssssu1:=預(yù)測低一1>最低價1 or 預(yù)測低一1=最低價1;
lssssu2:=預(yù)測低一1<最低價1;
IF BARSTATUS=2 AND lssssu1 THEN BEGIN
DRAWTEXTREL(10,480,’ 昨 ★ ‘+NUMTOSTRN(ref(預(yù)測低一1,0),2)+’元’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND lssssu2 THEN BEGIN
DRAWTEXTREL(10,480,’ 昨 ● ‘+NUMTOSTRN(ref(預(yù)測低一1,0),2)+’元’),COLORgreen,linethick1;
END
lssssu3:=預(yù)測低二1>最低價1 or 預(yù)測低二=最低價1;
lssssu4:=預(yù)測低二1<最低價1;
IF BARSTATUS=2 AND lssssu3 THEN BEGIN
DRAWTEXTREL(10,730,’ 昨 ★ ‘+NUMTOSTRN(ref(預(yù)測低二1,0),2)+’元’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND lssssu4 THEN BEGIN
DRAWTEXTREL(10,730,’ 昨 ● ‘+NUMTOSTRN(ref(預(yù)測低二1,0),2)+’元’),COLORgreen,linethick1;
END
{昨今日四價漲跌比}
su1:=最低價>最低價1;
su2:=最低價=最低價1;
su3:=最低價<最低價1;
IF BARSTATUS=2 AND su1 THEN BEGIN
DRAWTEXTREL(470,500,’★’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND su2 THEN BEGIN
DRAWTEXTREL(470,500,’★’),COLORffffff,linethick1;
END
ELSE
IF BARSTATUS=2 AND su3 THEN BEGIN
DRAWTEXTREL(470,500,’●’),COLORgreen,linethick1;
END
su4:=最高價>最高價1;
su5:=最高價=最高價1;
su6:=最高價<最高價1;
IF BARSTATUS=2 AND su4 THEN BEGIN
DRAWTEXTREL(620,500,’★’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND su5 THEN BEGIN
DRAWTEXTREL(620,500,’★’),COLORffffff,linethick1;
END
ELSE
IF BARSTATUS=2 AND su6 THEN BEGIN
DRAWTEXTREL(620,500,’●’),COLORgreen,linethick1;
END
su7:=開盤價>開盤價1;
su8:=開盤價=開盤價1;
su9:=開盤價<開盤價1;
IF BARSTATUS=2 AND su7 THEN BEGIN
DRAWTEXTREL(470,615,’★’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND su8 THEN BEGIN
DRAWTEXTREL(470,615,’★’),COLORffffff,linethick1;
END
ELSE
IF BARSTATUS=2 AND su9 THEN BEGIN
DRAWTEXTREL(470,615,’●’),COLORgreen,linethick1;
END
suu1:=收盤價>收盤價1;
suu2:=收盤價=收盤價1;
suu3:=收盤價<收盤價1;
IF BARSTATUS=2 AND suu1 THEN BEGIN
DRAWTEXTREL(620,615,’★’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND suu2 THEN BEGIN
DRAWTEXTREL(620,615,’★’),COLORffffff,linethick1;
END
ELSE
IF BARSTATUS=2 AND suu3 THEN BEGIN
DRAWTEXTREL(620,615,’●’),COLORgreen,linethick1;
END
{顯示預(yù)測高價}
ssuu1:=預(yù)測高一ssuu2:=預(yù)測高一>high;
IF BARSTATUS=2 AND ssuu1 THEN BEGIN
DRAWTEXTREL(660,350,’ ★’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND ssuu2 THEN BEGIN
DRAWTEXTREL(660,350,’ ●’),COLORgreen,linethick1;
END
ssuu3:=預(yù)測高二ssuu4:=預(yù)測高二>high;
IF BARSTATUS=2 AND ssuu3 THEN BEGIN
DRAWTEXTREL(660,500,’ ★’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND ssuu4 THEN BEGIN
DRAWTEXTREL(660,500,’ ●’),COLORgreen,linethick1;
END
ssuu5:=平均價一ssuu6:=平均價一>high;
IF BARSTATUS=2 AND ssuu5 THEN BEGIN
DRAWTEXTREL(660,650,’ ★’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND ssuu6 THEN BEGIN
DRAWTEXTREL(660,650,’ ●’),COLORgreen,linethick1;
END
ssu1:=熊價一ssu2:=熊價一>high;
IF BARSTATUS=2 AND ssu1 THEN BEGIN
DRAWTEXTREL(660,350,’ ★ ‘),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND ssu2 THEN BEGIN
DRAWTEXTREL(660,350,’ ●’),COLORgreen,linethick1;
END
ssu3:=熊價二ssu4:=熊價二>high;
IF BARSTATUS=2 AND ssu3 THEN BEGIN
DRAWTEXTREL(660,500,’ ★’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND ssu4 THEN BEGIN
DRAWTEXTREL(660,500,’ ●’),COLORgreen,linethick1;
END
ssu5:=平均價二ssu6:=平均價二>high;
IF BARSTATUS=2 AND ssu5 THEN BEGIN
DRAWTEXTREL(660,650,’ ★’),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND ssu6 THEN BEGIN
DRAWTEXTREL(660,650,’ ●’),COLORgreen,linethick1;
END
chec1:=預(yù)測低二1*1.006*(1+ppp)chec2:=預(yù)測低二1*1.006*(1+ppp)>high;
IF BARSTATUS=2 AND chec1 THEN BEGIN
DRAWTEXTREL(660,780,’ 測 試: 昨預(yù)測低二 ★ ‘),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND chec2 THEN BEGIN
DRAWTEXTREL(660,780,’ 測 試: 昨預(yù)測低二 ●’),COLORgreen,linethick1;
END
chec3:=high>最低價1*1.006*(1+ppp) or high=最低價1*1.006*(1+ppp);
chec4:=high<最低價1*1.006*(1+ppp);
IF BARSTATUS=2 AND chec3 THEN BEGIN
DRAWTEXTREL(660,780,’ 昨最低價 ★ ‘),COLORRED,linethick1;
END
ELSE
IF BARSTATUS=2 AND chec4 THEN BEGIN
DRAWTEXTREL(660,780,’ 昨最低價 ●’),COLORgreen,linethick1;
END
賣一:=預(yù)測低二1*1.006*(1+ppp);
賣二:=最低價1*1.006*(1+ppp);
DRAWTEXTREL(660,880,’ 賣出價: ‘+NUMTOSTRN(ref(賣一,0),2)+’元 ‘+ NUMTOSTRN(ref(賣二,0),2)+’元’),colorffffff,linethick1;
申明:本文為作者投稿或轉(zhuǎn)載,在概念股網(wǎng) http://m.chiang1015.com/ 上發(fā)表,為其獨立觀點。不代表本網(wǎng)立場,不代表本網(wǎng)贊同其觀點,亦不對其真實性負責(zé),投資決策請建立在獨立思考之上。