Dear collegues,
I don't have information about possibility of manual position management in WL 5.1/5.3. In earlier versions I used SetShareSize function. Is there analogous function in WL 5.1/5.3?
Size:
Color:
Not yet, but there will be in 5.4.
Size:
Color:
Thank you for your reply. And do you know when 5.4 version will be released?
Size:
Color:
I don't, but sometime after June probably.
Size:
Color:
can you suggest a work-around for this until position sizing comes in directly --
i have a script that trades two stocks based on a simple formula: y = a + bx (actually, y - bx = a). every time i buy symbol y i need to sell short b shares of x. how can i get the system to generate the correct number of shares of symbol x?
ideally, without using Microsoft Excel.
Size:
Color:
The work around would be to use Version 4.
Size:
Color:
The problem is not in generating trade with sertain amount of shared but in calculation of this amount. You cannot get information about current equity and cash in script. I hope in 5.4 version it will be possible
Size:
Color:
Size:
Color:
There is another more clear way for equity calculation. We can emulate account functionality in the script. For this we need to create wrappers for functions ByAtClose, CoverAtClose etc and recalculate equity after each trade by ourselves.
Size:
Color:
I don't think so. In portfolio simulation mode, all trades are pre-executed using 1 share per position - so the Shares property will always return 1 while the Strategy is executing. Position sizing is applied after the fact.
Size:
Color:
You are right. But at one bar you can do several trades with one share each. By this way we can emulate multishares trades.
Size:
Color:
Do you want to put WL5 to its knees by executing 100,000 trades on some bar to emulate a $100,000 position size? ;) No, this is not the way to go. WL5 works differently in this regard - so I would wait for 5.4 to bring the native support for sizing in Strategies.
Size:
Color:
You always can reduce starting capital without a big influence on strategy accuracy
Size:
Color:
I tried to write class Account for the futures mode that I mentioned before. It works for one instrument in raw profit mode and allow to obtain equity information inside the script and do multishared trades.
CODE:
Please log in to see this code.
Size:
Color:
Nice effort.
Size:
Color: