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