ea调整
一款用在黄金上的ea,发现用在镑美上,小数点有问题,求教如何将以下代码换成镑美和棒日的适用版本//+------------------------------------------------------------------+
//| trailing stop |
//+------------------------------------------------------------------+
void trailingstop(int tspoint,int stspoint)
{
for(int i=0;i<OrdersTotal();i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)
{
if(OrderSymbol()==Symbol() && OrderMagicNumber()==magic)
{
if(OrderType()==OP_BUY)
{
if((Bid-tspoint*_point)>OrderStopLoss() && (Bid-(tspoint+stspoint)*_Point)>OrderOpenPrice())
{
bool tb=OrderModify(OrderTicket(),OrderOpenPrice(),Bid-tspoint*_Point,OrderTakeProfit(),0,clrGreen);
}
}
if(OrderType()==OP_SELL)
{
if((Ask+tspoint*_point)<OrderStopLoss() && (Ask+(tspoint+stspoint)*_Point)<OrderOpenPrice())
{
bool ts=OrderModify(OrderTicket(),OrderOpenPrice(),Ask+tspoint*_Point,OrderTakeProfit(),0,clrGreen);
}
}
}
}
页:
[1]