Check Code

 
i just wanted to check this example : //input in EA, takeprofit =30; stoploss =0;  //void akeprofitmodify(); if(Ask< TakeProfit) OrderModify(OrderTicket(),Ask,0,Ask+30*Point,0,0);
Is this correct? Thank you.
 
Is your program converting the takeprofit into a double?
 
dingo34:
Is your program converting the takeprofit into a double?

its assumued that tp=30 pips being converted to a double.

 
MThomp:
i just wanted to check this example : //input in EA, takeprofit =30; stoploss =0;  //void akeprofitmodify(); if(Ask< TakeProfit) OrderModify(OrderTicket(),Ask,0,Ask+30*Point,0,0);
Is this correct? Thank you.
It is not correct - you are comparing incompatible values
 
Mladen Rakic:
It is not correct - you are comparing incompatible values
 just wanted to check this example : //input in EA, Takeprofit =30; stoploss =0;  //void Takeprofitmodify(); if(TakeProfit>0) OrderModify(OrderTicket(),Ask,0,Ask+(30*Point,0,clrNONE);
Is this correct? Thank you.
 

There are so many fundamental flaws, it's time to stop and think about what you want to do. 

  • This is a (implicit) Long position
  • Longs close @ the Bid not the Ask
  • The price will always be less than the TP so even if the code were right (it's not, like Mladen says), the logic would ensure that all it does is constantly move the TP within the specified points of whatever the current price is, therefore it serves no purpose. 
 
nicholi shen:

There are so many fundamental flaws, it's time to stop and think about what you want to do. 

  • This is a (implicit) Long position
  • Longs close @ the Bid not the Ask
  • The price will always be less than the TP so even if the code were right (it's not, like Mladen says), the logic would ensure that all it does is constantly move the TP within the specified points of whatever the current price is, therefore it serves no purpose. 

The correct term or format for  'OrderModify'  to be written where  for example ,TP=80, distance=30. (assuming TP is currently zero).

Reason: