Unknown ticket for OrderModify

 
I've spent the last couple of days trying to learn MQL4 and programming a simple system, but have run into a problem I am unable to figure out.

I get 'Unknown ticket for OrderModify' when trying to modify an order with the following code:
"
if (reversal_long(valid_bars_limit)>reversal_point_lo ng)
{
reversal_point_long=reversal_long(valid_bars_limit );
Comment(reversal_point_long);
OrderModify(OrderTicket(),OrderOpenPrice(),reversa l_point_long,OrderTakeProfit(), 0,Green);
}
"

I've used the Comment to check if the calculations are correct and it changes according my calculations.
Still the open order does not change the stoploss and only generates the error.

Any clues as to ehat I'm doing wrong?


Thanks,
Rayner
 
Did You call OrderSelect function previously?
 
No I didn't. Fixed it and everything works just fine :)

Thanks stringo