From 1a27e89c607a0a37afc916165a87ca41a4f3a018 Mon Sep 17 00:00:00 2001 From: Madalina Raicu Date: Tue, 5 Mar 2024 15:34:39 +0000 Subject: [PATCH] feat(trading): remove required, fix oco --- .../components/deal-ticket/deal-ticket-price-tp-sl.tsx | 2 -- .../src/utils/map-form-values-to-submission.ts | 8 +------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-price-tp-sl.tsx b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-price-tp-sl.tsx index 8a8d307e8..63af20645 100644 --- a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-price-tp-sl.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-price-tp-sl.tsx @@ -84,7 +84,6 @@ export const DealTicketPriceTakeProfitStopLoss = ({ name="takeProfit" control={control} rules={{ - required: t('You need provide a take profit price'), min: { value: priceStep, message: t( @@ -138,7 +137,6 @@ export const DealTicketPriceTakeProfitStopLoss = ({ name="stopLoss" control={control} rules={{ - required: t('You need provide a stop loss price'), min: { value: priceStep, message: t('Price cannot be lower than {{priceStep}}', { diff --git a/libs/deal-ticket/src/utils/map-form-values-to-submission.ts b/libs/deal-ticket/src/utils/map-form-values-to-submission.ts index c31ddbf56..5a1d0ea82 100644 --- a/libs/deal-ticket/src/utils/map-form-values-to-submission.ts +++ b/libs/deal-ticket/src/utils/map-form-values-to-submission.ts @@ -112,13 +112,7 @@ export const mapFormValuesToStopOrdersSubmission = ( decimalPlaces ); let oppositeStopOrderSetup: StopOrderSetup | undefined = undefined; - if ( - data.oco && - data.ocoType && - data.ocoPrice && - data.ocoSize && - data.ocoTimeInForce - ) { + if (data.oco && data.ocoType && data.ocoSize && data.ocoTimeInForce) { oppositeStopOrderSetup = { orderSubmission: mapFormValuesToOrderSubmission( {