Board logo

标题: MultiCharts-加仓与分批出场 [打印本页]

作者: 龙听    时间: 2022-11-7 10:56     标题: MultiCharts-加仓与分批出场

今天来教教大家如何根据各种状况来加仓进场或分批出场,

1.相同条件下的加仓:
  1. if  condition1  then buy next bar at market;
复制代码
加仓设置



加仓效果(这示范的condition1=close>o):



2.不同条件加仓
  1. if  condition1  then buy(“entry”) next bar at market;
  2. if  condition2  then buy(“jiacang1”) next bar at market;
  3. if  condition3  then buy(“jiacang2”)  next bar at market;  
复制代码
这个的
  1. condition1 =close>o and marketposition=0
  2. condition2 =close>o and close[1]>open[1]
  3. condition3 =close>o and close[1]>open[1] and close[2]>open[2]
复制代码
加仓设置:



加仓效果:


3. 同一笔入场的多手持仓的相同条件的分笔出场
分批出场开关:SameExitFromOneEntryOnce
  1. if close>o then buy 3 shares  next bar at market;
  2. [SameExitFromOneEntryOnce = false];
  3. if close<o then sell 1 Contracts Next Bar At market;
复制代码
分批出场效果



4. 同一笔入场的多手持仓的不同条件的分笔出场
  1. if condition1 then sell 1 Contracts total Next Bar At market;
  2. if condition2 then sell 1 Contracts total Next Bar At market;
  3. if condition3  then sell 1 Contracts total Next Bar At market;
复制代码
通过total 每次固定只平1手

平仓效果


5. 不同进场或不同条件不同入场名称的分批出场(按进场名称出场),
  1. if  close>o and marketposition=0   then buy ("entry") next bar at market;
  2. if  close>o and close[1]>open[1]   then buy ("jiacang1") next bar at market;
  3. if  close>o and close[1]>open[1] and close[2]>open[2]  then buy ("jiacang2")  next bar at market;

  4. if close[1]<open[1] then begin
  5.    sell from entry("entry") next bar at market;
  6.    sell from entry("jiacang1") next bar at market;
  7.    sell from entry("jiacang2") next bar at market;
  8. end;
复制代码
出场效果 :





欢迎光临 龙听期货论坛 (http://www.qhlt.cn/) Powered by Discuz! 7.2