From 346acbb0e6af3736bc028b7a2324eaf6e1a0797b Mon Sep 17 00:00:00 2001 From: Dmytro Shcherbonos <81973123+dmytroshch@users.noreply.github.com> Date: Wed, 6 Sep 2023 21:13:39 +0300 Subject: [PATCH] (feature) Backtest History (#680) * Restore Recurring order on FE * HistoryButton: moved to separated component * Backtest: add history/new test toggler * PanelButton: align text and icon * fetch strategy backtests * BT history: recieve data from data-server * BT history: layout list * BT history: restructure components and folders * BT history: launch to details tab * BT history: details layout" * fix prop validation * BT history: fix styles * BT history: results * Revert "Merge pull request #394 from dmytroshch/fix/backtest-clear" This reverts commit 755f7dd4a7234957207f72907e02184a0ba4f884, reversing changes made to 7e41af40fa421e5f1421ae0b652169edd41d9e83. * fixed: new test button * BT: add bt to history after execution * BT: log error messages during execution * BT: update initial messages * BT: fix button style * BT: reset tab state when strategy has changed * BT: change fetching history logic * removed duplicated action * rename method * BT: remove history on strategy delete * BT history: move some component state properties to redux store * StrategyLiveChart: unify data * removed unused * resolve useCallback dependecies * Show backtest range in results * fix prop validation * getting recurring ao atomic orders * fix failed order layout * Resolve issue with recurring AO template selection * OrderHistory: add id property for failed order * improve formatTime fn * update ufx-ui to 0.15.3 * DatePicker: fix clipping with parent's container * DatePicker: remove unused * DatePicker: limit min/max time, improve onChange handler * Recurring: improve end date input * DatePicker: improve position * BacktestOptionsPanel: use DatePicker from ui components * BacktestOptionsPanel: resolve issue with time period dropdown which is not eqaul to start/endDate * Message for invalid api creds * resolve conflicts * resolve lint * resolve lint --- .../BacktestResultsOptionsPanel.js | 19 +++++---- .../BacktestProgressBar.js | 6 ++- .../StrategyEditor/tabs/BacktestTab.js | 19 ++++++++- .../tabs/StrategyTab/StrategyLiveTab.js | 10 ++++- .../StrategyLiveChart/StrategyLiveChart.js | 42 +++++++++---------- src/redux/reducers/ws/backtestHistory.js | 1 + 6 files changed, 63 insertions(+), 34 deletions(-) diff --git a/src/components/BacktestOptionsPanel/BacktestResultsOptionsPanel.js b/src/components/BacktestOptionsPanel/BacktestResultsOptionsPanel.js index 1d290f4c1..6c6bfa01e 100644 --- a/src/components/BacktestOptionsPanel/BacktestResultsOptionsPanel.js +++ b/src/components/BacktestOptionsPanel/BacktestResultsOptionsPanel.js @@ -18,6 +18,16 @@ import WSActions from '../../redux/actions/ws' import { BACKTEST_TAB_SECTIONS } from '../../redux/reducers/ui' import { getCurrentHistoryBacktest } from '../../redux/selectors/ws' +const renderBacktestRange = (backtest, formatTime, t) => ( +

+ {t('strategyEditor.backtestHistoryResults')} +   + {renderDate(_get(backtest, 'start', 0), formatTime, false)} +   -   + {renderDate(_get(backtest, 'end', 0), formatTime, false)} +

+) + const BacktestResultsOptionsPanel = ({ showFullscreenChart }) => { const formatTime = useSelector(getFormatTimeFn) const backtest = useSelector(getCurrentHistoryBacktest) @@ -45,13 +55,7 @@ const BacktestResultsOptionsPanel = ({ showFullscreenChart }) => { isActive={false} icon={} /> -

- {t('strategyEditor.backtestHistoryResults')} -   - - {renderDate(_get(backtest, 'timestamp', 0), formatTime, false)} - -

+ {renderBacktestRange(backtest, formatTime, t)}