Package: oanda-cli
oanda-cliCommand Line Interface for Oanda V20 REST APIInstallation$pipinstall-Uoanda-cliDocker imageThe image is available atDocker Hub.$dockerpulldceoy/oanda-cliGetting startedCreate and edit a configuration YAML file.$oanda-cliinit
$vimoanda.yml# => editAn account ID and an API token are required to be set in the configuration file.Execute commands.# Print information$oanda-cliinfoaccount
$oanda-cliinfoinstruments
$oanda-cliinfopositions# Fetch past rates$oanda-clitrack# Stream market prices or authorized account transactions$oanda-clistream# prices$oanda-clistream--target=transaction# transactions# Close all positions$oanda-cliclose# Fetch transactions and visualize cumulative PL$oanda-clitransaction--from=2020-09-01--pl-graph=./pl.pdfUsage$oanda-cli--help
CommandLineInterfaceforOandaAPI

Usage:oanda-cli-h|--helpoanda-cli--versionoanda-cliinit[--debug|--info][--file=<yaml>]oanda-cliinfo[--debug|--info][--file=<yaml>][--json]<info_target>[<instrument>...]oanda-clitrack[--debug|--info][--file=<yaml>][--csv-dir=<path>][--sqlite=<path>][--granularity=<code>][--count=<int>][--json][--quiet][<instrument>...]oanda-clistream[--debug|--info][--file=<yaml>][--target=<str>][--timeout=<sec>][--csv=<path>][--sqlite=<path>][--use-redis][--redis-host=<ip>][--redis-port=<int>][--redis-db=<int>][--redis-max-llen=<int>][--ignore-api-error][--quiet][<instrument>...]oanda-clitransaction[--debug|--info][--file=<yaml>][--from=<date>][--to=<date>][--csv=<path>][--sqlite=<path>][--pl-graph=<path>][--json][--quiet]oanda-cliplotpl[--debug|--info]<data_path><graph_path>oanda-clispread[--debug|--info][--file=<yaml>][--csv=<path>][--quiet][<instrument>...]oanda-cliclose[--debug|--info][--file=<yaml>][<instrument>...]Options:-h,--helpPrinthelpandexit--versionPrintversionandexit--debug,--infoExecuteacommandwithdebug|infomessages--file=<yaml>SetapathtoaYAMLforconfigurations[$OANDA_YML]--quietSuppressmessages--csv-dir=<path>WritedatawithdailyCSVinadirectory--sqlite=<path>SavedatainanSQLite3database--granularity=<code>Setagranularityforratetracking[default:S5]--count=<int>Setasizeforratetracking(max:5000)[default:60]--jsonPrintdatawithJSON--target=<str>Setastreamingtarget[default:pricing]{pricing,transaction}--timeout=<sec>Setsencondsforresponsetimeout--csv=<path>WritedatawithCSVintoafile--use-redisUseRedisfordatastore--redis-host=<ip>SetaRedisserverhost(overrideYAMLconfigurations)--redis-port=<int>SetaRedisserverport(overrideYAMLconfigurations)--redis-db=<int>SetaRedisdatabase(overrideYAMLconfigurations)--redis-max-llen=<int>LimitRedislistlength(overrideYAMLconfigurations)--ignore-api-errorIgnoreOandaAPIconnectionerrors--from=<date>Specifythestartingtime--to=<date>Specifytheendingtime--pl-graph=<path>VisualizePLinagraphicsfilesuchasPDForPNG

Commands:initCreateaYAMLtemplateforconfigurationinfoPrintinformationabout<info_target>trackFetchpastratesstreamStreammarketpricesorauthorizedaccounteventstransactionFetchthelatesttransactionsplotplVisualizecumulativePLinafilespreadPrinttheratiosofspreadtopricecloseClosepositions(ifnot<instrument>,closeall)Arguments:<info_target>{instruments,prices,account,accounts,orders,trades,positions,position,order_book,position_book}<instrument>{AUD_CAD,AUD_CHF,AUD_HKD,AUD_JPY,AUD_NZD,AUD_SGD,AUD_USD,CAD_CHF,CAD_HKD,CAD_JPY,CAD_SGD,CHF_HKD,CHF_JPY,CHF_ZAR,EUR_AUD,EUR_CAD,EUR_CHF,EUR_CZK,EUR_DKK,EUR_GBP,EUR_HKD,EUR_HUF,EUR_JPY,EUR_NOK,EUR_NZD,EUR_PLN,EUR_SEK,EUR_SGD,EUR_TRY,EUR_USD,EUR_ZAR,GBP_AUD,GBP_CAD,GBP_CHF,GBP_HKD,GBP_JPY,GBP_NZD,GBP_PLN,GBP_SGD,GBP_USD,GBP_ZAR,HKD_JPY,NZD_CAD,NZD_CHF,NZD_HKD,NZD_JPY,NZD_SGD,NZD_USD,SGD_CHF,SGD_HKD,SGD_JPY,TRY_JPY,USD_CAD,USD_CHF,USD_CNH,USD_CZK,USD_DKK,USD_HKD,USD_HUF,USD_INR,USD_JPY,USD_MXN,USD_NOK,USD_PLN,USD_SAR,USD_SEK,USD_SGD,USD_THB,USD_TRY,USD_ZAR,ZAR_JPY}<data_path>PathtoaninputCSVorSQLitefile<graph_path>PathtoanoutputgraphicsfilesuchasPDForPNG