作者goodddog (domiante)
看板Trading
標題Re: [問題] multichart語法
時間Sat Jun 13 23:43:41 2015
※ 引述《ssdog (ssdog)》之銘言:
: 請教一下~有人知道超過基本成本單後 每漲跌50點的加碼語法如何寫?
: 收盤低到成本就全平 我每次寫都變成一直加碼 然後一直平倉
: if condition1 then buy("base") 1 share next bar at market;
: if entryprice +50 > entryprice then buy ("add1")1 share next bar at market;
: if avgentryprice < c then sell all shares next bar at market;
: 是不是要設一個變數去控制?該怎麼設啊?可以指導一下嗎?
下面兩列改一下試試
if C >= Entryprice+50 then buy ("add1") 1 share next bar at market;
if C <= Avgentryprice then sell all shares next bar at market;
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 106.104.66.219
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Trading/M.1434210224.A.504.html
1F:推 ssdog: 感謝你的回覆 但還是不行喔!一樣會出現重複買賣 06/14 07:31
2F:→ ssdog: 這一定要設一個變數 i=i+1 去控制 06/14 07:31
3F:推 Genki626: 設一個變數i 起始值為1 然後 if C >= Entryprice+50*i 06/14 07:50
4F:推 Genki626: 進場後 i=i+1 06/14 07:50
5F:推 Genki626: 這樣不知道可不可以 06/14 07:51
6F:→ coyoteY: currentcontracts? 06/14 08:19
7F:推 ssdog: 應該是樓上說的可以 但是EP*i -> CC*i 才對喔 06/14 09:02
8F:推 ssdog: 腦袋昏了 EP*i才對 06/14 09:09
9F:→ ssdog: 試過MP>0 CC=2 then buy("add1") 不行的 06/14 09:12
10F:推 GX90160SS: 其實單純語法問題直接丟到MC官方討論區就會有客服一號 06/14 11:33
11F:→ GX90160SS: 出來幫你解答惹 06/14 11:34
12F:推 ssdog: 以上感謝各位幫忙,謝啦! 06/14 13:31
13F:推 e76541: cross over? 06/16 13:03
14F:推 charles222: if marketposition=1 and 加碼條件 then buy...... 06/20 08:26