Params
Numeric length(5);
Numeric hands(1);
Numeric Stop_win(2000);
Numeric Stop_loss(1000);
Numeric n(-2);
Vars
Numeric myhigh;
Numeric mylow;
Numeric MyEntryPrice;
Numeric MyExitPrice;
Begin
if(time>=0.1455)
{
if(MarketPosition==1)
sell(0,open);
if(MarketPosition==-1)
{
buytocover(0,open);
}
}
myhigh = Highest(High[1],length);
mylow = Lowest(Low[1],length);
PlotNumeric("myhigh",myhigh);
PlotNumeric("mylow",mylow);
if (High>myhigh and MarketPosition1 and open=0.0901 time 1 and open>myhigh and time>=0.0901 time -1 and open>=mylow and time>=0.0901 time -1 and open=0.0901 time = MyEntryPrice + Stop_win) // 止赢条件表达式
{
MyExitPrice = MyEntryPrice + Stop_win;
If(Open > MyExitPrice) MyExitPrice = Open;
// 如果该Bar开盘价有跳空触发,则用开盘价代替
Sell(0,MyExitPrice);
}else if(Low = MyEntryPrice + Stop_loss)// 止损条件表达式
{
MyExitPrice = MyEntryPrice + Stop_loss;
If(Open > MyExitPrice) MyExitPrice = Open;
// 如果该Bar开盘价有跳空触发,则用开盘价代替
BuyToCover(0,MyExitPrice);
}
}
End