Info in the SQX summary doesn't match xlsx Export in terms of "# AVG bars in trade".
In my research also "Exposure" is also not "right", but I don't know how you count it. Please check these measures for Stockpicker if possible.
There are very important numbers for portfolio creation.
The screens and sample strategy are attached.
Thanks!
Michal
Attachment image-1.png added
Hello,
statistical values of the strategies are calculating using Databanks snippets.
You can open CodeEditor and check the exact formula of each metric (AvgBarsInTrade, Exposure...)
Please check it and let me know if you have any further questions.
Attachment 2023-05-31 09-54-04.mp4 added
Attachment TradelistExport.xlsx added
Attachment Sample_Limit.sqx added
1. I'm sure that # of bars is wrong - please see a short movie I have recorded showing the problem. Avg. need and is 5 in this example (in Excel also), but the measure is showing 1.7. All files are attached.
2. I see that exposure assumption is "Exposure = # bars in all positions / total # bars in the sample",
Then it is based on #of bars,
if #of bars is wrong, then all measures based on that measure are wrong also.
Status changed from New to Waiting for information
As for the exposure - the idea behind formula is as you write: # in days when there was a position / total # of all days.
But when computing the metrics we don't get information about the bars - we know only start+end date of the data, and open+close time for every trade.
We compute exposure from this - so it is computed using days between these dates, not real bars.
Holidays and weekends are included - but both on the total side and on the trades side. So computed exposure is not 100% exact, but it should be very close to the real value.
Attachment Sample_Limi.sqx added
Attachment screen1.png added
Attachment screen2.png added
Attachment TradelistExportStockpicker.xlsx added
I agree with the Exposure formula "# in days when there was a position / total # of all days".
But my question is: is the current calculation accurate also for Stockpicker? Because in stockpicker we split the capital between "Max open positions" number.
In my calculations the answer is no.
Let me ilustrate it by Tradelist example:
1. I created a column Days in trade = Close Date - Open Date (screen1).
2. I created a pivot table and summary on top of that (screen2).
3. I count a "Max load" assuming that in all days, are open all 20 positions (my set in max open position settings)
3. Avg exposure in this period is 57%, SQX exposure is showing me 99,85%
I know it is not simply subject but quite important during creating of the Portfolio process. I'm sure you will find the right solution to it :)
Best regards,
Michal
PS. Spreadsheet and strategy with my settings are attached.
Status changed from Waiting for information to Fixed
As for exposure - it depends on what exactly exposure it - there are multiple definitions.
In the exposure algorithm we use the definition that doesn't consider number of positions, only if that day was something open or not.
But your point of view is useful as well, so we'll add another ExposurePosition metric that will consider also number of open positions compared to total max positions allowed.
This is what you describe. It will bein the next public build.
Attachment scr_.png added
I don't see the ExposurePosition in RC4 build. Did you publish it already?
Best regards,
Michal
Attachment image-0.png added
You have to go to Databanks and create a new view with column "Exposure Position".
You can also create a new Overview template using CodeEditor and display the metric if your want :)
Tamas
Attachment scr2.png added
Hello Tamas,
I see a new column, thanks!
I stuck a bit in the new view creation :P
Can you help me?
1. I cloned DefaultOpenDD view.
2. I renamed it - it is appearing OK
3. I try to fill a blank space below "Exposure".
I see it is row 228:
replace("S4_3", "", "");
I try to fill it like original Exposure, but the new measure is not available on the list to chose -> see the screen.
What do I need to change?
This is my current 228 row:
replace("S4_3", L.t("Exposure Position"), stats==null ? NA : d2(stats.getDouble(StatsKey.Exposure, 0))+" %");
Attachment image-0.png added
public static final String EXPOSURE_POSITION = "ExposurePosition";
It will be available in the next version. But it is just a string constant :)
It doesn't matter if you write there directly the name of the metric "ExposurePosition" or StatsKey.EXPOSURE_POSITION