confusing in the loss value in < or > symbol

 

i have written a program on which i want to check if the OrderProfit() > 20 then it wil close the order , and if the OrderProfit() is more than -30 (  ie: if the value is -33 or -50 like wise it should open another reverse order to compasinate the loss inquired ) but here is the problem , when 

if(OrderProfit()> -30 && OrderProfit() < 0) 


 is working its not purchasing the orders neither 

if(OrderProfit()< -30 && OrderProfit() < 0) 

what i should do i am trying hard please help if you need a copy of this program , it earns profit for sure 

 
Rinkan Rohit:

i have written a program on which i want to check if the OrderProfit() > 20 then it wil close the order

, and if the OrderProfit() is more than -30

 is working its not purchasing the orders neither 

  1. if(OrderProfit() > 20) 

  2. You don't want to do anything if it is more than -30. You want to SAR if it is less than -30
    if(OrderProfit() < -30) 

  3. Do you really expect an answer? We can't see your broken code. There are no mind readers here and our crystal balls are cracked.

  4. if(OrderProfit()> -30 && OrderProfit() < 0) 
    Don't write range checks like that - it is confusing.
    if(-30 < OrderProfit() && OrderProfit() < 0) // between (-30 … 0)