MC加倉與分批出場策略源碼 如何根據各種狀況來加倉進場或分批出場,
作者:MC 來源:cxh99.com 發布時間:2014年08月21日
- 內容:
今天策略天地來教教大家如何根據各種狀況來加倉進場或分批出場,
1.相同條件下的加倉:if condition1 thenbuy next bar at market;加倉設置
加倉效果(這個的condition1=c>o):
2.不同條件加倉if condition1 thenbuy(“entry”) next bar at market;if condition2 thenbuy(“jiacang1”) next bar at market;if condition3 thenbuy(“jiacang2”) next bar at market; 這個的condition1 =c>o and marketposition=0condition2 =c>o and c[1]>o[1]condition3 = c>o and c[1]>o[1] and c[2]>o[2]
分批出場設置:// m.kzuj.com.cn
同一筆入場的多手持倉的相同條件的分筆出場分批出場開關:SameExitFromOneEntryOnceif c>o thenbuy 3 shares next bar at market;[SameExitFromOneEntryOnce = false];if c<o thensell 1 Contracts Next Bar At market;
同一筆入場的多手持倉的不同條件的分筆出場if condition1 thensell 1 Contracts total Next Bar At market;if condition2 thensell 1 Contracts total Next Bar At market;if condition3 thensell 1 Contracts total Next Bar At market;通過total 每次固定只平1手
- 不同進場或不同條件不同入場名稱的分批出場(按進場名稱出場),if c>o and marketposition=0 thenbuy ("entry") next bar at market;if c>o and c[1]>o[1] thenbuy ("jiacang1") next bar at market;if c>o and c[1]>o[1] and c[2]>o[2] thenbuy ("jiacang2") next bar at market;if c[1]<o[1] then beginsell from entry("entry") next bar at market;sell from entry("jiacang1") next bar at market;sell from entry("jiacang2") next bar at market;end;// m.kzuj.com.cn