Skip to content

[TradingView] handle TRAILING_PROFILE for balanced order groups#1470

Merged
GuillaumeDSM merged 1 commit intodevfrom
trailing
Mar 22, 2025
Merged

[TradingView] handle TRAILING_PROFILE for balanced order groups#1470
GuillaumeDSM merged 1 commit intodevfrom
trailing

Conversation

@GuillaumeDSM
Copy link
Member

@GuillaumeDSM GuillaumeDSM commented Mar 20, 2025

@GuillaumeDSM GuillaumeDSM requested a review from Herklos March 20, 2025 16:10
@GuillaumeDSM GuillaumeDSM self-assigned this Mar 20, 2025
entry_price = current_order.origin_price
for stop_order in stop_orders:
# register trailing profile in stop orders
stop_order.trailing_profile = trading_personal_data.create_filled_take_profit_trailing_profile(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this initializes a FILLED_TAKE_PROFIT trailing profile bound to the group take profits prices and entry price

Copy link
Member

@Herklos Herklos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

decimal.Decimal("0.01")
- trading_personal_data.get_fees_for_currency(buy_order.fee, take_profit_order.quantity_currency)
) / decimal.Decimal(str(len(tp_prices)))
assert take_profit_order.origin_price == tp_prices[i]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@GuillaumeDSM GuillaumeDSM merged commit aecc0bc into dev Mar 22, 2025
5 checks passed
@GuillaumeDSM GuillaumeDSM deleted the trailing branch March 22, 2025 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants