COCO研究院

 找回密碼
 註冊
搜索
查看: 3839|回復: 8

請教Multicharts語法?

[複製鏈接]
發表於 13-1-8 10:01 | 顯示全部樓層 |閱讀模式
以下為tradestation程式碼
vars : buyline(0);
buyline = highd(1)-lowd(1);
if time>0910.00 and time< 1310.00 and marketpositions=0
then buy("buy")buyline stop;
end;

請問紅色字能夠改成MC的嗎? 謝謝大家

發表於 13-1-8 10:17 | 顯示全部樓層
vars : buyline(0);
buyline = highd(1)-lowd(1);
if time>0910.00 and time< 1310.00 and marketpositions=0
then buy("buy")buyline stop;
end;

大大...小弟有個疑問

buyline = highd(1)-lowd(1);====>假設前一天高7800低7600.....

buyline不就等於200....這樣用200點買應該不會成交吧?

 樓主| 發表於 13-1-8 10:19 | 顯示全部樓層
喔 那一段只是代表拉 原程式太長 所以刪減成這樣
發表於 13-1-8 11:02 | 顯示全部樓層
vars : buyline(0);
buyline = highd(1)-lowd(1);
if time>0910.00 and time< 1310.00 and marketpositions=0
then buy("buy")buyline stop;
end;  <------這一行刪掉應該就行了。
 樓主| 發表於 13-1-8 11:14 | 顯示全部樓層
阿政大, 您好, 小弟改成
if marketposition=0 and time>0910 and time< 1310
then  buy("BUY1") buyline stop;

之後會出現

------ Compiled with error(s): ------
syntax error, expecting 'stop', 'limit', 'contracts', or 'shares'
errLine 27, errColumn 18, errLineEnd 27, errColumnEnd 18

小弟實在不太懂
發表於 13-1-8 11:42 | 顯示全部樓層
vars : buyline(0);
buyline = highd(1)-lowd(1);
if time>0910.00 and time< 1310.00 and marketpositions=0
then buy("buy") Next Bar buyline stop;
發表於 13-1-8 11:50 | 顯示全部樓層
本帖最後由 期貨藝術家 於 13-1-8 11:51 編輯
sangi 發表於 13-1-8 11:42
vars : buyline(0);
buyline = highd(1)-lowd(1);
if time>0910.00 and time< 1310.00 and marketpositions ...


正解...

其實如果是limit或stop.....

在MC也可以用This bar.....不過不建議啦....


 樓主| 發表於 13-1-8 12:58 | 顯示全部樓層
所以MC中不能像TS或HTS一樣直接寫
then  buy("BUY1") buyline stop; ??
謝謝大家
發表於 13-1-8 13:12 | 顯示全部樓層
540ul4rm6 發表於 13-1-8 12:58
所以MC中不能像TS或HTS一樣直接寫
then  buy("BUY1") buyline stop; ??
謝謝大家

映象中一定要有bar....

不過停利跟停損倒不用...

只要


setprofittarget(SP*200);
setstoploss(sl*200);

在下單機那也可以設定是要先丟停損單或碰到價再丟
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-5-1 04:00

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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