mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-10 10:21:55 +00:00
Move trade entry symbol to first filled entry
This commit is contained in:
parent
6f92a03b40
commit
f6fa2f3d5e
|
@ -59,6 +59,7 @@ export function getTradeEntries(dataset: PairHistory, trades: Trade[]) {
|
|||
const stop_ts_adjusted = dataset.data_stop_ts + dataset.timeframe_ms;
|
||||
for (let i = 0, len = trades.length; i < len; i += 1) {
|
||||
const trade: Trade = trades[i];
|
||||
const openTs = trade.open_fill_timestamp ?? trade.open_timestamp;
|
||||
if (
|
||||
// Trade is open or closed and within timerange
|
||||
roundTimeframe(dataset.timeframe_ms ?? 0, trade.open_timestamp) <= stop_ts_adjusted ||
|
||||
|
@ -80,7 +81,7 @@ export function getTradeEntries(dataset: PairHistory, trades: Trade[]) {
|
|||
// Trade entry
|
||||
if (i === 0) {
|
||||
tradeData.push([
|
||||
roundTimeframe(dataset.timeframe_ms ?? 0, trade.open_timestamp),
|
||||
roundTimeframe(dataset.timeframe_ms ?? 0, openTs),
|
||||
order.safe_price,
|
||||
OPEN_CLOSE_SYMBOL,
|
||||
order.ft_order_side == 'sell' ? 180 : 0,
|
||||
|
|
Loading…
Reference in New Issue
Block a user