- 精华
- 0
- 在线时间
- 171 小时
- UID
- 32158
- 积分
- 731
- 帖子
- 176
- 阅读权限
- 60
- 注册时间
- 2011-4-5
- 最后登录
- 2023-1-17
- 精华
- 0
- UID
- 32158
- 积分
- 731
- 帖子
- 176
- 主题
- 53
- 阅读权限
- 60
- 注册时间
- 2011-4-5
- 最后登录
- 2023-1-17
|
本帖最后由 jiaoyizhe 于 2011-9-17 07:03 编辑
品种为铜。仿照帮助中的例子所写,想表达的是百分比例回撤止盈的意思。
按照下面的写法测试,一点新的反应都没有,跟没写这部分的效果一样。困惑找不到原因所在。
……
MinPoint = MinMove*PriceScale;
MyEntryPrice = AvgEntryPrice;
TakeProfitSet = 0.9*MaxPositionProfit;
TakeProfitSet2 = 0.7*MaxPositionProfit;
TakeProfitSet3 = 0.5*MaxPositionProfit;
……- If(High >= MyEntryPrice + TakeProfitSet3*MinPoint && MaxPositionProfit > 800*MinPoint && MaxPositionProfit < 3000*MinPoint) // 多单止赢条件表达式3
- {
- MyExitPrice = MyEntryPrice + TakeProfitSet3*MinPoint;
- If(Open > MyExitPrice) MyExitPrice = Open; // 如果该Bar开盘价有跳空触发,则用开盘价代替
- Sell(entryLots,MyExitPrice);
- Return;
- }
- Else
- If(High >= MyEntryPrice + TakeProfitSet2*MinPoint && MaxPositionProfit > 3000*MinPoint) // 多单止赢条件表达式2
- {
- MyExitPrice = MyEntryPrice + TakeProfitSet2*MinPoint;
- If(Open > MyExitPrice) MyExitPrice = Open; // 如果该Bar开盘价有跳空触发,则用开盘价代替
- Sell(entryLots,MyExitPrice);
- Return;
- }
- Else
- If(High >= MyEntryPrice + TakeProfitSet*MinPoint && MaxPositionProfit > 6000*MinPoint) // 多单止赢条件表达式1
- {
- MyExitPrice = MyEntryPrice + TakeProfitSet*MinPoint;
- If(Open > MyExitPrice) MyExitPrice = Open; // 如果该Bar开盘价有跳空触发,则用开盘价代替
- Sell(entryLots,MyExitPrice);
- Return;
- }
复制代码 …… |
|