[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 285

 
BBSL:

The first is OrderSelect(0,SELECT_BY_TICKET); it needs order_type == OP_BUY to work, but in this case it does not work.

Thank you for your help.

Is there a zero ticket?

If you select by ticket, it does:

if (OrderSelect(order_id,SELECT_BY_TICKET) {
   if (OrderCloseTime()==0) order_type=OrderType();
   else Print("Ордер ", order_id, " закрыт");  
   }
else Print("Ошибка выбора ордера ", order_id, " - ", GetLastError());   
 

Yes. I wrote you on the previous one.

or order_id with SELECT_BY_TICKET

or 0 with SELECT_BY_POS

you mixed up 0 for SELECT_BY_TICKET.

and then you left the second unnecessary OrderSelect

 
sergeev:

Yes. I wrote you on the previous one.

or order_id with SELECT_BY_TICKET

or 0 with SELECT_BY_POS

you mixed up 0 for SELECT_BY_TICKET.

and then you left the second unnecessary OrderSelect


Thank you, is the second one not in if?
 
BBSL:

Thank you, the second one is not in the if?

Yes. Put this if in the first OrderSelect.

and delete the OrderSelect before OrderClose.

 
sergeev:

Yes. Put this if in the first OrderSelect.

and delete the OrderSelect that comes before OrderClose.



Right?



int send_orders(bool signal, int position_limit, string file_name){

int ticket_count = OrdersTotal();


if (ticket_count < position_limit){

Print("send_orders ticket_count = ", ticket_count);

if (signal == true){

Print("send_orders, signal BUY");

   order_id = OrderSend(Symbol(),OP_BUY,1.0,Ask,3,0,0,"expert comment",255,0,Green);
   if(order_id < 0)
     {
      error=GetLastError();
      Print("send_orders, error = ",ErrorDescription(error));
      return;
     }
}if (signal == false){

Print("send_orders, signal SELL");

   order_id = OrderSend(Symbol(),OP_SELL,1.0,Bid,3,0,0,"expert comment",255,0,Red);
   if(order_id < 0)
     {
      error=GetLastError();
      Print("send_orders, error = ",ErrorDescription(error));
      return;
     }
     }

}if (ticket_count == position_limit){

if(OrderSelect(order_id, SELECT_BY_TICKET)==true){

order_type = OrderType();

order_id = OrderTicket();

//----

Print("send_orders,  order already open");

if ((signal == false) && order_type == OP_BUY){

Print("send_orders,  is closing position");


OrderClose(OrderTicket(),1,Bid,3,Red);

}

}if ((signal == true ) && order_type == OP_SELL){

Print("send_orders,  is closing position");

OrderClose(OrderTicket(),1,Ask,3,Red);

}
}
}
 
BBSL:

Right?

Is it working?
 
sergeev:
is it working?


Re-camped, the ticks are coming up...

Five minutes, I'll write back, thank you very much, sergeev, artmedia70.

 
Good evening, could you please tell me if it is possible to change the thickness of the chart line on the chart, make it thinner?
 
sergeev:
is it working?


Bingo!!!!!Works!!!!

Thank you so much!)))

 
RekkeR:
Good evening, could you please tell me if it is possible to change the thickness of the chart line on the chart, make it thinner?
no