|
范例
sellshort 15 Shares Next Bar At market;
If time = 1000 Then
Buytocover 5 Contracts Next Bar
At entryprice - 10 stop;
If time = 1001 Then
Buytocover 5 Contracts Next Bar
At entryprice - 10 stop;
If time = 1002 Then
Buytocover 5 Contracts Next Bar
At entryprice - 10 stop;
使用SameExitFromOneEntryOnce,只写一个出场语句,减少了代码的冗余,效果相同:
sellshort 15 Shares Next Bar At market;
[SameExitFromOneEntryOnce = false];
If time >= 1000 Then
Buytocover 5 Contracts Next Bar
At entryprice - 10 stop;
|