Number of decimal places
Author: dansmo
Creation Date: 2/25/2010 7:06 AM
profile picture

dansmo

#1
Hi,

in WLD5: where can I set the maximum numbers of decimal places?

dansmo
profile picture

Eugene

#2
No such global option. Use Symbol Info Manager to define a symbol (wildcards are supported) and set the desired number of decimal places.
profile picture

Eugene

#3
P.S. For use in strategies, you can use String.Format to set digits after decimal point e.g.
CODE:
Please log in to see this code.
profile picture

dansmo

#4
Hmm. I am trading european stocks, which have up to 4 decimal places. The chart only shows 2. How can I change this?
profile picture

Eugene

#5
See reply # 2/25/2010 7:10 AM.
profile picture

dansmo

#6
Having a list of 600 symbols, which also change regularly as some some are replaced: how can this be done efficiently?
What is the reason that this is done differently from WLD3?
profile picture

dansmo

#7
Maybe I totally misunderstood, but...

I have now entered the following rule to Symbol Info Manager:

*********** Equity 1 1 0,001 3
and have one additional rule for a future contract
FDAX Future 10000 25 0,5 2

All my stocks are now shown with 3 decimals and my future is still shown with 2 decimals.

This is just like I need it, but I somehow understood your example in the help section with the ES**
differently!?
profile picture

Eugene

#8
Yes, using wildcards as suggested above seems to be the way to go for a large universe of equity symbols.
profile picture

dansmo

#9
how many decimals do indicators use?
profile picture

Eugene

#10
Indicators = DataSeries = double precision.
profile picture

dansmo

#11
Eugene,

there is really something weird happening:
I have a limit active @ 10.4601 and the low is 10.460.
Why do I not get a trade?

Edit:
From the debug window:
3714,LimitB = 10,4601
3714,Low +1 = 10,460000038
profile picture

Eugene

#12
Sounds like 'Limit order slippage' is activated in the WL's Preferences.
profile picture

dansmo

#13
no, not activated.

Edit:
even this simple line wont buy at that specified bar
CODE:
Please log in to see this code.


a change to
CODE:
Please log in to see this code.

will do it. So...maybe there´s something wrong with four decimals?
profile picture

Eugene

#14
Position sizing?
profile picture

dansmo

#15
raw profit mode, 1 share.

edit: please see edit in posting #2/25/2010 9:03 AM .
profile picture

Eugene

#16
Hmm, in my test Strategy a Limit order is filled @ 10.46 (i.e. Low) w/o any special tricks. Limit order slippage, commissions etc. - everything is disabled, Symbol Info Mgr settings are identical to yours # 2/25/2010 7:40 AM.

Are 'Round stocks to nearest 100' disabled?
profile picture

dansmo

#17
QUOTE:
Are 'Round stocks to nearest 100' disabled?


No. How should we proceed?
profile picture

Eugene

#18
We are proceeding, bit by bit.

If they're not disabled, maybe you should try disabling it? Raw Profit, 1 share + Round to nearest 100 = no trade.
profile picture

dansmo

#19
sorry, I meant they ARE disabled.
profile picture

Eugene

#20
So, let's sum this up:

1) We have this in Symbol Info Mgr
*********** Equity 1 1 0,001 3

2) We have all related checkboxes that we can think of disabled in Preferences

3) The status line of the Trades tab doesn't show that your trade is skipped (or does it?)

4) We have a data file that looks like this:
QUOTE:
20100224,10.5,10.6,10.4,10.55
20100225,10.5,10.6,10.4,10.55


Heck, even this is going to work:
QUOTE:
20100224,10.5,10.6,10.4,10.55
20100225,10.4,10.4,10.4,10.4


4) Our code is:

CODE:
Please log in to see this code.


And the trade doesn't execute for you?
profile picture

dansmo

#21
1) Yes
2) Yes
3) nothing skipped
4) Data is coming from BBLoader.
25.08.2009 11,07499981 11,30000019 11 11,30000019 3682214
26.08.2009 11,30000019 11,39999962 11,15999985 11,19999981 3050906
27.08.2009 11,18999958 11,31499958 11,05000019 11,13500023 3105218
28.08.2009 11,17000008 11,31499958 11,14999962 11,31000042 3213950
31.08.2009 11,24499989 11,27499962 11,15499973 11,19999981 1932913
01.09.2009 11,26500034 11,33500004 10,81499958 10,81499958 4644478
02.09.2009 10,80000019 10,80000019 10,46000004 10,64000034 4252956
03.09.2009 10,64999962 10,94499969 10,60000038 10,70499992 4564448
04.09.2009 10,69999981 10,89500046 10,59000015 10,73499966 3528003

The trade should be @ 02.09.2009.

5)
my code:
CODE:
Please log in to see this code.


Well, of course you should change bar == 3714 then.
profile picture

Cone

#22
In your data should the trade occur on bar 3714, or is it on bar + 1, 3715?
profile picture

Eugene

#23
Yes, I can confrim it. It goes away when you:

a) change the bar's low from 10.46000004 to 10.46, or
b) increase the Tick from 0.001 to 0.0001, or
c) avoid the equality by adding epsilon to the limit price:
CODE:
Please log in to see this code.

So it seems to be a data precision / rounding issue.
profile picture

Cone

#24
I just ran it and came to the same conclusion, yet I can't remember why it works this way for Version 5. I seem to recall that there's something "hard-wired" for 2 decimals for equities, but even so, it doesn't make sense that a limit order whose trigger is slightly higher should fail. Please create a Support Ticket for me to follow up.
profile picture

Eugene

#25
Hmm, the effect will be the same if the symbol is changed to "Future" in Symbol Info Mgr, so equities aren't necessarily the culprit.

That "something hardwired", I'm afraid, is an internal procedure called by Buy/ShortAt* that does some tick adjustment. The one that never allowed to implement "Interacting with Equity Curve" to its fullest. :( It's Stop and Limit orders that were affected the most by that hardcoded adjustment.
profile picture

dansmo

#26
So, if I understand you correct

a) you can reproduce the effect that this trade should be done but it isn´t.
b) that this is a severe bug and should be fixed asap.

I tried to migrate my strategies from WLD3 to WLD5 some months ago and failed because I could not reproduce the resulst from v3 in v5. Since I had no pressure to move to v5 I just didnt put much more effort to it. At least I now know that it was not my failure.

@Cone

Do you still need a ticket?
profile picture

Eugene

#27
I wouldn't claim it's "severe" and "asap" (because you would hardly be able to buy at limit at the exact low anyway), but creating the ticket is still a good idea - we finally need to question this tick adjustment for equities!
profile picture

dansmo

#28
QUOTE:
I wouldn't claim it's "severe" and "asap" (because you would hardly be able to buy at limit at the exact low anyway), but creating the ticket is still a good idea - we finally need to question this tick adjustment for equities!


Thats not the right question I think. Trades are the heart of the program and should work perfectly, no matter how realistic the trades are. If I cannot trust this process I cannot trust v5 and will not use it.
Probably you can swap "me" and "I" to all your customers.
profile picture

Cone

#29
Yes, I'd like a ticket to ensure follow up, please.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).