如何用這個(gè)模型開(kāi)平倉(cāng)? [金字塔]
- 咨詢內(nèi)容:
INPUT:X(10,1,20,1);
VARIABLE: aspect=0; //初始化假定做多頭
VARIABLE: stopprice=0;//止損價(jià)格變量
VARIABLE: stopnum =X; //止損價(jià)差
RUNMODE:0; //工作于逐周期模式
if barpos = 0 then
stopprice:=l - stopnum;//該周期最低價(jià)減止損價(jià)差
if aspect=0 then
begin
//多頭處理
if l <=stopprice then
begin
//多反空
aspect:=1;
stopprice:=h+stopnum;
end
//處理移動(dòng)的底部
if l - stopnum > stopprice then
stopprice:=l-stopnum;
end
if aspect=1 then
begin
//空頭處理
if h>=stopprice then
begin
//空反多
aspect:= 0;
stopprice:=l-stopnum;
end
//處理移動(dòng)的底部
if h + stopnum<stopprice then
stopprice :=h+stopnum;
end
//畫(huà)線
PARTLINE( aspect =0, stopprice , colorrgb(255,0,0));
PARTLINE( aspect =1, stopprice , colorrgb(0,255,0));上述模型是我在論壇上發(fā)現(xiàn)的移動(dòng)止損的范例,我想將止損的條件改為開(kāi)平倉(cāng)的條件(即多頭止損條件觸發(fā)了直接平多開(kāi)空,空頭止損條件觸發(fā)了直接平空開(kāi)多)。
應(yīng)該如何修改呢?只會(huì)苯辦法的編程,這樣的不會(huì)弄,邯鄲學(xué)步整了一晚上也沒(méi)弄好,求助高手了!
- 金字塔客服:
等等,少后回復(fù)
- 用戶回復(fù):
依然期待中......
- 網(wǎng)友回復(fù):
這個(gè)就是個(gè)如何移動(dòng)止損的例子
并沒(méi)有給定什么條件下止損
以下這個(gè)帖子,給的比較詳細(xì),且給出了止損條件
http://www.weistock.com/bbs/dispbbs.asp?boardid=10&Id=2160&page=2
至于您說(shuō)的止損平倉(cāng)后直接反手的例子,簡(jiǎn)化了,其實(shí)就是平倉(cāng)后反手
可參考該帖問(wèn)題5,直接就是平倉(cāng)反手的模型
http://www.weistock.com/bbs/dispbbs.asp?boardid=4&Id=332
- 網(wǎng)友回復(fù): 先學(xué)習(xí),不明白再請(qǐng)教。
相關(guān)文章
-
沒(méi)有相關(guān)內(nèi)容