I need to modify a 3rd party code. I simply want to have instead the Math.Abs the difference between the orderprice and the double price.
It is working and gives me values with
ATRdistShort = (int)Math.Round(Math.Abs(order.LimitPrice-price)/TickSize);
ATRdistLong = (int)Math.Round(Math.Abs(price-order.LimitPrice)/TickSize);
but of course its the Math.Abs.
I need the "+" and the "-" and when I change it to
ATRdistShort = (int)Math.Round((order.LimitPrice-price)/TickSize);
ATRdistLong = (int)Math.Round((price-order.LimitPrice)/TickSize);
then both show 0.
When I use instead of "Math.Abs" eg "Math.Max" as I would do in MS-Excel or MS-Access then I get an error-message when compiling with arguments.
What should I modify from the working lines please to have "+" int and "-" int from calculation.
Thank you!
Tony
Comment