Compare commits

..

8 Commits

Author SHA1 Message Date
Matthias
c971a9b7f9 fix: improve form-select disabled dark style
Some checks are pending
FreqUI CI / build (18, ubuntu-22.04) (push) Waiting to run
FreqUI CI / build (20, ubuntu-22.04) (push) Waiting to run
FreqUI CI / build (21, ubuntu-22.04) (push) Waiting to run
FreqUI CI / build (22, ubuntu-22.04) (push) Waiting to run
2024-09-16 07:11:41 +02:00
Matthias
c45dab5a9a fix: use exchange.classname when available.
closes #2071
2024-09-16 07:07:56 +02:00
Matthias
769bb47a0f chore: remove unnecessary imports 2024-09-16 07:02:13 +02:00
Matthias
680a92579e chore: update exchange type definitions 2024-09-16 06:59:39 +02:00
Matthias
5868a8775b refactor: exchangeSelect -> typescript definition 2024-09-16 06:59:19 +02:00
Matthias
67d2d3f434 refactor: pass backtestresult to BacktestResultChart 2024-09-14 09:13:31 +02:00
Matthias
739569217e chore: convert backtestResultChart props to type-based 2024-09-14 09:11:14 +02:00
Matthias
f810ec8588 chore: convert profitPill to typed props 2024-09-14 09:04:30 +02:00
7 changed files with 45 additions and 37 deletions

View File

@ -1,16 +1,15 @@
<script setup lang="ts">
import { useBotStore } from '@/stores/ftbotwrapper';
import { ChartSliderPosition, Trade } from '@/types';
import { ChartSliderPosition, StrategyBacktestResult, Trade } from '@/types';
defineProps({
timeframe: { required: true, type: String },
strategy: { required: true, type: String },
freqaiModel: { required: false, default: undefined, type: String },
timerange: { required: true, type: String },
pairlist: { required: true, type: Array as () => string[] },
trades: { required: true, type: Array as () => Trade[] },
});
defineProps<{
timeframe: string;
strategy: string;
freqaiModel?: string;
timerange: string;
backtestResult: StrategyBacktestResult;
}>();
const botStore = useBotStore();
const isBarVisible = ref({ right: true, left: true });
const sliderPosition = ref<ChartSliderPosition>();
@ -61,19 +60,19 @@ const navigateChartToTrade = (trade: Trade) => {
v-if="isBarVisible.left"
class="col-md-2 overflow-y-auto overflow-x-hidden"
style="max-height: calc(100vh - 200px)"
:pairlist="pairlist"
:trades="trades"
:pairlist="backtestResult.pairlist"
:trades="backtestResult.trades"
sort-method="profit"
:backtest-mode="true"
/>
</Transition>
<CandleChartContainer
:available-pairs="pairlist"
:available-pairs="backtestResult.pairlist"
:historic-view="!!true"
:timeframe="timeframe"
:timerange="timerange"
:strategy="strategy"
:trades="trades"
:trades="backtestResult.trades"
class="flex-shrink-1 candle-chart-container w-100 px-0 h-100 align-self-stretch"
:slider-position="sliderPosition"
:freqai-model="freqaiModel"
@ -84,13 +83,17 @@ const navigateChartToTrade = (trade: Trade) => {
v-if="isBarVisible.right"
class="overflow-y-auto col-md-2 overflow-x-visible"
style="max-height: calc(100vh - 200px)"
:trades="trades.filter((t) => t.pair === botStore.activeBot.selectedPair)"
:trades="backtestResult.trades.filter((t) => t.pair === botStore.activeBot.selectedPair)"
@trade-select="navigateChartToTrade"
/>
</Transition>
</div>
<BCard header="Single trades" class="row mt-2 w-100">
<TradeList class="row trade-history mt-2 w-100" :trades="trades" :show-filter="true" />
<TradeList
class="row trade-history mt-2 w-100"
:trades="backtestResult.trades"
:show-filter="true"
/>
</BCard>
</div>
</template>

View File

@ -1,12 +1,10 @@
<script setup lang="ts">
import { useBotStore } from '@/stores/ftbotwrapper';
import { ExchangeSelection } from '@/types';
import type { ExchangeSelection } from '@/types';
const exchangeModel = defineModel<ExchangeSelection>({ required: true });
const exchangeModel = defineModel({
type: Object as () => ExchangeSelection,
required: true,
});
const botStore = useBotStore();
const exchangeList = computed(() => {
@ -19,14 +17,21 @@ const exchangeList = computed(() => {
.sort((a, b) => a.name.localeCompare(b.name));
return [
{ label: 'Supported', options: supported.map((e) => e.name) },
{ label: 'Unsupported', options: unsupported.map((e) => e.name) },
{
label: 'Supported',
options: supported.map((e) => ({ value: e.classname ?? e.name, text: e.name })),
},
{
label: 'Unsupported',
options: unsupported.map((e) => ({ value: e.classname ?? e.name, text: e.name })),
},
];
});
const tradeModesTyped = computed(() => {
const val = botStore.activeBot.exchangeList.find(
(ex) => ex.name === exchangeModel.value.exchange,
(ex) =>
ex.name === exchangeModel.value.exchange || ex.classname === exchangeModel.value.exchange,
)?.trade_modes;
return val ?? [];
});

View File

@ -1,12 +1,6 @@
<script setup lang="ts">
import { useBotStore } from '@/stores/ftbotwrapper';
import { usePairlistConfigStore } from '@/stores/pairlistConfig';
import PairlistConfigItem from './PairlistConfigItem.vue';
import PairlistConfigBlacklist from './PairlistConfigBlacklist.vue';
import PairlistConfigActions from './PairlistConfigActions.vue';
import { Pairlist } from '@/types';
import { useSortable, moveArrayElement } from '@vueuse/integrations/useSortable';
import ExchangeSelect from './ExchangeSelect.vue';
const botStore = useBotStore();
const pairlistStore = usePairlistConfigStore();

View File

@ -1,10 +1,10 @@
<script setup lang="ts">
const props = defineProps({
profitRatio: { required: false, default: undefined, type: Number },
profitAbs: { required: false, default: undefined, type: Number },
stakeCurrency: { required: true, type: String },
profitDesc: { required: false, default: '', type: String },
});
const props = defineProps<{
profitRatio?: number;
profitAbs?: number;
stakeCurrency: string;
profitDesc?: string;
}>();
const isProfitable = computed(() => {
return (
(props.profitRatio !== undefined && props.profitRatio > 0) ||

View File

@ -263,6 +263,10 @@
background-size: 16px 12px;
background-repeat: no-repeat;
background-position: right 0.75rem center;
&:disabled {
color: darken($fg-color, 30%);
background: lighten($bg-dark, 10%);
}
}
.toast {

View File

@ -12,6 +12,9 @@ export interface Exchange {
comment: string;
dex?: boolean;
trade_modes: TradeMode[];
is_alias?: boolean;
alias_for?: string | null;
classname?: string;
}
export interface ExchangeListResult {

View File

@ -213,8 +213,7 @@ watch(
:timeframe="timeframe"
:strategy="btStore.strategy"
:timerange="btStore.timerange"
:pairlist="botStore.activeBot.selectedBacktestResult.pairlist"
:trades="botStore.activeBot.selectedBacktestResult.trades"
:backtest-result="botStore.activeBot.selectedBacktestResult"
:freqai-model="btStore.freqAI.enabled ? btStore.freqAI.model : undefined"
/>
</div>