Check Code

To add comments, please log in or register
MThomp
210
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.
dingo34
30
dingo34  
Is your program converting the takeprofit into a double?
MThomp
210
MThomp  
dingo34:
Is your program converting the takeprofit into a double?

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

Mladen Rakic
130282
Mladen Rakic  
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
MThomp
210
MThomp  
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.
nicholi shen
2388
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. 
MThomp
210
MThomp  
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).

To add comments, please log in or register