[일상] xing api 중 옵션 관련 api by tradingideas

View this thread on steempeak.com
· @tradingideas ·
$96.67
[일상] xing api 중 옵션 관련 api
지인의 부탁으로 옵션과 관련된 프로그램 개발할 수 있는지 검토 요청을 받았습니다. DeFi를 한 이후로는 주식 자동 매매는 접고 있었는데요. 오랜만에 xing api를 사용해보았습니다.

그동안 많은 변화가 있었더군요. 우선 최신 xing api로 업데이트를 해야합니다. 이베스트 홈페이지에 접속하여 최신 버전으로 update하였습니다.

기존에 주식관련 코드 찾아서 내용을 보는데, 기억이 가물가물합니다. 관련 글을 읽어보면서 과거 기억을 되살려봅니다

우선 옵션 코드를 받을 수 있는 함수를 만들어보았습니다.
TR코드는 2301번이고, 해당 월 콜옵션과 풋옵션 코드를 돌려줍니다.
~~~
        rest = get_2301('202107')
        if 'error' in rest[0] :  # 오류인 경우에 set 형식으로 돌아옴 'error'
            print (rest[0]['error']['message'])
        else :
            print (rest[0])
            print (rest[1])
~~~

결과는 아래와 같이 행사가와 옵션코드 쌍으로 돌아옵니다.
![](https://cdn.steemitimages.com/DQmcEPbv4sUKCBXP5D8mdpvSKY19zmN69jeJqqLZLsLZVys/image.png)

다음에는 보유 옵션의 델타, 감마, 세타, 베가 정보를 이용하여 델타 중립, 감마 중립, 세타 중립 포지션을 만드는 방법에 대하여 공부해보도록 하겠습니다.

비트코인도 option이 있으면 레버리지를 더 키울 수 있어서 재미있을 것 같습니다만  -.-
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 114 others
👎  
properties (23)
post_id91,948,515
authortradingideas
permlinkxing-api-api
categoryhive-101145
json_metadata{"tags":["hive-101145","sct-kr","sct-freeboard","s","union","spt","zzan","krsuccess","sct"],"image":["https:\/\/cdn.steemitimages.com\/DQmcEPbv4sUKCBXP5D8mdpvSKY19zmN69jeJqqLZLsLZVys\/image.png"],"app":"steemcoinpan\/0.1","format":"markdown","canonical_url":"https:\/\/www.steemcoinpan.com\/@tradingideas\/xing-api-api"}
created2021-06-14 14:41:03
last_update2021-06-14 14:41:03
depth0
children4
net_rshares145,579,751,845,871
last_payout2021-06-21 14:41:03
cashout_time1969-12-31 23:59:59
total_payout_value51.425 SBD
curator_payout_value45.241 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length819
author_reputation3,162,277,660,168,379
root_title"[일상] xing api 중 옵션 관련 api"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (179)
@upvu ·
<a href="https://coupa.ng/bHgxg2" target="_blank"><img src="https://ads-partners.coupang.com/banners/273554?subId=&traceId=V0-301-879dd1202e5c73b2-I273554&w=728&h=90" alt=""></a>
<div class='shr_item' style='position:relative; min-height:158px; margin:12px 0; padding:9px 10px; border:1px solid #dbdbdb; border-radius:1px; background-color:#fff;'><div class='item_dtl' style='position:relative; height:158px; padding:5px; border:1px solid #f0f1f4;'><span class='thmb' style='float:left; overflow:hidden; width:156px; height:156px; margin-right:9px; border:1px solid #e7e7e7;'><a href='https://qoo.tn/AoaPVR/Q163214049'><img src='https://steemitimages.com/240x0/https://gd.image-gmkt.com/li/061/293/1455293061.g_400-w-st_g.jpg' width='156' alt='' style='vertical-align: middle; border: 0 none;'></a></span><p class='tit' style='overflow:hidden; max-height:68px; margin-bottom:7px; line-height:17px; color:#000;'>[US$49.00](▼14%)[Nespresso]스타벅스 네스프레소 호환 캡슐 7종 / 120 캡슐 골라담기 / 20개씩 총 6종류 교차 선택 가능 / 중복 선택 가능 / 재고 확보 / 무료배송 / 개당 약 486원 최저가★</p><span class='url' style='position:absolute; left:170px; bottom:10px; display:block; font-weight:bold; color:#9197a3;'>WWW.QOO10.COM</span></div></div>
properties (22)
post_id91,948,559
authorupvu
permlinkre--xing-api-api-20210614t144305836z
categoryhive-101145
json_metadata{"tags":["hive-101145","sct-kr","sct-freeboard","s","union","spt","zzan","krsuccess","sct"]}
created2021-06-14 14:43:06
last_update2021-06-14 14:43:06
depth1
children0
net_rshares0
last_payout2021-06-21 14:43:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length1,191
author_reputation27,754,495,235,856
root_title"[일상] xing api 중 옵션 관련 api"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@successgr.with ·
  start success  go! go!  go!
properties (22)
post_id91,948,653
authorsuccessgr.with
permlinkre-xing-api-api-20210614t144638
categoryhive-101145
json_metadata{}
created2021-06-14 14:46:39
last_update2021-06-14 14:46:39
depth1
children0
net_rshares0
last_payout2021-06-21 14:46:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length29
author_reputation261,015,721,568,254
root_title"[일상] xing api 중 옵션 관련 api"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@sct.krwp ·
@tradingideas transfered 38 KRWP to @krwp.burn. voting percent : 71.07%, voting power : 59.15%, steem power : 1788407.98, STU KRW : 1200. 
@tradingideas staking status : 13200 KRWP
                                @tradingideas limit for KRWP voting service : 13.2 KRWP (rate : 0.001)
                                What you sent : 38 KRWP
                                Refund balance : 24.8 KRWP [54624343 - dcf269c08a5271e72fd77898e03ff0dae678173b]
properties (22)
post_id91,948,659
authorsct.krwp
permlinkre--xing-api-api-20210614t144641844z
categoryhive-101145
json_metadata{"tags":["hive-101145","sct-kr","sct-freeboard","s","union","spt","zzan","krsuccess","sct"]}
created2021-06-14 14:46:42
last_update2021-06-14 14:46:42
depth1
children0
net_rshares0
last_payout2021-06-21 14:46:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length452
author_reputation10,000,000,000,000
root_title"[일상] xing api 중 옵션 관련 api"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@luciferkim ·
좋은 결과를 응원합니다
properties (22)
post_id91,967,017
authorluciferkim
permlinkquqd6y
categoryhive-101145
json_metadata{"app":"steemit\/0.2"}
created2021-06-15 06:40:12
last_update2021-06-15 06:40:12
depth1
children0
net_rshares0
last_payout2021-06-22 06:40:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length12
author_reputation76,246,905,464,437
root_title"[일상] xing api 중 옵션 관련 api"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000