mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-22 11:05:17 +00:00
Use "reduced" pair_history endpoint
This commit is contained in:
parent
d51246d1d1
commit
fa18c043c4
|
@ -192,6 +192,7 @@ function refresh() {
|
|||
timerange: props.timerange,
|
||||
strategy: props.strategy,
|
||||
freqaimodel: props.freqaiModel,
|
||||
columns: plotStore.usedColumns,
|
||||
});
|
||||
} else {
|
||||
botStore.activeBot.getPairCandles({
|
||||
|
@ -234,7 +235,7 @@ watch(
|
|||
() => {
|
||||
// all plotstore.usedColumns are in the dataset
|
||||
const hasAllColumns = plotStore.usedColumns.every((c) => datasetColumns.value.includes(c));
|
||||
if (!props.historicView && settingsStore.useReducedPairCalls && !hasAllColumns) {
|
||||
if (settingsStore.useReducedPairCalls && !hasAllColumns) {
|
||||
console.log('triggering refresh');
|
||||
refresh();
|
||||
}
|
||||
|
|
|
@ -394,16 +394,28 @@ export function createBotSubStore(botId: string, botName: string) {
|
|||
if (payload.pair && payload.timeframe) {
|
||||
this.historyStatus = LoadingStatus.loading;
|
||||
try {
|
||||
const { data } = await api.get('/pair_history', {
|
||||
params: { ...payload },
|
||||
timeout: 50000,
|
||||
});
|
||||
const settingsStore = useSettingsStore();
|
||||
let result: PairHistory | null = null;
|
||||
if (this.botApiVersion >= 2.35 && settingsStore.useReducedPairCalls) {
|
||||
// Modern approach, allowing filtering of columns
|
||||
const { data } = await api.post<PairHistoryPayload, AxiosResponse<PairHistory>>(
|
||||
'/pair_history',
|
||||
payload,
|
||||
);
|
||||
result = data;
|
||||
} else {
|
||||
const { data } = await api.get<PairHistory>('/pair_history', {
|
||||
params: { ...payload },
|
||||
timeout: 50000,
|
||||
});
|
||||
result = data;
|
||||
}
|
||||
this.history = {
|
||||
[`${payload.pair}__${payload.timeframe}`]: {
|
||||
pair: payload.pair,
|
||||
timeframe: payload.timeframe,
|
||||
timerange: payload.timerange,
|
||||
data: data,
|
||||
data: result,
|
||||
},
|
||||
};
|
||||
this.historyStatus = LoadingStatus.success;
|
||||
|
|
|
@ -27,6 +27,7 @@ export interface PairHistoryPayload {
|
|||
timerange: string;
|
||||
strategy: string;
|
||||
freqaimodel?: string;
|
||||
columns?: string[];
|
||||
}
|
||||
|
||||
export interface PairHistory {
|
||||
|
|
Loading…
Reference in New Issue
Block a user