set_trading_env {kisopenapi} | R Documentation |
Set KIS account number, account product code, app key and app secret
Description
Save environment variables for the current session. To set it permanently,
please add the following line to your .Renvrion file:
Usage
set_trading_env(cano, acnt_prdt_cd, app_key, app_secret, is_paper = FALSE)
Arguments
cano |
A string specifying KIS common account number |
acnt_prdt_cd |
A string specifying KIS account product code |
app_key |
A string specifying KIS app key |
app_secret |
A string specifying KIS app secret |
is_paper |
A string specifying paper trading or not, default |
Value
No return value, called to set environment variables
For live trading
KIS_CANO="YOUR ACCOUNT NUMBER" (first 8 digits of your account)
KIS_ACNT_PRDT_CD="01" (last 2 digits of your account)
KIS_APP_KEY="YOUR APP KEY"
KIS_APP_SECRET="YOUR APP SECRET"
For paper trading
KIS_PAPER_CANO="YOUR PAPER ACCOUNT NUMBER" (first 8 digits of your paper account)
KIS_PAPER_ACNT_PRDT_CD="01" (last 2 digits of your paper account)
KIS_PAPER_APP_KEY="YOUR PAPER APP KEY"
KIS_PAPER_APP_SECRET="YOUR PAPER APP SECRET"
Examples
## Set app key for the current session
## Not run:
## Set trading environment only for the current session
set_trading_env(
cano = "your account number",
acnt_prdt_no = "your account product code",
app_key = "your app key",
app_secret = "your app secret"
)
## Check environment variables
print_cano()
print_acnt_prdt_cd()
print_app_key()
print_app_secret()
## End(Not run)