COCO研究院

 找回密碼
 註冊
搜索
查看: 2107|回復: 6

請問關於方倉單的寫法? ~

[複製鏈接]
發表於 13-3-7 17:58 | 顯示全部樓層 |閱讀模式
請問如果想掛 "多單成交單+20點" 的限價平倉單 ;  那"多單的成交單"的語法要怎麼寫?
發表於 13-3-7 18:47 | 顯示全部樓層
if marketposition>0 then
  setprofittarget(20*bigpointvalue);
 樓主| 發表於 13-3-7 19:35 | 顯示全部樓層
真的很謝謝您的回答><"   方便的話能不能幫小弟看看下面這個到底那裡錯了 ~"~
這是我第一次試寫的程式  ~~~

input : BTime(1500),ETime(0200);

var :High(0),Low(0);

if BTime < Time and Time <ETime then begin

         if price > high[2]+4 point then buy this bar at high[2]-2 points limit;

         if price < low[2]-4 point then sell this bar at low[2]+2 points limit;
      
end;

if marketposition = 1 then begin

         exitlong this bar at EntryPrice + 3 points limit;

if marketposition = -1 then begin
         
         exitshort this bar at EntryPrice - 3 points limit;

end;
發表於 13-3-7 21:57 | 顯示全部樓層
this bar 不能下limit單,你只能用next bar xxxxx limit
 樓主| 發表於 13-3-7 22:38 | 顯示全部樓層
謝謝大大的回文 :)  在網路爬文有看過,我對這點很是疑惑,那不就要等下一根K棒才能送出委託單嗎?  =.=
 樓主| 發表於 13-3-8 00:13 | 顯示全部樓層
編譯時產生錯誤  =.=
圖片 2.jpg
發表於 13-3-8 10:01 | 顯示全部樓層
用this bar好像會有問題
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-5-5 17:54

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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