From f0f22eee058bb07b12d6485251e1340af8ffbf47 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Fri, 2 Aug 2024 22:18:48 +0200 Subject: [PATCH] [TradingView] ignore price for market orders --- .../trading_view_signals_trading.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Trading/Mode/trading_view_signals_trading_mode/trading_view_signals_trading.py b/Trading/Mode/trading_view_signals_trading_mode/trading_view_signals_trading.py index ce1eebee8..a76a9979d 100644 --- a/Trading/Mode/trading_view_signals_trading_mode/trading_view_signals_trading.py +++ b/Trading/Mode/trading_view_signals_trading_mode/trading_view_signals_trading.py @@ -249,7 +249,8 @@ async def _parse_order_details(self, ctx, parsed_data): f"Unknown signal: {parsed_data[TradingViewSignalsTradingMode.SIGNAL_KEY]}, full data= {parsed_data}" ) state = trading_enums.EvaluatorStates.NEUTRAL - target_price = await self._parse_price(ctx, parsed_data, TradingViewSignalsTradingMode.PRICE_KEY, 0) + target_price = 0 if order_type == TradingViewSignalsTradingMode.MARKET_SIGNAL else ( + await self._parse_price(ctx, parsed_data, TradingViewSignalsTradingMode.PRICE_KEY, 0)) stop_price = await self._parse_price( ctx, parsed_data, TradingViewSignalsTradingMode.STOP_PRICE_KEY, math.nan )