Open nikolas-joyce opened 6 years ago
Checked, and I can confirm that V2 alphas don't have costs series:
!NEW_AlphaV1Exposure_HedgedBy_V2_US_CL_EXOSemiFuture_DynKel_80_20_shorts_for_short_DSP_Combination__Bearish_2_Aug_7_47 CostsSum: 0.0
!NEW_AlphaV1Exposure_HedgedBy_V2_US_CL_EXOSemiFuture_DynKel_20_80_longs_for_DSP_InstaTrendline__Bullish_Aug_7_33 CostsSum: 0.0
CL_ContFut_Short_Strategy_DSP_LPBP_Combination__Bearish_2_Aug_7_custom CostsSum: -3579.0
!NEW_AlphaV1Exposure_HedgedBy_V2_IndexEXOLongEnhance_DT_PutSpread_DSP_LowPass__Bullish_Aug_29_33 CostsSum: 0.0
!NEW_AlphaV1Exposure_HedgedBy_V2_US_CL_EXO_PutSpread_DynKel_longs_DSP_LowPass__Bullish_Aug_29_18 CostsSum: 0.0
!NEW_NEW_AlphaV1Exposure_HedgedBy_V2_IndexCL_EXOLongEnhance_DT_PutSpread_DSP_LPBP_Combination__Bullish_32_Sept_21_63 CostsSum: 0.0
CL_ContFut_Long_Strategy_DSP_LowPass__Bullish_Aug_29_custom CostsSum: -3654.0
!NEW_AlphaV1Exposure_HedgedBy_V2_US_CL_EXOSemiFuture_DynKel_20_60_longs_for_DSP_LowPass__Bullish_Aug_29_33 CostsSum: 0.0
!NEW_AlphaV1Exposure_HedgedBy_V2_IndexEXOShortEnhance_DT_2_CallSpread_DSP_LPBP_Combination__Bearish_32_Sept_21_63 CostsSum: 0.0
!NEW_AlphaV1Exposure_HedgedBy_V2_IndexEXOLongEnhance_DT_PutSpread_DSP_InstaTrendline__Bullish_Aug_7_33 CostsSum: 0.0
!NEW_AlphaV1Exposure_HedgedBy_V2_IndexEXOShortEnhance_DT_2_CallSpread_DSP_Combination__Bearish_2_Aug_7_43 CostsSum: 0.0
CL_ContFut_Long_Strategy_DSP_InstaTrendline__Bullish_Aug_7_custom CostsSum: -2958.0
However, could you check costs settings in alpha/index scripts? I think that the costs settings are 0.0. Otherwise, I will dig deeper.
I will recheck but I know we included the costs earlier when we were building the v2 hedge legs, I can see the costs in the v2 viewer maybe they are just not in the deployed script.
Sent from my iPhone
On Nov 3, 2017, at 4:09 AM, alexveden notifications@github.com<mailto:notifications@github.com> wrote:
Checked, and I can confirm that V2 alphas don't have costs series:
!NEW_AlphaV1Exposure_HedgedBy_V2_US_CL_EXOSemiFuture_DynKel_80_20_shorts_for_short_DSP_CombinationBearish_2_Aug_7_47 CostsSum: 0.0 !NEW_AlphaV1Exposure_HedgedBy_V2_US_CL_EXOSemiFuture_DynKel_20_80_longs_for_DSP_InstaTrendline__Bullish_Aug_7_33 CostsSum: 0.0 CL_ContFut_Short_Strategy_DSP_LPBP_CombinationBearish_2_Aug_7_custom CostsSum: -3579.0 !NEW_AlphaV1Exposure_HedgedBy_V2_IndexEXOLongEnhance_DT_PutSpread_DSP_LowPassBullish_Aug_29_33 CostsSum: 0.0 !NEW_AlphaV1Exposure_HedgedBy_V2_US_CL_EXO_PutSpread_DynKel_longs_DSP_LowPassBullish_Aug_29_18 CostsSum: 0.0 !NEW_NEW_AlphaV1Exposure_HedgedBy_V2_IndexCL_EXOLongEnhance_DT_PutSpread_DSP_LPBP_CombinationBullish_32_Sept_21_63 CostsSum: 0.0 CL_ContFut_Long_Strategy_DSP_LowPassBullish_Aug_29_custom CostsSum: -3654.0 !NEW_AlphaV1Exposure_HedgedBy_V2_US_CL_EXOSemiFuture_DynKel_20_60_longs_for_DSP_LowPassBullish_Aug_29_33 CostsSum: 0.0 !NEW_AlphaV1Exposure_HedgedBy_V2_IndexEXOShortEnhance_DT_2_CallSpread_DSP_LPBP_CombinationBearish_32_Sept_21_63 CostsSum: 0.0 !NEW_AlphaV1Exposure_HedgedBy_V2_IndexEXOLongEnhance_DT_PutSpread_DSP_InstaTrendlineBullish_Aug_7_33 CostsSum: 0.0 !NEW_AlphaV1Exposure_HedgedBy_V2_IndexEXOShortEnhance_DT_2_CallSpread_DSP_CombinationBearish_2_Aug_7_43 CostsSum: 0.0 CL_ContFut_Long_Strategy_DSP_InstaTrendline__Bullish_Aug_7_custom CostsSum: -2958.0
However, could you check costs settings in alpha/index scripts? I think that the costs settings are 0.0. Otherwise, I will dig deeper.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftrendmanagement%2FTmqr-framework-2%2Fissues%2F80%23issuecomment-341675474&data=02%7C01%7Cnikolasjoyce%40hotmail.com%7C58c3345fb27847e6953e08d522ab6974%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636453041952872787&sdata=Lu1oqY5BXxvIcKCv0TiV0Krn9ppuSPzmvYbE8diVoPE%3D&reserved=0, or mute the threadhttps://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FARobLFdjNVPJx03ELk8M6w1yXQ6Rvj8oks5syvSBgaJpZM4QQNhU&data=02%7C01%7Cnikolasjoyce%40hotmail.com%7C58c3345fb27847e6953e08d522ab6974%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636453041952872787&sdata=y6a6bOswKaew6NUhLVn7XTSwEtHeVutbw6jw8EOFfjY%3D&reserved=0.
Task for Monday, 6 Nov 9:00am PST @alexveden could you confirm that costs for v2 hedge legs are included in the campaign costs. Here is what is causing the confusion. the v2 viewer seems to have the costs included from here....
https://10.0.1.2:8889/notebooks/indexes/EXO%20Viewer%20v2.ipynb
but in the reporting notebooks which were built for V1 it appears that the V2 legs are not being included in the cost totals.
https://10.0.1.2:8888/notebooks/Performance%20Tracking/All_Production_Campaign_Settlements-Email_template-WedbushAccts-ArchiveBased.ipynb
@spickering-git what are your comments?
At the index level the costs are clearly there, this is passed into the https://github.com/trendmanagement/Tmqr-framework-2/blob/9b48a16244a152c5d45ab2eb61ea33d6c2eb6f13/tmqrscripts/run_indexes/run_indexes.py#L257 https://github.com/trendmanagement/Tmqr-framework-2/blob/9b48a16244a152c5d45ab2eb61ea33d6c2eb6f13/tmqrscripts/run_indexes/run_indexes.py#L258
and these values are saved into the index_data collection
clearly being used in the index calculation https://github.com/trendmanagement/Tmqr-framework-2/blob/9b48a16244a152c5d45ab2eb61ea33d6c2eb6f13/tmqrindex/index_exo_base.py#L23 https://github.com/trendmanagement/Tmqr-framework-2/blob/9b48a16244a152c5d45ab2eb61ea33d6c2eb6f13/tmqrindex/index_exo_base.py#L24
@alexveden and @nikolas-joyce
I don't see a costs per contract in the context field in any of the alphas in the alpha_data collection
and when analyzing the context field of the alphas Nik has set up in
https://10.0.1.2:8889/notebooks/alphas
i don't see a costs_per_option or a costs_per_contract.
I think possibly a main alpha template was set up for Nik to use without these fields filled in and he has replicated it hundreds of times without being made aware to include.
Since the fee is included in the EXO Index and Not in the Alpha does that mean there still are fees from the EXO Index just not the transaction fees from trading in and out of the EXO with the alpha signals.
@spickering-git you are correct, the costs must be set in the 'context'
Here is diagnostics notebook: https://10.0.1.2:8889/notebooks/tools/alpha_costs_diagnostics.ipynb
Also, I've added missing costs warnings to AlphaV1HedgeWithIndex and now it is set to 3.0 by default.
QUESTION:
there are fees taken at the index level
but the alphas that use those indexes have not included fees
does that mean that there are still fees taken at the index level, so when the alpha says hold the index, there are index fees
and the alpha fees are just at the transaction points of the alpha,
where the alpha trades in and out of the index
ANSWER: fees for alphas and indexes are independent. you need set both. So if you run alphas without the costs on the index with costs, the results of alpha backtesting won't include costs
FINALLY:
this says there are fees in the index yes that is strictly just when looking at the index on its own correct that will not reflect anything in the alphas exactly
looks like the V2 must not be including in the reporting.
https://10.0.1.2:8888/notebooks/campaign_management/Campaign_Bidirectional_CL_ContFut_DSP%20for%20production_Oct3_w_DynKel.ipynb
@alexveden TASK can you confirm this report is working correctly by 3 November @ 9:30 am PST.