[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EL for special rounding



PureBytes Links

Trading Reference Links

Hello Barry,

Wednesday, July 17, 2002, 1:50:13 PM, you wrote:

BS> Can someone help with the code that accomplishes the following rounding:

BS> For Long:
BS>   A)  If price is above the .5 level go to next .5 and add .1   Thus, if
BS> price is 920.75 new price should be 921.60.

BS>   B)  If price is below the .5 level go to next .5 and add .1    Thus, if
BS> price is 920.25 new price should be 920.60

I use something similar for trail stops. Try this, hope it is what you
want or at least point you in the right direction:
For example A:

Vars: FracP(0), IntP(0);

FracP = @FracPortion(Close);
IntP = @IntPortion(Close);

Condition1 = FracP > 0.50 and FracP < 0.95;

If Condition1 then NewLevel = IntP + 1.60;

-- 
Best regards,
 Ian                            mailto:cuncom@xxxxxxxxx