Hi,
Is there any function in the code to save the results of a strategy (The ones we get using Equity Curve Data) on a file?
Thanks
Size:
Color:
Size:
Color:
I just tried the code below and I have the error
Runtime error: Objest Reference not set to an instance of an object at WealthLab.STrategies.OnTheFly.Execute()
CODE:
Please log in to see this code.
Size:
Color:
I'm currently somewhat busy with a library of PosSizers for 5.6 and the challenges it brings, so please bear with delays. Although this KB article is unsupported, I'll try to help you though. For this, I need enough food for thought and the checklist (see my link above) is likely to provide me with some.
Size:
Color:
Ok, thanks.
I am using Wealth-Lab 5.5, my computer has 4GB Ram and I use Vista 32 bits.
I create a new strategy,then delete all the code and paste the one from
WealthScript Techniques | Interacting Dynamically with Portfolio Level Equity
I then have the error below
Runtime error: Objest Reference not set to an instance of an object at WealthLab.STrategies.OnTheFly.Execute()
----------------------------------------
Size:
Color:
This is all that I already know. I need the data scale, which data provider, the data range, and the selected position sizing option.
Size:
Color:
By chance, if you selected "Max Percent Risk", you need to choose another position sizing option or introduce a RiskStopLevel to the code. This one requires a predefined RiskStopLevel and the Wiki code doesn't have one.
Size:
Color:
H,
sorry for my delay answer, I was away.
I did not choose Max Percent Risk. I took the Raw Profit mode with fix dollar position equal to 10,000 USD.
I took the stock AA from Dow 30.
Data scale is "Daily"
Data Range is "All Data"
Size:
Color:
Hi,
This setup works fine for me. Have you turned off On Demand Updates in the Data Manager and updated the dataset before running the strategy?
Size:
Color:
I confirm I have turned off On Demand Updates in the Data Manager and updated the dataset before running the strategy
Also I checked line by line and the issue may come from the line
DataSeries globalEquity = sr.EquityCurve
I also replaced "EquityCurve" by some others functions such as "CashCurve" (Which is also a DataSeries) and I have the same error message
Size:
Color:
If "globalEquity" has an issue, then the script's most likely having some trouble retrieving performance results from WL's global memory. Like it couldn't be found, it doesn't exist. I can not reproduce the problem. Try it on a different dataset, restarting WLD5.
Size:
Color:
I finally found what is the issue. I need to write the donor script first. below the code with no issue
CODE:
Please log in to see this code.
Size:
Color:
That's incorrect. The strategy does not work now as intended i.e. it should display the equity curve in its own pane (and that's all, no trades).
Usually, the order of classes shouldn't matter. But not in this case. Your modification effectively disables the "OnTheFly" class so it's not being processed. You just see the trades made by the dummy system that you normally shouldn't see, but no equity curve.
Size:
Color:
Yes, that s right. OntheFly is not executed anymore
I removed Wealth-lab and re-installed it. seems to work now. maybe bceause I re-started my computer too.
Will keep you in touch if any new issue. thanks
Size:
Color:
Restarting the computer (or simply Wealth-Lab) could have done the trick.
Size:
Color:
If you loop through each bar or date, and then "foreach (Position p in Positions)" inside this loop sum up each position's p/l so that [ total_equity = (p.NetProfitAsOfBar(bar) * position_sizeadjust) ], where I set that adjustment parameter "position_sizeadjust" to something like "if in raw profit mode then position_sizeadjust = 1 else position_sizeadjust = p.OverrideShareSize", then the equity data is summed just fine. An equity number per date, quick and easy. Or more in detail if you like, the equity per position per date. I typically lump this into a "StringBuilder" and then dump to a file when running scripts. The data is available via the "Equity curve" and right-click, however the file dump is more "automatic".
If that code is interesting to you, let me know. I do not know it this topic is closed or not (a while since last post), so I will leave out code for now.
Size:
Color:
As far as I can tell this is an approximation, because Strategies are executed with 1 share per trade (note: even trades skipped later due to insufficient funds!) and position sizing is applied after the fact.
Size:
Color:
Theoretically, a PosSizer in v5.6 can export the final equity curve (not approximated) to a file if needed (but what for?)
Size:
Color:
I am aware of skipped trades etc, yes. The equity that come out in my dump is in any case a 100% match according to what is produced in the "Trades" table in WL (no approximations, I think). I always hand-check all calculations - man, I have to!
Reason for this dumping of mine is really that WL seems not to be able to handle multi-currency positions. So I have to extract the local currency returns and work out the rest myself.
Example: If I want to implement a breakout strategy in short interest rates with in the global macro investment universe, for instance in eurodollar futures, there are a lot of markets outside the US - EUR, GBP, AUD, JPY, CHF, etc. In effect the returns for each futures contract comes out in the local currency, and if I want to look at the whole "global macro short-maturity interest rates book" as one then I have to transform the returns into the same base currency. Pointing-and-clicking and right-click-and-copy-and-paste for each single future/symbol is not the way to go about this, I think.
As mentioned in other posts, this issue is even more tricky when it comes to a book fx positions. It is doable, though, at the cost of having to build all the performance tools myself (cannot really use the standard stuff in WL).
Are there any plans to make the standard WL "performance visualizers" work with a portfolio of multi-currency fx and futures positions, is that on the "to-do table"? There are some issues here (e.g. having to supply the system with fx rates etc.), but I think it is doable
Size:
Color:
Multi-currency support is not on the radar for the moment.
Size:
Color:
If the equity dump is a 100% match, IMHO you're using fixed shares and no trades were skipped due to insufficient trades. If it works for you, then it's fine.
Size:
Color: