投资者咨询:[求助]求助老师TB模型改写 (文华财经WH6赢顺V6.7)
来源:文华财经 日期:2018-8-3 12:02
能不能把下面TB开拓者软件的一个指标改成文华的指标,谢谢
Params
Numeric K1(50);
Numeric K2(7);
Numeric nOffSet(0);
Numeric stopLossSet(100);
Vars
NumericSeries a1;
NumericSeries a2;
Numeric MinPoint;
Numeric MyEntryPrice;
Numeric MyExitPrice;
Numeric stopLossPoint;
Numeric offSetDots;
bool cross1;
bool cross2;
Begin
offSetDots = nOffSet * MinMove * PriceScale;
a1=Highest(high[1],K1);
a2=Lowest(low[1],K2);
cross1=CrossOver(high,a1);
cross2=CrossUnder(low,a2);
If(cross1 && MarketPosition<>1)
{
Buy(1,a1+offSetDots);
}
If(cross2 && MarketPosition<>-1)
{
SellShort(1,a2-offSetDots);
}
stopLossPoint = stopLossSet * MinMove * PriceScale;
If(MarketPosition == 1)
{
myEntryPrice = AvgEntryPrice;
If(low <= myEntryPrice - stopLossPoint)
{
myExitPrice = myEntryPrice - stopLossPoint;
If(open < myExitPrice) myExitPrice = open;
Sell(0,myExitPrice);
}
}
else If (MarketPosition == -1)
{
myEntryPrice = AvgEntryPrice;
If(High >= myEntryPrice + stopLossPoint)
{
myExitPrice = myEntryPrice + stopLossPoint;
If(open > myExitPrice) myExitPrice = open;
BuyToCover(0,myExitPrice);
}
}
End
技术人员回复
日期:2018-8-3 13:16
wh6是专业的看盘软件支持加载简单的指标
分析您1楼提供的是程序化交易模型,语法结构与文华的程序化软件MQ语法相近
需要通过MQ软件来实现,请问您是否需要MQ的改写范例呢?
MQ官网:http://www.wenhua.com.cn/