V4中追蹤止盈代碼怎么寫? - TradeBlazer公式 [開拓者 TB]
- 咨詢內容:
- Params
- Numeric lots(1);
- Vars
- NumericSeries ma5;
- NumericSeries ma20;
- NumericSeries stopprofit;
- NumericSeries EntryPrice;
- NumericSeries ExitPrice;
- NumericSeries PriceAfterEntry;
- Begin
- ma5=Average(close,5);
- ma20=Average(close,20);
- PlotNumeric("ma5",ma5);
- PlotNumeric("ma20",ma20);
- If(CrossOver(ma5[1],ma20[1]))//Ma5上穿Ma20
- Buy(lots,open);
- Entryprice=open;
- If(marketposition==1&&PositionProfit>5)//盈利大于五點時追蹤止盈
- {stopprofit=EntryPrice+2;//止盈點在進場點上方2點
- ExitPrice=Max(open,stopprofit);
- }
- Sell(lots,ExitPrice);
- End
- TB技術人員: 請參考 幫助文檔 - 公式應用進階
- TB客服: 如果用A指令下單又怎么寫呢?
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 262069696 進行 有償 編寫!(不貴!點擊查看價格!)
- 上一篇:急急急 無源碼加密 同時加上公式加密問題…
- 下一篇:沒有了!
相關文章
-
指定的模型還沒有相關內容!