Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rで始めるシステムトレード

Arthur Lawrence
March 02, 2019
860

 Rで始めるシステムトレード

Arthur Lawrence

March 02, 2019
Tweet

Transcript

  1. RͰ࢝ΊΔγεςϜτϨʔυ
    2019/3/2(Sat)
    Hioki Ryuji
    LT

    View full-size slide

  2. m
    Introduction
    twitter: @Liparas1729
    Work
    σʔλ෼ੳɾՄࢹԽ
    Πϯϑϥج൫
    ϑϩϯτ(ReactɺGatsby)ɺαʔόʔαΠυ
    Hobby
    Python/R/SQL/NodeJS/Golang/CSS
    AWS/GCP
    ٻ৬ɺେಓܳɺKaggleɺࣗવݴޠ։ൃɺݴޠֶशɺσʔλऩूɾՄࢹԽɺαʔϏε։ൃɺಡॻ
    homepage: hiokiryuji.com
    UI/UXɺ৺ཧֶɺ౷ܭɺεϚϒϥ

    View full-size slide

  3. γεςϜߏஙͷඪຊ

    View full-size slide

  4. γεςϜͷߏஙྫ
    σʔλऩूᶃ
    όοΫςετΛͯ͠ɺ౷ܭతʹઓུͷ༗ޮੑΛ͔֬ΊΔʹ͸ɺ
    ͋Δఔ౓ͷσʔλྔ͕ඞཁ(࣌ؒ࣠ʹΑΔ)
    RealtimeͰσʔλΛऩूͨ͠৔߹ɺ͸͡ΊͷϊʔυͰɺ
    ूܭɾՃ޻Ͱ͖ͨํָ͕ͳ৔߹΋ଟ͍ͷͰɺ
    SQL౳͕࢖͑Δσʔλϕʔε͕๬·͍͠
    ·ͣ͸σʔλऩू͔Β

    View full-size slide

  5. γεςϜͷߏஙྫ
    ࣌ܥྻσʔλͷಛ௃ྔᶃ
    σʔλऩूᶄ
    σʔλϕʔεબൈ
    GridDB etc...

    View full-size slide

  6. γεςϜͷߏஙྫ
    σʔλऩूᶅ
    RͰwebsocketʹ઀ଓ͢Δ

    View full-size slide

  7. σʔλऩूᶆ
    RͰbigqueryʹ઀ଓ͢Δ

    View full-size slide

  8. ಛ௃ྔᶃ
    جຊతͳςΫχΧϧࢦඪ(EMAɺSMAɺDMIɺRSIɺRCIɺMACD౳)
    ஋ͦͷ΋ͷ͸ɺಛ௃ྔͱͯ͠࢖͍ͮΒ͍ɺ
    ͸े෼ʹػೳ͢Δ͕ɺ୯ମͰ͸࢖͑ͳ͍ˠௐ੔͕ඞཁ
    ஋ͦͷ΋ͷͰ͸ͳ͘มԽ཰΍ࠩ෼Λ࢖͏ͱྑ͍
    Ձ֨ɺऔҾྔ͸൘৘ใɺ໿ఆσʔλ͔Βࢉग़͞ΕΔ
    औҾྔ͸ಛʹॏཁͳࢦඪ

    View full-size slide

  9. γεςϜͷߏஙྫ
    ಛ௃ྔᶄ
    RͰςΫχΧϧࢦඪΛܭࢉ͢Δ
    ςΫχΧϧࢦඪ͸ɺେ͖͘෼͚ͯ2ΧςΰϦʔ
    ɾΦγϨʔλʔܥ
    ɾτϨϯυϑΥϩʔܥ

    View full-size slide

  10. γεςϜͷߏஙྫ
    ಛ௃ྔᶅ
    NLPΛ࢖ͬͯnewsͳͲͰऔҾ͢Δ΋ͷΛ࡞ΕΔ͔
    →news͸outlier(֎Ε஋)Ͱ͋ΓɺϞσϦϯάʹ͸ෆ޲͖?
    ·ͨɺnewsΛݟͯ൓Ԡͨ͠ਓͨͪͷಈ͖͸Realtimeσʔλ
    ͷ൓ө͞Ε͏ΔͷͰɺRealtimeσʔλͰ΋ݕ஌Ͱ͖Δ
    →ݱঢ়ͷNLPͷਫ਼౓͕௿͍ͱ͍͏ࣄ৘΋͋Δ

    View full-size slide

  11. γεςϜͷߏஙྫ
    ઓུᶃ
    جຊతͳߟ͑ํ͸ଛখརେ
    Ձ͕֨େ͖͘มಈ͢Δ͜ͱ΋͋ΔͷͰɺ΋͠ෛ͚ͨͱͯ͠΋ɺ
    ౷ܭతʹ༏Ґͳઓུʹ͓͍ͯɺαϯϓϦϯάΛଓߦͰ͖ΔΑ͏ʹ
    ࢿۚ؅ཧΛపఈ͢Δ
    ্͕Δ͔ɺԼ͕Δ͔Λ༧ଌ͢ΔϞσϧͰɺ
    ਫ਼౓50%Λ௒͑Δ͜ͱ͸༰қ͕ͩɺ֬཰͚ͩͰ͸ແҙຯͰɺ
    ͲΕ͚ͩՁ͕֨ಈ͘ͷ͔ͷഒ཰Λ؅ཧ͢Δ͜ͱ͕࠷΋େ੾

    View full-size slide

  12. γεςϜͷߏஙྫ
    ઓུᶄ
    ଛࣦ͸େ͖͘ݟੵ΋ͬͯɺརӹ͸খ͘͞ݟੵ΋Δ
    → ଛӹͷܭࢉʹ͓͍ͯɺ1rowͣΒͯ͠ࢉग़ͨ͠ະདྷͷՁ֨͸ɺ
    औҾࣥߦ͔Βͷ஗Ԇ͕0ͱ͍͏ཧ૝తͳ஋Ͱ࣮ࡍͷ஋ͱ͸ҟͳΔ
    όοΫςετͷஈ֊Ͱɺఀࢭ͢Δ৚݅ΛఆΊΔ
    ͕࣌ؒ࣠େ͖͘ͳΔͱɺҰ࣌తͳଛࣦ(υϩʔμ΢ϯ)΋ߴ͘ͳΔ
    όοΫςετͷ݁Ռ͔ΒɺଛࣦΛग़ͯ͠΋౷ܭతʹ૝ఆͷൣғ಺
    Ͱ͋Ε͹ଓߦͰ͖Δ͜ͱ͕େ੾

    View full-size slide

  13. σʔλՄࢹԽᶃ
    σʔλͷՄࢹԽ͸2௨ΓͰ
    ɾઓུΛܾఆ͢ΔࡍͷEDA
    ɾઓུ͕૝ఆ௨Γʹಈ࡞͍ͯ͠Δ͔ͷ֬ೝ
    ઓུ࣮ߦͷϩά͸ɺσʔλϕʔεʹཷΊ͓ͯ͘
    ҟৗ͕ىͬͨ͜৔߹͸ɺLINE΍ɺSlack ɺDiscordͷAPI
    Λ࢖ͬͯɺ௨஌Ͱ͖ΔΑ͏ʹ͓ͯ͘͠ͱ҆৺

    View full-size slide

  14. σʔλՄࢹԽᶄ
    νʔϜͰ΍Δ৔߹͸ɺRedashɺGrafanaͳͲͰे෼
    ݸਓͳΒɺJupyter notebook΍ΦϨΦϨπʔϧͰ΋ྑ͍
    ݱࡏͷଛӹɺऔҾ࣮ߦ࣌ࠁɺϙδγϣϯਪҠ͸
    ֬ೝͰ͖ΔΑ͏ʹ͓ͯ͘͠

    View full-size slide

  15. ·ͱΊ
    ɾσʔλϕʔεબ୒ˠσʔλՃ޻ˠ෼ੳɾઓུͷܾఆˠઓུ࣮ߦˠՄࢹԽ
    ɾ֬཰ΑΓ΋ɺഒ཰Λίϯτϩʔϧ͢Δ͜ͱ͕େ੾
    ɾ૬৔ʹΑͬͯ͸ɺେ͖͘ଛࣦΛग़͢͜ͱ΋͋ΔͷͰɺ౷ܭతʹ
    ɾઓུͷதʹ͸ɺఀࢭ৚݅Λ͋Β͔͡Ί૊ΈࠐΜͰ͓͘
    ɾςετஈ֊Ͱͷະདྷͷ஋͸ɺཧ૝త஋ʹա͗ͳ͍
    γετϨ͸σʔλαΠΤϯεΛ΍Δ্Ͱɺྑ͍୊ࡐ
    རӹΛੵΈॏͶΔͨΊʹɺద੾ʹࢿۚΛҡ͍࣋ͯ͘͠
    ɾσʔλऩूˠσʔλՃ޻ˠσʔλ෼ੳˠσʔλՄࢹԽ

    View full-size slide