a need to close the position when the lines are crossing, they are opennig at the first crossing and must close(with profit or lose) at the next crossing.
my positions are opening but they don't whant close;/
my positions are opening but they don't whant close;/
Inserted Code
total = OrdersTotal();
if(total < 1)
{
if(isCrossed ==1 || m1==1)
{
ticket = OrderSend(Symbol(),0, Lots,Ask,3,Ask-100*Point,Ask+100*Point,
"", 12345, 0, Green);
}
if(isCrossed == 2 || s2==2)//
{
ticket = OrderSend(Symbol(),1, Lots, Bid,3,Bid+100*Point,Ask-100*Point,
"", 12345, 0, Red);
}
}
//--------------------------------------------------------------
return(0);
if(total>1)
{
if(OrderSelect(0,SELECT_BY_POS))
{
if(isCrossed == 1 && isCrossed == 2 )
{
OrderClose(OrderTicket(),Lots,Ask,Ask,Red);
}
}
}