Package: lazytrade 0.5.4

Vladimir Zhbanko

lazytrade: Learn Computer and Data Science using Algorithmic Trading

Provide sets of functions and methods to learn and practice data science using idea of algorithmic trading. Main goal is to process information within "Decision Support System" to come up with analysis or predictions. There are several utilities such as dynamic and adaptive risk management using reinforcement learning and even functions to generate predictions of price changes using pattern recognition deep regression learning. Summary of Methods used: Awesome H2O tutorials: <https://github.com/h2oai/awesome-h2o>, Market Type research of Van Tharp Institute: <https://vantharp.com/>, Reinforcement Learning R package: <https://CRAN.R-project.org/package=ReinforcementLearning>.

Authors:Vladimir Zhbanko

lazytrade_0.5.4.tar.gz
lazytrade_0.5.4.zip(r-4.5)lazytrade_0.5.4.zip(r-4.4)lazytrade_0.5.4.zip(r-4.3)
lazytrade_0.5.4.tgz(r-4.4-any)lazytrade_0.5.4.tgz(r-4.3-any)
lazytrade_0.5.4.tar.gz(r-4.5-noble)lazytrade_0.5.4.tar.gz(r-4.4-noble)
lazytrade_0.5.4.tgz(r-4.4-emscripten)lazytrade_0.5.4.tgz(r-4.3-emscripten)
lazytrade.pdf |lazytrade.html
lazytrade/json (API)
NEWS

# Install 'lazytrade' in R:
install.packages('lazytrade', repos = c('https://vzhomeexperiments.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/vzhomeexperiments/lazytrade/issues

Datasets:
  • DFR - Table with predicted price change
  • EURUSDM15X75 - Table with indicator and price change dataset
  • TradeStatePolicy - Table with Trade States and sample of actual policy for those states
  • data_trades - Table with Trade results samples
  • indicator_dataset - Table with indicator dataset
  • macd_100 - Table with indicator only used to train model, 128 col 1646 rows
  • macd_ML60M - Table with indicator and market type category used to train model
  • macd_df - Table with one column indicator dataset
  • policy_tr_systDF - Table with Market Types and sample of actual policy for those states
  • price_dataset - Table with price dataset
  • price_dataset_big - Table with price dataset, 30000 rows
  • profit_factorDF - Table with Trade results samples
  • profit_factor_data - Table with Trade results samples
  • result_R - Table with predicted price change
  • result_R1 - Table with aggregated trade results
  • result_prev - Table with one column as result from the model prediction
  • test_data_pattern - Table with several columns containing indicator values and Label values
  • trading_systemDF - Table with trade data and joined market type info
  • x_test_model - Table with a dataset to test the Model
  • y - Table with indicators and price change which is used to train model

On CRAN:

lazylazytrade

37 exports 23 stars 2.29 score 57 dependencies 333 scripts 586 downloads

Last updated 2 months agofrom:200ada0d88. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 15 2024
R-4.5-winOKSep 15 2024
R-4.5-linuxOKSep 15 2024
R-4.4-winOKSep 15 2024
R-4.4-macOKSep 15 2024
R-4.3-winOKSep 15 2024
R-4.3-macOKSep 15 2024

Exports:aml_collect_dataaml_consolidate_resultsaml_make_modelaml_score_dataaml_simulationaml_test_modelcheck_if_optimizecreate_labelled_datacreate_transposed_datadecrypt_mykeysdlogencrypt_api_keyevaluate_macroeconomic_eventget_profit_factorDFimport_datamt_evaluatemt_import_datamt_make_modelmt_stat_evaluatemt_stat_transfopt_aggregate_resultsopt_create_graphsrl_generate_policyrl_generate_policy_mtrl_log_progressrl_log_progress_mtrl_record_policyrl_record_policy_mtrl_write_control_parametersrl_write_control_parameters_mtto_mutil_find_file_with_codeutil_find_pidutil_generate_passwordutil_profit_factorwrite_command_via_csvwrite_ini_file

Dependencies:askpassbitbit64bitopsclicliprclustercolorspacecpp11crayondata.tabledplyrfansifarvergenericsggplot2gluegtableh2ohashhmsisobandjsonlitelabelinglatticelifecyclelubridatemagrittrMASSMatrixmgcvmunsellnlmeopensslpillarpkgconfigprettyunitsprogressR6RColorBrewerRCurlreadrReinforcementLearningrlangscalesstringistringrsystibbletidyselecttimechangetzdbutf8vctrsviridisLitevroomwithr

Readme and manuals

Help Manual

Help pageTopics
Function to read, transform, aggregate and save data for further retraining of regression model for a single assetaml_collect_data
Function to consolidate model test resultsaml_consolidate_results
Function to train Deep Learning regression model for a single assetaml_make_model
Function to score new data and predict change for each single currency pairaml_score_data
Function to simulate multiple input structuresaml_simulation
Function to test the model and conditionally decide to update existing model for a single currency pairaml_test_model
Function check_if_optimize.check_if_optimize
Create labelled datacreate_labelled_data
Create Transposed Datacreate_transposed_data
Table with Trade results samplesdata_trades
Function that decrypt encrypted contentdecrypt_mykeys
Table with predicted price changeDFR
Create log difference distributiondlog
Encrypt api keysencrypt_api_key
Table with indicator and price change datasetEURUSDM15X75
Function used to evaluate market type situation by reading the file with Macroeconomic Events and writing a trigger to the trading robotevaluate_macroeconomic_event
Function that returns the profit factors of the systems in a form of a DataFrameget_profit_factorDF
Import Data file with Trade Logs to R.import_data
Table with indicator datasetindicator_dataset
Table with indicator only used to train model, 128 col 1646 rowsmacd_100
Table with one column indicator datasetmacd_df
Table with indicator and market type category used to train modelmacd_ML60M
Function to score data and predict current market type using pre-trained classification modelmt_evaluate
Import Market Type related Data to R from the Sandboxmt_import_data
Function to train Deep Learning Classification model for Market Type recognitionmt_make_model
Function to prepare and score data, finally predict current market type using pre-trained classification modelmt_stat_evaluate
Perform Statistical transformation and clustering of Market Types on the price datamt_stat_transf
Function to aggregate trading results from multiple folders and filesopt_aggregate_results
Function to create summary graphs of the trading resultsopt_create_graphs
Table with Market Types and sample of actual policy for those statespolicy_tr_systDF
Table with price datasetprice_dataset
Table with price dataset, 30000 rowsprice_dataset_big
Table with Trade results samplesprofit_factor_data
Table with Trade results samplesprofit_factorDF
Table with one column as result from the model predictionresult_prev
Table with predicted price changeresult_R
Table with aggregated trade resultsresult_R1
Function performs Reinforcement Learning using the past data to generate model policyrl_generate_policy
Function performs RL and generates model policy for each Market Typerl_generate_policy_mt
Function to retrieve and help to log Q values during RL progress.rl_log_progress
Function to retrieve and help to log Q values during RL progress. This function is dedicated to the situations when Market Types are used as a 'states' for the Environment.rl_log_progress_mt
Record Reinforcement Learning Policy.rl_record_policy
Record Reinforcement Learning Policy for Market Typesrl_record_policy_mt
Function to find and write the best control parameters.rl_write_control_parameters
Function to find and write the best control parameters.rl_write_control_parameters_mt
Table with several columns containing indicator values and Label valuestest_data_pattern
Convert time series data to matrix with defined number of columnsto_m
Table with Trade States and sample of actual policy for those statesTradeStatePolicy
Table with trade data and joined market type infotrading_systemDF
R function to find file with specific code within it's contentutil_find_file_with_code
R function to find PID of active applicationsutil_find_pid
R function to generate random passwords for MT4 platform or other needsutil_generate_password
Calculate Profit Factorutil_profit_factor
Write csv files with indicated commands to the external systemwrite_command_via_csv
Create initialization files to launch MT4 platform with specific configurationwrite_ini_file
Table with a dataset to test the Modelx_test_model
Table with indicators and price change which is used to train modely