Don't get MathAbs to work.

 

Hello, Anyone out there who can help me with MathAbs,


I'm using a = MathAbs (a) ;


All I get with compiling is "some operator expected"


       trigger_hedge = ( OrderClosePrice() - OrderOpenPrice() )

       trigger_hedge=MathAbs(trigger_hedge); 



I've tried:

int trigger_hedge = 0 ;

double trigger_hedge = 0;

trigger_hedge = (int) (OrderClosePrice () - OrderOpenPrice () )


Thanks in advance for your help and support,

 
RLE:

Hello, Anyone out there who can help me with MathAbs,


I'm using a = MathAbs (a) ;


All I get with compiling is "some operator expected"


       trigger_hedge = ( OrderClosePrice() - OrderOpenPrice() );

       trigger_hedge=MathAbs(trigger_hedge); 


I've tried:

int trigger_hedge = 0 ;

double trigger_hedge = 0;

trigger_hedge = (int) (OrderClosePrice () - OrderOpenPrice () );


Thanks in advance for your help and support,

If this is the same code you used, there is a missing semicolon (;) 

 
trigger_hedge = ( OrderClosePrice() - OrderOpenPrice() ) trigger_hedge=MathAbs(trigger_hedge); 
What do you think this line means?
 
Fernando Morales:

If this is the same code you used, there is a missing semicolon (;) 

Dear William,


Thanks for the quick reply, you're amazing.

I feel very silly that I didn't see the missing semicolon !


Thanks again for the solution,

Reason: