Calling PosSizer methods
Author: Rebelion
Creation Date: 3/20/2013 3:24 PM
profile picture

Rebelion

#1
Hello, guys. I'm trying to realize own signal collector through the Possizer (via sockets). Tried to realize mechanism of renewing winform I found that PosSizer's method "Initialize()" calling 3 times per one parameters changing and strategy signals renewing.
I have 2 questions:
1) Why 3 times?
2) How can I identify the time Possizer finished own work?

Thnxs.
profile picture

Eugene

#2
1) Wealth-Lab is calling your PosSizer to set the position size for the right click trade menu. That's why your SizePosition() method is called an extra time.

2) There's no formal way to know, but you could add a destructor to the PosSizer class. Due to #1, it will be called twice.
profile picture

Rebelion

#3
I understood how it works. Nothing hard, I'm dumb. Destructor isn't a variant - it's no determined time of destructor calling by GC. :(
But want to ask other question. I have Wealth-Lab on my 2 notebooks. I created Possizer and same strategy on my first notebook, but when I copied both dlls into the main wealth-lab directory, nothing happened - other wealth-lab didn't see neither strategy,nor possizer. What's the reason?

Thnxs.
profile picture

Eugene

#4
Right-click on both DLL files on your 2nd laptop and clear the attribute "downloaded from the Internet".
profile picture

Rebelion

#5
Eugene, a little question - how it possible to identify "IsStreamingMode" just through PosSizer? Thnxs.
profile picture

Eugene

#6
Through Reflection. Quick & dirty example in a WealthScript Strategy:

CODE:
Please log in to see this code.