void OnTrade() { if ( order == 1 && newby < 1 && newsel < 1 && Strade < 1 ) ChecTicket () ; } // out OnTrade() void ChecTicket () { long type=PositionGetInteger(POSITION_TYPE); if(type==(long)POSITION_TYPE_BUY ) newby=true; if(type==(long)POSITION_TYPE_SELL ) newsel=true; CPositionInfo myposition; // double pos_op_price = myposition.PriceOpen(); opprice = myposition.PriceOpen(); if ( opprice > 0) Opprce = (int)((opprice-Ksm)*Kms ); ; if ( opprice < 1) Opprce = B[1] ; } // Out ChecTicket ()