Also ich hab es soweit jetzt hinbekommen nur das Problem ist das jetzt ERROR 1 kommt. Er versucht mehr mals den StopLoss an die selbe stelle zuziehen. Wie bekomme ich den Error weg?
Code:
for(int cnt = 0; cnt < total; cnt++)
{
if(!OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES))
Print("Error-OrderSelect: ");
if(OrderType() <= OP_SELL && OrderSymbol() == Symbol())
{
//---Buy
if(OrderType() == OP_BUY)
{
//---
//if(OrderSelect(Sell,SELECT_BY_POS,MODE_HISTORY))
if(total==1)
{
if(OrderOpenPrice()< Ask - 20*Point)
{
if(OrderStopLoss() != OrderOpenPrice())
{
if(!OrderModify(Buy,OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Green))
Print("Error: ");
else
Print("Check---Buy");
return;
}
}
}
}
else //---
{
//---Sell
//if(OrderSelect(Buy,SELECT_BY_POS,MODE_HISTORY))
if(total==1)
{
if(OrderOpenPrice()< Bid + 20*Point)
{
if( OrderStopLoss() != OrderOpenPrice())
{
if(!OrderModify(Sell,OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Red))
Print("Error: ");
else
Print("Check---Sell");
return;
}
}
}
}
}
}
Prüft er damit nicht ob der StopLoss am selben Platz ist? Oder hab ich jetzt einen Denkfehler
Code:
if( OrderStopLoss() != OrderOpenPrice())