本帖最后由 colin.hong 于 2024-6-19 21:36 编辑
if(OrderType()==OP_SELL)
{
if(OrderStopLoss()==0 && 最后的空单价格<Bid+均价止损点数*Point)
{
slp=Bid+均价止损点数*Point;
if(!OrderModify(OrderTicket(),OrderOpenPrice(),slp,OrderTakeProfit(),0))Print(" Sell均价止损成功");
}
if(NormalizeDouble(OrderTakeProfit()-stpp,8)!=0)
{
if(!OrderModify(OrderTicket(),OrderOpenPrice(),sslpp,stpp,0))Print(" Sell均价止盈成功");
}
if(OrderStopLoss()> 最后的空单价格 && 空第一单开单价格-Bid>均价保本点数*Point && 均价保本点数>0 && (OrderTakeProfit()+(均价止盈点数-均价保本启动点数)*Point)>Bid)
{
slp=空第一单开单价格-均价保本点数*Point; -- 此处,以空单均价盈利+均价保本点,请问大神怎么写???
if(!OrderModify(OrderTicket(),OrderOpenPrice(),slp,OrderTakeProfit(),0))Print(" Sell均价保本止损成功");
===================================================================
if(OrderType()==OP_BUY)
{
if(OrderStopLoss()==0 && 最后的多单价格>Ask-均价止损点数*Point)
{
double slp=Ask-均价止损点数*Point;
if(!OrderModify(OrderTicket(),OrderOpenPrice(),slp,OrderTakeProfit(),0))Print(" Buy均价设止损成功");
}
if(NormalizeDouble(OrderTakeProfit()-btpp,8)!=0)
{
if(!OrderModify(OrderTicket(),OrderOpenPrice(),bslpp,btpp,0))Print(" Buy均价设止盈成功");
}
if(OrderStopLoss()<最后的多单价格 && (Ask-多第一单开单价格> 均价保本点数*Point) && 均价保本点数>0 && (OrderTakeProfit()-(均价止盈点数-均价保本启动点数)*Point)<Ask)
{
slp=多第一单开单价格+均价保本点数*Point; -- 此处,以多单均价盈利+均价保本点,请问大神怎么写???
if(!OrderModify(OrderTicket(),OrderOpenPrice(),slp,OrderTakeProfit(),0))Print(" Buy均价保本止损成功");
感谢!
|