作者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/cn.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