Help About OrderModify

 

Hi,

 

ı want change to TakeProfit in MT4 but not to StopLoss when ı use OrderModify function Stoploss  be 00000. how can ı solve this?

 

 OrderSelect(ticket,SELECT_BY_POS,MODE_TRADES);

 OrderModify(ticket,OrderOpenPrice(),OrderStopLoss(),take_profit,0,clrAzure);

 Thanks for help.

 
OrderModify(ticket,OrderOpenPrice(),0,take_profit,0,clrAzure);
Just zero.
 
//+------------------------------------------------------------------+
//|                                                        buyac.mq4 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+

 
extern double TrailingStop=30;
extern double toplam;
extern double MA5;
extern double MA20;
 double Cena,cnt,selllot, buylot;
 double val,MA2,MA3;
 int ticket;
//+------------------------------------------------------------------+
int OnInit()
  {
//---
ticket = OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Bid-10*Point,Ask+100*Point,"TST",0,0,Green);
return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
    
  double take_profit= Ask+50*Point;
//---
 OrderSelect(ticket,SELECT_BY_POS,MODE_TRADES);

 OrderModify(ticket,OrderOpenPrice(),0,take_profit,0,clrAzure);



  }
//+------------------------------------------------------------------+
Stoploss be 00000 again
 

okay thanks ı solved.

 

Ch

 OrderSelect(ticket,SELECT_BY_TICKET);

 OrderModify(ticket,OrderOpenPrice(),OrderStopLoss(),take_profit,0,clrAzure);