kaisa_Nov9
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    分两步: 1. 单边 2. 对冲锁仓 long 300,000 usd GCE & short 30m yen & 待定 JY6 单边Unit 2 GCE : 6.2TGD : 3.08/3.1 JY6 (整数) 1.1 成本 1 GCE : 3.1TGD : 1.5438JP6 JY6 1883 USD 3.1 * 6225 Yen : 0.009687 1.2 一格 Dollar: 10 : 1k Yen = 9.6 : 6.25 | | GCE usd | TGD yen | JY6 usd | JPYUSD | Total | | -------- | -------- | -------- | -------- | -------- | -------- | | 成本 | 1* 1833 | 3.1*6225 | 1.5438JP6 | | | 净利 | | | | | D3= D1 - D2-41 | Risk 爆仓 | | | | | | Tick usd | 10 | 9.6 | 6.25 | | | Hedge | | | | |D4 1.5438*0.00968 | Hedge 利润 | | | | | D3- D4 - 20*张 | Max Open | | | | | | Margin | 11,000张 | ¥240,000 | 3000 | | D1 = 1/ (6.2张 6225 Price 1kg / 2张 1883 GCEPrice 100oz) = 1/ 102 D2= JPYUSD D = ( D1 - D2 ) unit D3= D - 合约张数*20 对冲锁仓= D3 - D4JY6n 张 - 20usd 需要反方向锁定汇率,以免单边贬值 | Contract | Price | Position JPY | Position USD | Position Gold | | --------- | ---------------- | ------------------------- | --------------------------------------- | ----------------------- | | $C_a=32$ | 1,882.6 USD/TO | | $\times (-100) \times 32=$ $-6,024,320$ | $+3200$ TO | | $C_b=100$ | 6,270,000 JPY/KG | $+6,270,000\times 100$ | | $-3215.07$ TO | | $C_r=50$ | 0.0096735 USD/JPY | $-12,500,000\times 50$ | $\times 0.0096735 =$ $+6,045,937$ | | | | | $+281,000$ JPY | $+21,616$ USD | $-15.07$ TO ($-27,532.89$ USD) | |Contract | Trade | Bid | Ask | BSRatio | TBRatio | Price | Volume | -------- | -------- | -------- | -------- | -------- | -------- | -------- | ------- | | 2002T | 2257 | 596615 | 538669 | 1.107 | 0.0037 | 2004T | 16714 | 1575597 | 1876846 | 0.8394 | 0.0106 | 2006T | 22314 | 1897211 | 2244090 | 0.845 | 0.0117 | 2008T | 30961 | 2546866 | 2565322 | 0.9928 | 0.012 | TotalT| <font color="#f00">72246</font> | 6616289 | 7224927 | 0.915 |0.0109 | 2001G | 722 | 3577822 | 4045099 | 0.884 | 0.0002 | 2002G | 4856139 | 20903018 | 20864316 | 1.001 | 0.232 | 2003G | 40802 | 31191874 | 31094784 | 1.003 | 0.0013 | 2004G | 11786062 | 40833589 | 41743670 | 0.978 | 0.288 | 2005G | 24615 | 14835169 | 15039792 | 0.986 | 0.0016 | 2006G | 24615 | 51917254 | 52119146 | 0.996 | 0.00047 | 2007G| 17843 | 6362040 | 6599861 | 0.9639 | 0.0028 | 2008G | 3988031 | 54552922 | 55073801 | 0.9905 | 0.0731 | 2009G | 48 | 207009 | 116493 | 1.7770 |0.00023 | 2010G | 20256 | 49093464 | 49602802 | 0.9897 | 0.0004 | 2011G | 0 | 0 | 0 | | | 2012G | 114988 | 49081390 |50204184 | 0.977 | 0.0023 | TotalG | <font color="#f00">27444849</font> | 672412819 | 689048380 | 0.975 | 0.040 | 2001Y | 299 | 219792 | 220036 | 0.998 | 0.00136 | 2002Y | 1031 | 932005 | 966073 | | | 2003Y | 4854730 | 29469628 | 29318173 | | 0.164 | 2004Y | 2608 | 2911142 | 2784818 | | 0.0008 | 2005Y | 1494 | 3934873 | 3379924 | | | 2006Y | 3988962 | 26000029 | 26109755 | | 0.135 | 2007Y | 1502 | 2759625 | 2737029 | | | 2008Y | 514 | 1446428 | 1452446 | | | 2009Y| 696462 | 7769537 | 7864374 | | | 2010Y | 1 | 120255 | 124544 | | | 2011Y | 0 | 0 | 0 | 0 |0 | 2012Y | 742 | 897651 | 921910 | | | 2103Y | 36 | 306873 | 262074 | | | 2106Y | 7 | 118648 | 119994 | | | 2109Y | 1 |37764| 50706 | | | 2112Y | | | | | | 2203Y | | | | | | 2206Y | | | | | | 2209Y | | | | | | 2212Y| | | | | | 2303Y | | | | | | 2306Y | | | | | | 2309Y | | | | | | 2312Y | | | | | | 2403Y | | | | | | 2406Y | | | | | | 2409Y | | | | | | 2412Y | | | | | | 2503Y | | | | | | 2506Y | | | | | | TotalY | <font color="#f00">9548389</font> | 76924517 | 76312123 | | 0.040 协整(cointegration)是指多个order 1的时间序列通过线性组合,可以形成一个order 0的时间序列。想要理解上面这句话,就要先了解什么是order of integration,记作I(n)。I(n)是指一个时间序列至少需要通过n次差分,才能变成一个协方差稳定的序列(covairance stationary process),也就是I(0)。如果用移动平均模型构建I(0)序列的话,就需要使得:<img src="https://pic1.zhimg.com/50/9cca6e037d974bafb35f489f6b14d430_hd.jpg?source=1940ef5c" data-rawwidth="252" data-rawheight="116" class="content_image" width="252"/>中随机项系数绝对值的平方和小于无穷,即:<img src="https://pic2.zhimg.com/50/06e4a451a3efdfc816528c1ec44f9625_hd.jpg?source=1940ef5c" data-rawwidth="194" data-rawheight="126" class="content_image" width="194"/>便于理解,你可以认为I(0)的时间序列会在其均值附近波动,不会偏离太多。举个列子,一个标准正太分布的时间序列就是一个I(0)的时间序列。<img src="https://pic2.zhimg.com/50/bc250b816938a4f1a81d9186d12797f7_hd.jpg?source=1940ef5c" data-rawwidth="1030" data-rawheight="731" class="origin_image zh-lightbox-thumb" width="1030" data-original="https://pic1.zhimg.com/bc250b816938a4f1a81d9186d12797f7_r.jpg?source=1940ef5c"/>现在我们可以回到协整了。假设有股票A和B。通过观察不难发现它们不属于I(0)。<img src="https://pic2.zhimg.com/50/51d06e3df889154ad9eb89314d841e5d_hd.jpg?source=1940ef5c" data-rawwidth="1030" data-rawheight="731" class="origin_image zh-lightbox-thumb" width="1030" data-original="https://pic1.zhimg.com/51d06e3df889154ad9eb89314d841e5d_r.jpg?source=1940ef5c"/><img src="https://pic1.zhimg.com/50/e704b730a6d2af58e12d1b226720cbf2_hd.jpg?source=1940ef5c" data-rawwidth="1030" data-rawheight="731" class="origin_image zh-lightbox-thumb" width="1030" data-original="https://pic4.zhimg.com/e704b730a6d2af58e12d1b226720cbf2_r.jpg?source=1940ef5c"/>然而通过一次差分,我们发现股票A的每日价差是I(0)序列(先假设是,之后会谈到如何验证)。股票B同理。那么股价A和B就是I(1)时间序列。<img src="https://pic3.zhimg.com/50/f56b41cb2309b9a225dfbca4cd85ff95_hd.jpg?source=1940ef5c" data-rawwidth="1030" data-rawheight="731" class="origin_image zh-lightbox-thumb" width="1030" data-original="https://pic1.zhimg.com/f56b41cb2309b9a225dfbca4cd85ff95_r.jpg?source=1940ef5c"/>并且神奇的是通过买入一份A,卖出两份B,我们可以得到一个价差。而这个价差是一个I(0)时间序列。那么我们就可以说A和B的时间序列是协整的。<img src="https://pic4.zhimg.com/50/1dea95ee3cbb2e560b0aa38f3b9490c3_hd.jpg?source=1940ef5c" data-rawwidth="1030" data-rawheight="731" class="origin_image zh-lightbox-thumb" width="1030" data-original="https://pic2.zhimg.com/1dea95ee3cbb2e560b0aa38f3b9490c3_r.jpg?source=1940ef5c"/>想要知道如何验证一个序列是不是协方差稳定,请搜索“单位根检测”(unit root test)。协整关系 协整(Cointegration)理论是恩格尔(Engle)和格兰杰(Granger)在1978年提出的。平稳性是进行时间序列分析的一个很重要的前提,很多模型都是基于平稳下进行的,而现实中,很多时间序列都是非平稳的,所以协整是从分析时间序列的非平稳性入手的。 协整的内容是: 设序列X_{t}是 d 阶单整的,记为X_{t}\sim I(d),如果存在一个非零向量 \beta 使得Y_{t} = \beta X_{t} \sim I(d-b),则称X_{t}具有 d, b 阶协整关系,记为X_{t}\sim CI(d, b),则 \beta 称为协整向量。 特别当 X_{t} 和 Y_{t} 都是一阶单整时,一般而言,X_{t} 和 Y_{t} 的线性组合 Y_{t} - \beta X_{t} 仍然是一阶单整的,但是对于某些非零向量 \beta ,会使得 Y_{t} - \beta X_{t}\sim I(0),此时非零向量 \beta 称作协整向量,其中每一项 \beta_{t} 为 t 时刻的协整系数。通俗点说,如果两组序列都是非平稳的,但是经过一阶差分后是平稳的,且这两组序列经过某种线性组合也是平稳的,则它们之间就存在协整关系。 协整理论的意义在于: 首先,因为或许单个序列是非平稳的,但是通过协整我们可以建立起两个或者多个序列之间的平稳关系,进而充分应用平稳性的性质。 其次,可以避免伪回归。如果一组非平稳的时间序列不存在协整关系,那么根据它们构造的回归模型就可能是伪回归。 区别变量之间长期均衡关系和短期波动关系。 非平稳序列很容易出现伪回归,而协整的意义就是检验它们的回归方程所描述的因果关系是否是伪回归的,所以常用的协整检验有两种:Engel-Granger 两步协整检验法和 Johansen 协整检验法,它们二者的区别在于 Engler-Granger 采用的是一元方程技术,而 Johansen 则是多元方程技术,所以Johansen 协整检验法受限更小。 Engel-Granger 两步协整检验法 EG检验的方法实际上就是对回归方程的残差进行单位根检验。 因为从协整的角度来看,因变量能被自变量的线性组合所解释,说明二者之间具有稳定的均衡关系;因变量不能被自变量解释的部分就构成了一个残差序列,这个残差序列不应该是序列相关的,也就是说残差应该是平稳的。所以EG检验一组变量是否具有协整关系也就是检验残差序列是否是平稳的。 Engle-Granger提出的两步法的步骤如下: 1、用 OLS 估计协整回归方程,从而得到协整系数: \large : \begin{center} Y_{t} = \beta X_{t} + \epsilon_{t}\end{center} 2、检验 \large \epsilon_{t} 的平稳性,如果 \large \epsilon_{t} 平稳,则 X_{t} , Y_{t} 是协整的,否则不成立。对于\large \epsilon_{t} 平稳性的检验通常用 ADF 检验。 Johansen Test 协整检验法 当协整检验的VAR模型中如果含有多个滞后项时,如下: \large : \begin{center} Y_{t} = \beta_{1} X_{t} + \beta_{2} X_{t-1} + \beta_{3} X_{t-2} + ...+ \epsilon_{t}\end{center} 采用EG检验就不能找出两个以上的协整向量了,此时可以用 Johansen Test 来进行协整检验,它的思想是采用极大似然估计来检验多变量之间的协整关系。 具体步骤以后填

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully