- RL (Reinforcement Learning)
- GA (Genetic Algorithm)
siruku6 / fx_alarm_py Goto Github PK
View Code? Open in Web Editor NEWThis app alarm you when you should check FX chart. (is being developed ...)
License: GNU General Public License v3.0
This app alarm you when you should check FX chart. (is being developed ...)
License: GNU General Public License v3.0
Clarify not on the graph, but on csv or json.
like this
layers:
test:
path: layer
functions:
hello:
handler: handler.hello
layers:
- { Ref: TestLambdaLayer }
It may be valuable to entry multiple times in a row, if chart & indicators meet the conditions.
For example, it shows record high in specified candles, then it is possible to rise up higher than those candles.
If there is no 'indicator_names[]' in queryString, tradehist API returns no indicators.
Now, history_librarian.py can only treat H4 trade candles.
Next, we have to trade on H1 chart, so we need the treatment of H1 candles in history_librarian.py.
Example: 取得済み: 2020-11-22 11:09:14.016239まで
Example: Loaded: 2020-11-22 00:00 - 2020-12-01 00:00
Is it supposed ?
very rarely occured
Test on multi instruments and on multi granularity.
Now, the unit to entry is stable set in a environment values.
It is more efficient to enable alter the unit depending on the chart & indicators.
Now Trader has the feature for preparing candles, but it causes confusion.
It may be good to name the new file as candle_loader.py
.
Enable two or more .env
files, for example, .env
, .env.dev
and .env.local
.
It is possible by using serverless-dotenv-plugin.
As following, it is enabled to use only one .env
file.
https://www.serverless.com/framework/docs/environment-variables
Sharp Ratio = 'the sum of profit' / 'standard deviation'
Sortino Ratio = 'the sum of profit' / 'standard deviation of loss trades'
Be more negative, realistic on the scalping rule.
The backtest's profit is much higher than the real profit because the exiting price in the backtest is too optimistic.
If there is no required parameters, then it should return 40x
error.
But this app on AWS Lambda returns 502
.
long entry, but soon exit with 'buy_exit' or short entry, but soon exit with sell_entry
Currently, my App processes only two time scales in one analysis.
For instance, those are H1 and D1.
But in real trade, price is going to rise or down rapidly in a few minutes.
This App can't recognize even if the some indicators indicate "not entry" in that "a few minutes".
This can recognize only the state of indicators produced from the close prices of either of two time scales.
First, enable this App to recognize the behavior of prices and indicators per 5 minutes even if selected time scale is H1 or H4.
In the future, the goal may change from "per 5 minutes" to "per 1 minute", but this issue treats only "per 5 minutes".
D1 trend, D1 stochastics and so on ...
Do it by using environment variables or settings in yaml file.
It is desirable that various trade settings are able to be specified by environment variables or parameters other than static source cord.
[ERROR] TypeError: support_or_registance() missing 3 required positional arguments: 'position_type', 'current_sup', and 'current_regist'
Traceback (most recent call last):
File "/var/task/main.py", line 21, in lambda_handler
trader.apply_trading_rule()
File "/var/task/models/real_trader.py", line 51, in apply_trading_rule
self.__play_scalping_trade(candles)
File "/var/task/models/real_trader.py", line 143, in __play_scalping_trade
new_stop: float = self.__drive_trail_process(candles.iloc[-2], last_indicators)
File "/var/task/models/real_trader.py", line 182, in __drive_trail_process
possible_stoploss: float = self.stoploss_method()(
[interface] 取引ルールを選択して下さい [0]: swing, [1]: wait_close, [2]: scalping, [3]: cancel: 0
[Trader] Which do you use ? [1]: current_candles, [2]: static_candles :2
[interface] 通貨ペアは?
[0]: USD_JPY, [1]: EUR_USD, [2]: GBP_JPY, [3]: USD_CHF: 2
[Trader] 通貨の価格の桁を選択して下さい [1]: 100.000, [2]: 1.00000, [3]: それ以下又は以外:1
何日分のデータを取得する?(半角数字): 120
[Trader] 画像描画する? [1]: No, [2]: Yes, [3]: with_P/L 2
[Trader] preparing base-data for judging ...
[Trader] judging entryable or not ...
[Trader] start sliding ...
Traceback (most recent call last):
File "beta_cord.py", line 167, in <module>
start_test_menu()
File "beta_cord.py", line 79, in start_test_menu
tr_instance.perform(rule=rule_name, entry_filters=[
File "/root/opt/fx_alarm_py/models/trader.py", line 120, in perform
result = self.backtest(candles)
File "/root/opt/fx_alarm_py/models/swing_trader.py", line 25, in backtest
sliding_result = self.__slide_prices_to_really_possible(candles=candles)
File "/root/opt/fx_alarm_py/models/swing_trader.py", line 117, in __slide_prices_to_really_possible
position_rows = self.__slide_prices_in_dicts(time_series=candles['time'], position_rows=position_rows)
File "/root/opt/fx_alarm_py/models/swing_trader.py", line 127, in __slide_prices_in_dicts
self.m10_candles = self.__load_m10_candles(time_series)
File "/root/opt/fx_alarm_py/models/swing_trader.py", line 160, in __load_m10_candles
return self._client.load_or_query_candles(first_time, last_time, granularity='M10')[['high', 'low']]
AttributeError: 'ClientManager' object has no attribute 'load_or_query_candles'
press Enter ...
Oanda serves us volumes
per time.
Currently, we can not look into why a position exits other than by the event logs in Cloudwatch Event.
If that log is saved in DynamoDB, we can look into the reason more easily than ever.
When just stoploss was trailed, it was very ambiguous the judgement of whether the candle had hit stoploss.
We can merge.coveragerc
into setup.cfg
https://coverage.readthedocs.io/en/coverage-4.0.3/config.html#configuration-files
Though win count (lose count) equal number of exit row with positive profit, one row of exit contain multiple exit history.
Therefore, we have to calculate by considering how many exit history is included in one row.
models/tools/statistics_module.py
There is '__convert_time_str_to' method in history_librarian.py.
I have already introduced django-environ
into other repository.
See following page.
siruku6/life_recorder@c9b9bd2
But I need to introduce python-dotenv.
[ERROR] AttributeError: 'TraderConfig' object has no attribute 'stoploss_strategy_name'
Traceback (most recent call last):
File "/var/task/main.py", line 21, in lambda_handler
trader.apply_trading_rule()
File "/var/task/models/real_trader.py", line 51, in apply_trading_rule
self.__play_scalping_trade(candles)
File "/var/task/models/real_trader.py", line 143, in __play_scalping_trade
new_stop: float = self.__drive_trail_process(candles.iloc[-2], last_indicators)
File "/var/task/models/real_trader.py", line 182, in __drive_trail_process
possible_stoploss: float = self.stoploss_method()(
File "/var/task/models/real_trader.py", line 40, in stoploss_method
return stoploss_strategy.STRATEGIES[self.config.stoploss_strategy_name]
Followomg error occured.
Traceback (most recent call last):
File "beta_cord.py", line 105, in <module>
start_test_menu()
File "beta_cord.py", line 79, in start_test_menu
transactions = libra.request_massive_transactions()
File "/home/sasaki/lab/py_fx/models/history_librarian.py", line67, in request_massive_transactions
from_id, to_id = self.__client.request_transaction_ids()
File "/home/sasaki/lab/py_fx/models/oanda_py_client.py", line 332, in request_transaction_ids
response = self.__api_client.request(request_obj)
File "/usr/local/pyenv/versions/20200222/lib/python3.8/site-packages/oandapyV20/oandapyV20.py", line 305, in request
response = self.__request(method, url,
File "/usr/local/pyenv/versions/20200222/lib/python3.8/site-packages/oandapyV20/oandapyV20.py", line 242, in __request
raise V20Error(response.status_code,
oandapyV20.exceptions.V20Error: <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<meta http-equiv="refresh" content="0">
<title>api-fxpractice.oanda.com | 504: Gateway time-out</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" type="text/css" media="screen,projection" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" type="text/css" media="screen,projection" /><![endif]-->
<style type="text/css">body{margin:0;padding:0}</style>
</head>
<body>
<div id="cf-wrapper">
<div id="cf-error-details" class="cf-error-details-wrapper">
<div class="cf-wrapper cf-error-overview">
<h1>
<span class="cf-error-type">Error</span>
<span class="cf-error-code">504</span>
<small class="heading-ray-id">Ray ID: 5cad60b3ea83e11a • 2020-08-30 09:10:26 UTC</small>
</h1>
<h2 class="cf-subheadline">Gateway time-out</h2>
</div><!-- /.error-overview -->
<div class="cf-section cf-highlight cf-status-display">
<div class="cf-wrapper">
<div class="cf-columns cols-3">
<div id="cf-browser-status" class="cf-column cf-status-item cf-browser-status ">
<div class="cf-icon-error-container">
<i class="cf-icon cf-icon-browser"></i>
<i class="cf-icon-status cf-icon-ok"></i>
</div>
<span class="cf-status-desc">You</span>
<h3 class="cf-status-name">Browser</h3>
<span class="cf-status-label">Working</span>
</div>
<div id="cf-cloudflare-status" class="cf-column cf-status-item cf-cloudflare-status ">
<div class="cf-icon-error-container">
<i class="cf-icon cf-icon-cloud"></i>
<i class="cf-icon-status cf-icon-ok"></i>
</div>
<span class="cf-status-desc">Ashburn</span>
<h3 class="cf-status-name">Cloudflare</h3>
<span class="cf-status-label">Working</span>
</div>
<div id="cf-host-status" class="cf-column cf-status-item cf-host-status cf-error-source">
<div class="cf-icon-error-container">
<i class="cf-icon cf-icon-server"></i>
<i class="cf-icon-status cf-icon-error"></i>
</div>
<span class="cf-status-desc">api-fxpractice.oanda.com</span>
<h3 class="cf-status-name">Host</h3>
<span class="cf-status-label">Error</span>
</div>
</div>
</div>
</div><!-- /.status-display -->
<div class="cf-section cf-wrapper">
<div class="cf-columns two">
<div class="cf-column">
<h2>What happened?</h2>
<p>The web server reported a gateway time-out error.</p>
</div>
<div class="cf-column">
<h2>What can I do?</h2>
<p>Please try again in a few minutes.</p>
</div>
</div>
</div><!-- /.section -->
<div class="cf-error-footer cf-wrapper">
<p>
<span class="cf-footer-item">Cloudflare Ray ID: <strong>5cad60b3ea83e11a</strong></span>
<span class="cf-footer-separator">•</span>
<span class="cf-footer-item"><span>Your IP</span>: 18.188.185.246</span>
<span class="cf-footer-separator">•</span>
<span class="cf-footer-item"><span>Performance & security by</span> <a href="https://www.cloudflare.com/5xx-error-landing?utm_source=error_footer" id="brand_link" target="_blank">Cloudflare</a></span>
</p>
</div><!-- /.error-footer -->
</div><!-- /#cf-error-details -->
</div><!-- /#cf-wrapper -->
</body>
</html>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.