Code Error Kindly Guide New comment Preet Kanwaljit Singh 2009.11.21 23:16 will this code work to get the proper drawdown and target 2 times the drawdown in profits int tm, z; double lw, dd; for (int i=0;i<OrdersTotal();i++) { OrderSelect(i,SELECT_BY_POS,MODE_TRADES); tm = (TimeCurrent()-OrderOpenTime())/60; if (OrderType()==OP_BUY) { lw = iLow(Symbol(),1,(iLowest(Symbol(),1,MODE_LOW,tm,0))); dd = OrderOpenPrice()-lw; } if (OrderType()==OP_BUY && OrderSymbol()==Symbol()) {OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderOpenPrice()+(dd*2),0,Green);} } Low of an Open Trade Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. need some help with EA New comment
will this code work to get the proper drawdown and target 2 times the drawdown in profits
int tm, z;double lw, dd;
for (int i=0;i<OrdersTotal();i++)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
tm = (TimeCurrent()-OrderOpenTime())/60;
if (OrderType()==OP_BUY)
{
lw = iLow(Symbol(),1,(iLowest(Symbol(),1,MODE_LOW,tm,0)));
dd = OrderOpenPrice()-lw;
}
if (OrderType()==OP_BUY && OrderSymbol()==Symbol())
{OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),OrderOpenPrice()+(dd*2),0,Green);}
}