{"version":3,"sources":["style/placeconfirmview.module.css","style sync /^/.*/.module/.css$","style/black/app.module.css","style/black/default.module.css","style/black/quotationview.module.css","style/common/accountbriefview.module.css","style/common/bottombar.module.css","style/common/closeorderview.module.css","style/common/deliveryview.module.css","style/common/fundview.module.css","style/common/inputnumber.module.css","style/common/inventoryview.module.css","style/common/login.module.css","style/common/messagelognews.module.css","style/common/openpositionview.module.css","style/common/orderqueryresult.module.css","style/common/orderqueryview.module.css","style/common/pendingorderview.module.css","style/common/placeview.module.css","style/common/pricealert.module.css","style/common/report.module.css","style/common/settingview.module.css","style/common/titlebar.module.css","style/common/todayexecute.module.css","style/common/workinglistview.module.css","style/mainview.module.css","style/white/app.module.css","style/white/default.module.css","style/white/quotationview.module.css","common/extenionmethod.js","common/const.js","common/utils.js","model/price2.js","model/physicalHelper.js","model/orderHelper.js","model/instrumentextension.js","model/modelextension.js","view/baseview.js","view/titlebarview.js","view/quotationview.js","view/placing/expireselectview.js","common/transactionerror.js","model/placinglotsetting.js","view/placing/placeconfirmview.js","view/inputnumbercomponent.js","view/placing/placinginstalmentdetailview.js","view/placing/placinginstalmentview.js","model/placingpricesetting.js","view/placing/placingdqview.js","view/placing/placingpendingview.js","view/placing/workinglistview.js","view/placing/pendinglistview.js","view/physical/inventoryitemview.js","view/physical/inventoryview.js","view/physical/deliveryinprocessview.js","chart/typeDefine.ts","chart/data/dataSource.ts","chart/data/lastbarUpdater.ts","chart/Indicator/addingIndicator/sd.ts","chart/Indicator/addingIndicator/linearRegression.ts","chart/Indicator/addingIndicator/VIDYA.ts","chart/Indicator/addingIndicator/Aroon.ts","chart/Indicator/tooltip/ToolTipText.tsx","chart/Indicator/tooltip/ToolTipTSpanLabel.tsx","chart/Indicator/tooltip/AroonTooltip.tsx","chart/Indicator/addingIndicator/cv.ts","chart/Indicator/addingIndicator/cmo.ts","chart/Indicator/addingIndicator/utils.ts","chart/Indicator/addingIndicator/cci.ts","chart/Indicator/addingIndicator/dpo.ts","chart/Indicator/addingIndicator/fco.ts","chart/Indicator/addingIndicator/mo.ts","chart/Indicator/addingIndicator/po.ts","chart/Indicator/addingIndicator/ro.ts","chart/Indicator/addingIndicator/TRIX.ts","chart/Indicator/addingIndicator/tr.ts","chart/Indicator/addingIndicator/uo.ts","chart/Indicator/addingIndicator/vhf.ts","chart/Indicator/addingIndicator/wad.ts","chart/Indicator/addingIndicator/wr.ts","chart/Indicator/addingIndicator/si.ts","chart/Indicator/builderForAux/siBuilder.tsx","chart/Indicator/addingIndicator/asi.ts","chart/Indicator/builderForAux/hmlBuilder.tsx","chart/Indicator/addingIndicator/hml.ts","chart/Indicator/addingIndicator/lrrs.ts","chart/Indicator/addingIndicator/lrs.ts","chart/Indicator/addingIndicator/mi.ts","chart/Indicator/addingIndicator/pi.ts","chart/Indicator/addingIndicator/proc.ts","chart/Indicator/series/BBSeries.tsx","chart/Indicator/addingIndicator/bb.ts","chart/Indicator/builderForMain/bbBuilder.tsx","chart/Indicator/series/MASeries.tsx","chart/Indicator/builderForMain/maBuilder.tsx","chart/Indicator/builderForMain/sarBuilder.tsx","chart/Indicator/addingIndicator/mae.ts","chart/Indicator/series/MAESeries.tsx","chart/Indicator/addingIndicator/wws.ts","chart/chartHelper.tsx","chart/Indicator/builderForMain/maeBuilder.tsx","chart/Indicator/builderForMain/wwsBuilder.tsx","chart/Indicator/builderForAux/macdBuilder.tsx","chart/Indicator/builderForAux/rsiBuilder.tsx","chart/Indicator/builderForAux/stoBuilder.tsx","chart/Indicator/builderForAux/atrBuilder.tsx","chart/Indicator/builderForAux/sdBuilder.tsx","chart/Indicator/builderForAux/VIDYABuilder.tsx","chart/Indicator/builderForAux/AroonBuilder.tsx","chart/Indicator/builderForAux/AroonOscillatorBuilder.tsx","chart/Indicator/builderForAux/cvBuilder.tsx","chart/Indicator/builderForAux/cmoBuilder.tsx","chart/Indicator/builderForAux/cciBuilder.tsx","chart/Indicator/builderForAux/dpoBuilder.tsx","chart/Indicator/builderForAux/fcoBuilder.tsx","chart/Indicator/builderForAux/moBuilder.tsx","chart/Indicator/builderForAux/poBuilder.tsx","chart/Indicator/builderForAux/roBuilder.tsx","chart/Indicator/builderForAux/TRIXBuilder.tsx","chart/Indicator/builderForAux/trBuilder.tsx","chart/Indicator/builderForAux/uoBuilder.tsx","chart/Indicator/builderForAux/vhfBuilder.tsx","chart/Indicator/builderForAux/wadBuilder.tsx","chart/Indicator/builderForAux/wrBuilder.tsx","chart/Indicator/builderForAux/asiBuilder.tsx","chart/Indicator/builderForAux/lrrsBuilder.tsx","chart/Indicator/builderForAux/lrsBuilder.tsx","chart/Indicator/builderForAux/miBuilder.tsx","chart/Indicator/builderForAux/piBuilder.tsx","chart/Indicator/builderForAux/procBuilder.tsx","chart/EventDispatcher.tsx","chart/theme.ts","chart/ZoomHelper.tsx","chart/ChartSplitter.tsx","chart/core/EdgeHelper.tsx","chart/core/BaEdgeIndicator.tsx","chart/indicatorDefaultSettings.ts","chart/chartContext.ts","chart/ChartCore.tsx","chart/data/withOHLCData.tsx","chart/Indicator/tooltip/BBTooltip.tsx","chart/Indicator/tooltip/MATooltip.tsx","chart/Indicator/tooltip/SARTooltip.tsx","chart/Indicator/tooltip/MAETooltip.tsx","chart/Indicator/tooltip/WWSTooltip.tsx","chart/Indicator/tooltip/BaseTooltip.tsx","chart/Indicator/tooltip/ChartTooltip.tsx","chart/NumericInput.tsx","chart/ColorPicker.tsx","chart/IndicatorSelector.tsx","chart/ChartView.tsx","charting_library/charting_library.esm.js","chart/data/chartDataParser.ts","chart/tvchart/dataapi.ts","chart/tvchart/TvChartContainer.tsx","chart/Scrollbar.tsx","chart/HeaderBar.tsx","chart/ChartFrame.tsx","view/placing/placeview.js","view/physical/deliveryview.js","view/physical/inventorydetailview.js","view/physical/repaymentview.js","view/physical/instalmentperiodview.js","view/physical/instalmentsumview.js","chart/multichartview.tsx","view/placing/padchartview.tsx","view/openposition/closeorderitemview.js","view/openposition/closeorderview.js","view/openposition/openpositiongroupview.js","view/openposition/openpositionview.js","view/orderquery/orderqueryview.js","view/orderquery/orderqueryresultview.js","view/physical/shortsellview.js","view/physical/padstockview.js","view/orderquery/todayexecuteview.js","view/messagelognews/messageview.js","view/messagelognews/logview.js","view/setting/colorpickerview.js","view/setting/pricealertview.js","view/padbottomtabview.js","view/loginview.js","view/fund/balanceview.js","view/fund/accountbriefview.js","view/setting/changepasswordview.js","view/openposition/opencontractview.js","view/orderquery/pendingorderview.js","view/orderquery/pendingorderdetailview.js","model/cancelReasonHelper.js","view/bottombar.js","view/report/reportview.js","view/report/frameview.js","view/fund/fundview.js","view/fund/paymentinstructionview.js","view/fund/onlinetransferview.js","view/fund/bankaccountview.js","view/setting/settingview.js","view/setting/stylesettingview.js","view/setting/instrumentsettingview.js","view/setting/accountsettingview.js","view/setting/clientregistrationview.js","model/price.js","model/dataprocessor.js","model/configExtension.js","chart/data/asyncResult.ts","comm.js","app.js","locale/i18n.js","index.js"],"names":["module","exports","map","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","e","Error","code","keys","Object","resolve","Boolean","parseBoolean","s","undefined","parseInt","toString","bool","toLowerCase","Math","round2","value","digits","parseFloat","toFixed","String","formatFloat","decimalDigits","withKilocharacter","formatWithKilocharacter","formatWithoutKilocharacter","Date","toMSJSON","d","timezone","getTimezoneOffset","date","getTime","console","log","valueString","newStr","symbolPN","firstChar","substr","length","rightPart","iLength","index","indexOf","padZero","leftPart","concat","substring","retStr","RegExp","exec","pointPos","$1","decimalFraction","decimalFractionStr","pow","xxx","PriceTrend","MarketInfoType","InstrumentCategory","TransactionType","TransactionSubType","Phase","Placing","Placed","Canceled","Executed","Completed","Deleted","PendingOrderExpireType","OrderType","SpotTrade","Limit","Market","MarketOnOpen","MarketOnClose","OneCancelOther","Risk","Stop","MultipleClose","MarketToLimit","StopLimit","FAK_Market","BinaryOption","TradeOption","PlacingSettingType","BuySell","LimitOrStop","InstrumentStatus","AllowIfDoneType","PhysicalTradeSide","freeze","None","Buy","Sell","ShortSell","Delivery","Deposit","DeliveryRequestStatus","InventoryInProcessStatus","PaymentForm","PhysicalInstalmentType","InstalmentFrequence","RecalculateRateType","ContractTerminateType","AllowCloseInstalment","AdvancePaymentOption","PhysicalChargeBasis","DiscountOption","DiscountBasis","PayType","CooKey","BankAccountType","PriceAlertState","PriceAlertCondition","PopMessageType","UpdateAction","Init","Add","Modify","Delete","BSStatus","AcceptNewLimitStop","UploadBankCardType","OrderDetailViewType","UserRelation","BillType","AdministrationFeeBaseType","DeliveryMode","CancelReason","getEnumLangaugeKey","enumName","languageKey","exchangeRate","amount","rateIn","rateOut","sourceDecimals","targetDecimals","formatPrice","price","denominator","formatNumber","floatNum","decimals","isNaN","replace","uuid","c","r","random","format","arguments","str","i","re","format2","string","args","pattern","match","getTimeString","dt","withMilliseconds","h","getHours","m","getMinutes","getSeconds","f","getMilliseconds","getDateTimeString","y","getFullYear","getMonth","getDate","getDateString","parseDate","moment","isInTime","now","beginTime","endTime","current","begin","end","result","isEmpty","isNumeric","n","isFinite","isInteger","forceToArray","arr","Array","isArray","push","getPhaseLanguageKey","phase","getExpireLanguageKey","expireType","getConditionLanguage","condition","_jsxs","children","_jsx","Trans","convertToXml","nodeName","addToXml","xmlDoc","DOMParser","parseFromString","documentElement","attr","forEach","item","node","ownerDocument","createElement","appendChild","val","error","setAttribute","getDecimals","num","decimalPart","saveCookie","key","data","isSession","cipherkey","cookieData","CryptoJS","AES","encrypt","sessionStorage","setItem","expirationDate","setDate","cookie","save","expires","removeCookie","removeItem","remove","loadCookie","getItem","load","decrypt","enc","Utf8","ex","getMarketInfoText","marketInfoType","marketInfoText","getWfLanguage","language","isValidEmail","email","test","isValidPhoneNumber","startsWith","getQueryString","name","URL","window","location","href","searchParams","get","logError","content","duration","antMessage","destroy","setTimeout","NormalizePrice","this","PriceString","PriceValue","Clear","Price","priceRegexExpression","PriceRegex","compile","numeratorUnit","normalizedPrice","normalizedValue","Parse","priceString","normalizePrice","Normalize","Clone","ToString","ToDouble","IsSameType","price2","isSameType","alert","points","GetPrice","SubStract","SubStract3","Avg","prices","total","iCount","mean","CompareTo","More","Less","Equal","MoreEqual","LessEqual","searchResult","priceValue","unit","numerator","getRate","frequence","interestrate","getDownpaymentSettings","instalmentPolicyDetail","defaultValue","downPaymentSettings","step","DownPaymentBasis","max","MaxDownPayment","min","MinDownPayment","default","utils","selectedPeriod","Period","downPayment","getRepaymentAmount","rate","installments","tmp","calculateInstalmentDetails","physicalInstalmentType","period","currencyName","instalmentCalculateResults","principal","totalInstalmentAmount","totalPrincipal","totalInterest","rate0","instalmentAmount","interest","instalmentDetail","instalments","calculateEqualInstalment","calculateEqualPrincipal","calculatePhysicalValue","lotInteger","lotRemainder","livePrice","discountOfOdd","tradePLFormula","contractSize","calculateDiscount","paymentDiscountPolicy","lot","marketValue","paymentForm","details","sort","a","b","From","AllowedPaymentForm","Option","detail","findLastDiscountDetail","discount","DiscountValue","calculateLot","range","calculateValue","calcAdministrativeCharge","model","account","instrument","order","tradePolicyDetail","TradePolicyDetails","Id","AdministrativeChargeId","AdministrativeChargeConvertRate","administrativeChargeId","totalConvertedAmount","values","instruments","otherInstrument","openPositions","lotBalance","LotBalance","itemTradePolicyDetail","Lot","convertedAmount","chargePolicy","administrativeCharges","charges","Quantity","ChargeRate","getAdministrativeChargeRate","ContractSize","SetPrice","ratedCharge","IsMultiCurrency","CurrencyId","placingData","physicalOptions","administrativeCharge","canDelivery","inventory","physicalOriginValueBalance","PhysicalOriginValueBalance","paidPledgeBalance","PaidPledgeBalance","deliveryLotInProcess","abs","gotoDelivery","callback","AllowedPhysicalTradeSides","hasDeliveryOrder","physicalInventory","checked","deliveryLot","selectedInstrument","commService","getDeliveryAddress","DeliveryPointGroupId","JSON","parse","Result","content_result","DeliveryAddresses","deliveryAddresses","DeliveryAddress","deliveryAddressCallback","calculateOrderFloating","Transaction","AccountID","selectedAccount","Bills","Bill","Levy","Commission","OtherFee","PhysicalPaymentDiscount","bill","Type","Value","IsOpen","InterestPLFloat","StoragePLFloat","TradePLFloat","lastQuotation","Bid","isPayoff","quotation","quotations","UseQuotePolicyId","PublicQuotePolicyId","close","buy","IsNormal","Ask","sell","IsBuy","ExecutePrice","interestPLFloat","InterestPerLot","storagePLFloat","StoragePerLot","Denominator","LivePrice","tradePLFloat","instrumentCategory","tradePL","calculateTradePL","TradePLFormula","currencies","Decimals","CurrencyID","UnpaidAmount","MarketValue","PedgeAmount","MarketValueInStock","Category","accounts","quotePolicyId","isNormal","isBuy","NumeratorUnit","pedgeAmount","unpaidAmount","DiscountOfOdd","currency","ValueDiscountAsMargin","DeliveryChargeId","deliveryCharge","deliveryCharges","ChargeBasis","charge","MinCharge","calculateMarketValue","interestPL","OrderRelations","OrderRelation","relation","TradePL","RateIn","RateOut","TargetDecimals","InterestPL","getOrderTypeLanguageKey","isAcceptedNewLimitPosition","isOpen","exceptOrderId","IsAcceptNewLimit","buyLot","sellLot","orders","IsAcceptNewMOOMOC","isAcceptedNewStopPosition","IsAcceptNewStop","bindFunctions","isPhysical","bind","getOrderTypes","calculateFloating","formatRearPrice","needQuote","getAvailableOrderTypes","dealLot","isMarket","dealingPolicyDetail","DQQuoteMinLot","price1","differenceIndex","startOf","RearPrice","rearPrice","orderTypeMask","OrderTypeMask","IsActive","mask","orderType","totalBuyLot","totalSellLot","averageBuyPrice","averageSellPrice","totalBuyPrice","totalSellPrice","maxDQLot","MaxDQLot","maxOtherLot","MaxOtherLot","GetDecimals","decimalPosition","showLoadingSpin","showModalDialog","t","config","state","getValue","setValue","loadUserConfigItem","loadUserConfig","logs","isLogedin","processCommand","processSettingData","processTradingCommand","processCommandTransaction","resetAlertLevel","allowTrading","canPlaceOrder","canPlaceIfDoneOrder","canPlaceOcoOrder","buildTransactions","buildPlacingData","buildPlacingPhysicalOptions","calcPhysicalMarketValue","calculatePhysicalPaymentDiscount","setTransactionPhysicalOptions","buildDefaultOrder","buildDefaultTransaction","getServerTime","getPricingPolicyDetail","getExpireTypes","getInstalmentPolicyDetail","getPaymentParameter","isValidWithdrawTime","resetInput","getMaxCloseLot","switchQuotationMarketInfo","refreshAllowedCloseLot","hasPhysicalInstruments","hasForexInstruments","startDqPriceCountDown","orderingNotify","uploadFile","propName","loginResult","isDisconnected","Account","SettingSource","Messages","Message","message","messages","popMessage","type","onCancelClick","info","onOkClick","popMessages","shift","selectedMessage","Title","unshift","Log","getLogData","QtAppId","loginParam","jsonMessage","logsCache","logData","Action","style1Position","action","titleNotify","title","split","lastIndexOf","time","Time","warn","PriceAlerts","PriceAlert","triggeredAlert","State","ID","ModifyFlag","UserID","UserId","priceAlert","priceAlerts","InstrumentId","alerts","updatePriceAlerts","style","textAlign","Description","Condition","HitPrice","SettingUpdate","InstrumentStatuses","idStatus","status","InstrumentDailyCloseQuotations","InstrumentDailyCloseQuotation","dayQuotation","Timestamp","TimeStamp","QuotePolicyId","timestamp","assign","settingData","oldCustomer","Customer","customer","Instruments","Instrument","instrumentExtension","Accounts","reload","InterestRates","interestRates","InterestRate","interestRate","InterestRateId","TradePolicyDetail","Initialize","TradePolicyId","orderedInstruments","splice","DealingPolicyDetails","dealingPolicyDetails","DealingPolicyDetail","DealingPolicyId","PricingPolicyDetails","pricingPolicyDetails","PricingPolicyDetail","pricingPolicyDict","list","PricingPolicyId","instalmentPolicies","InstalmentPolicies","InstalmentPolicy","instalmentPolicy","InstalmentPolicyDetails","InstalmentPolicyDetail","policy","InstalmentPolicyId","Frequence","deliverySpecificationDetails","DeliverySpecificationDetails","DeliverySpecificationDetail","deliverySpecificationDetail","specificationDetails","DeliverySpecificationId","Size","DeliveryCharges","DeliveryCharge","physicalPaymentDiscounts","PhysicalPaymentDiscounts","physicalPaymentDiscount","PhysicalPaymentDiscountDetails","PhysicalPaymentDiscountDetail","PhysicalPaymentDiscountId","AdministrativeCharges","AdministrativeCharge","AdministrativeChargeDetails","AdministrativeChargeDetail","InstrumentUnits","instrumentUnits","InstrumentUnit","instrumentUnit","SystemParameter","Organizations","organizations","Organization","organization","AllowTraderResetAlertLevel","ForbiddenAlert","Code","AlertLevel","hideCancelButton","modelDialogTitle","AlertTime","RealAlertLevel","Version","Balance","Necessary","Equity","Euity","Funds","Fund","fund","accountFund","funds","DeliveryRequests","DeliveryRequest","deliveryRequest","deliveryStatus","Status","deliveryInProcess","existedDeliveryRequest","settlementTime","DeliveryTime","AvailableTime","SettlementTime","AccountId","Transactions","transactions","transaction","existingTran","Orders","Order","existingOrder","InstrumentID","orderRelations","existsRelation","placingTran","placingOrder","isTradingDataLoaded","selectedLot","allowedCloseLot","openOrder","OpenOrderID","workingList","doneOrder","AssigningOrderID","doneLimitPrice","doneStopPrice","lotBalanceIncludeDelivery","physicalShortSell","DeliveryRequestOrderRelations","DeliveryRequestOrderRelation","deliveryRequestOrderRelation","OpenOrderId","DeliveryLot","tradingData","TradePLNotValued","InterestPLNotValued","StoragePLNotValued","NetAsset","Usable","Ratio","currencyId","enableNetAsset","EnableNetAsset","TotalPaidAmount","CreditAmount","equity","RatioIncludeCredit","sourceCurrencyId","targetCurrencyId","sourceCurrency","targetCurrency","currencyRate","currencyRates","Name","pricingPolicyId","serverTimeDiff","IsTradingAllowed","DisallowTrade","AllowManagerTrading","AllowSalesTrading","dealingPolicy","maxDqLot","orderTypes","canPlacePendingOrderAtAnyTime","CanPlacePendingOrderAtAnyTime","isSpotTrade","AllowIfDone2","AllowNewOCO","expireTypes","GoodTillMonthDayOrder","GoodTillMonthGTF","GoodTillDate","GoodTillMonthSession","GoodTillMonthGTM","selectedOrders","selectedInventory","placePanelType","stopPrice","limitPrice","buyPrice","sellPrice","recalculateRateType","isMultiCurrency","RecalculateRateTypes","downpaymentSettings","AllowedInstalmentTypes","advanceAmount","administrationFee","AdministrationFeeBase","AdministrationFee","instalmentPolicyId","hasDonePrice","transactionType","openOrders","dqPrices","limitPrices","stopPrices","expireTime","tran","SubType","buySells","setPrice","buySell","buyOpenOrders","filter","isSelected","sellOrder","limitOrder","stopOrder","tradeOption","DQMaxMove","pips","SetPrice2","OriginalLot","doneLimitPriceNode","doneStopPriceNode","Extension","DownPayment","AdvanceAmount","closedLot","ClosedLot","CloseOrderID","OpenOrderPrice","OpenOrderTime","ExecuteTime","tradeDay","EndTime","SubmitorID","ExpireTime","BeginTime","SubmitTime","ExpireType","onlineTransferParameters","withdrawApplicationPolicy","BeginTime2","BeginTime3","BeginTime4","EndTime2","EndTime3","EndTime4","organizationIds","OrganizationId","join","xmlData","xml2json","xml2js","compact","spaces","parameters","languages","PaymentParameter","OnlineTransferParameters","OnlineTransferParameter","onlineTransferParameter","_attributes","OnlineTransferLanguages","OnlineTransferLanguage","Key","CurrencyRates","CurrencyRate","SourceCurrencyId","TargetCurrencyId","disableDepositExpireTime","DisableDepositExpireTime","WithdrawApplicationPolicies","WithdrawApplicationPolicy","quoteCallback","quoteAnswer","isQuoteTimeout","clearTimeout","quoteTimeoutId","closeLot","selectedCloseLot","allowedCloseLot_Buy_LimitOrStop","allowedCloseLot_Buy_LimitAndStop","allowedCloseLot_Buy_Limit","allowedCloseLot_Buy_Stop","allowedCloseLot_Sell_LimitOrStop","allowedCloseLot_Sell_LimitAndStop","allowedCloseLot_Sell_Limit","allowedCloseLot_Sell_Stop","allowedCloseLot_LimitOrStop","allowedCloseLot_LimitAndStop","allowedCloseLot_Limit","allowedCloseLot_Stop","canClose","allowClose","AllowClose","pendingLimitClosedLot","pendingStopClosedLot","limitClosedLot","pendingLimitAvgPrice","stopClosedLot","pendingStopAvgPrice","ocopendingClosedLot","useLimitPrice","useStopPrice","closeOrder","enableInterest","lifeTime","PriceValidTime","isSptReconfirm","IsSptReconfirm","sptReconfirmDuration","SptReconfirmDuration","ExceptionEnquiryOutTime","dqPriceCountDownTimeoutId","userCode","instrumentCode","allowOrderingNotify","AllowOrderingNotify","file","fileId","url","FormData","append","axios","post","then","res","errorMessage","msg","catch","BaseView","React","Component","constructor","props","super","css","path","hash","isTitle","isPad","getTheme","themeName","getModuleCss","cssFileName","baseCss","require","goto","globalData","prevLocation","onRoutePathChange","history","goBack","onClose","go","withRouter","componentDidMount","fullScreen","render","backButtonVisible","appCss","moduleCss","logoUrl","logo","alt","src","className","titleStyle","backgroundColor","color","zIndex","uiConfig","getUIConfig","titleBar","position","showBorderBottom","borderBottomColor","borderBottomWidth","mainPane","navBar","goBackArrow","onClick","handleGoBack","CaretLeftFilled","navBarTitle","showCompanyName","titlekey","moreButton","bottomGap","onGobackClick","QuotationItem","onPaneClick","accountQuotePolicyId","clickedQuotation","onMarketInfoClick","stopPropagation","cancelBubble","defaultCss","colorStyle","quotationRiseColor","quotationRiseForeColor","quotationFallColor","quotationFallForeColor","priceTrend","borderWidth","margin","tradePolicy","footTitle1","footTitle2","footText1","footText2","closeElement","PrevBid","PrevAsk","priceChangeNet","High","AskHigh","Low","AskLow","colSpan","quotationItemCode","quotationItemTime","width","quotationItemBidTitle","quotationItemBid","quotationItemFoot1","CaretDownOutlined","quotationItemFoot2","highlightColor","height","quotationView","onSubComponentLoad","onQuotationClick","items","subCompanyLocale","containerStyle","showSubCompanyName","padQuotationContainer","quotationContainer","TitleBarView","systemSetting","OrganizationName","subCompanyPane","subCompanyContent","overflow","quotationItem","Select","currentDate","modalVisible","onChange","setState","onDateInputClicked","onCalendarChange","onModalOk","onModalCancel","expireTypeOptions","padding","Modal","modal","closable","centered","afterClose","document","body","visible","onCancel","onOk","Calendar","fullscreen","onSelect","TransactionError","getLotSettings","target","spinStep","OpenMultiplier","CloseMultiplier","RateLotMultiplier","maxLot","calculatedMaxLot","minLot","MinOpen","MinClose","RateLotMin","defaultLot","DefaultLot","RateDefaultLot","PhysicalLotDecimal","getMovePipsSettings","dqMaxMove","PlaceConfirmView","isModalVisible","isVisible","onOkClicked","handleCancel","isConfirmed","transactionError","formatOrderCodes","codes","buttonFooter","footer","instrumentCurrency","orderDiv","firstOrder","openCloseKey","orderPhase","timeTitle","timeValue","orderCodes","lotSettings","Cancel","orderTypeKey","contentRow","contentRowLabel","contentRowText","tran1","priceTitleKey","UnitId","priceUnit","Weight","Unit","downPaymentPercent","cancelReason","phaseString","cancelReasonRow","getCancelMessage","getTransactionErrorMessage","submitButton","closeButton","fullWidthStyle","InputNumberComponent","inputBox","createRef","isChanged","onDecrease","event","setModalValueOnly","disabled","modalValue","notifyChange","settings","onIncrease","onTextClick","focus","onValueChange","onSliderValueChange","activeElement","onBlur","validate","attachment","onModalClear","footPane","footTextBox","ref","onFocus","select","disallowClear","Button","footCancelButton","footOkButton","mainClass","mainPanePad","disabledColor","hideSpinButton","decreaseButton","lotInputTextBox","placeHolder","increaseButton","onMouseDown","minValue","maxValue","sliderButton","slider","Slider","v","placingInstalmentDetailView","getRows","getRow","instalmentRow","instalmentDetailPeriod","instalmentDetailCurrency","instalmentDetailPrincipal","instalmentDetailInterest","instalmentDetailAmount","onSubmitButtonClick","onSubmitClick","prePaymentAmount","IsDownPayAsFirstPay","instalmentPane","paddingBottom","onTitleGobackClick","border","bottom","errorColor","placingInstalmentView","initSelectOptions","isInit","allowedInstalmentTypes","physicalInstalmentTypeSelectOptions","recalculateRateTypes","frequences","frequencesOptions","localeCompare","setPeriods","periods","periodOptions","instalmentPolicyDetails","refreshAdministrationFee","forceUpdate","isConstructor","setSelectOptions","setStateProp","propValue","prop","getStateValue","onInstalmentOptionChange","option","onFrequenceChange","onRecalculateRateTypeChange","onPeriodChange","setPlacingData","onNextButtonClick","onInstalmentDetailButtonClick","onCloseButtonClick","onBackgroundPaneClick","display","borderTop","marginTop","instalmentRowCol1","instalmentRowCol2","instalmentRowCol2Text","PlacingInstalmentDetailView","getPendingPriceSetting","basePrice","limitOrStop","isDone","pendingPrice","acceptLmtVariation","AcceptLmtVariation","AcceptIfDoneVariation","pricingPolicyDetail","Numerator","OrderVariationFactor","SubViewType","SaveLotCookey","SavePipsCookey","savedLot","savedPips","subViewType","instalmentDetailButtonVisible","saveLot","savePips","paymentForms","subComponents","setPaymentOptions","comp","orderingNotifyId","lotInput","pipsInput","doneLimitPriceInput","doneStopPriceInput","onCloseOrderClick","beforeSubmitClick","canShortSell","text","allowedNewTradeSides","AllowedNewTradeSides","AllowAddNewPosition","onSwitchFullScreen","answer","QuoteLot","submit","confirmDialogVisible","startSpotTradedPromptUIKeepSeconds","EnquiryOutTime","quote","spotTradedPromptUIKeepSeconds","SpotTradedPromptUIKeepSeconds","AnswerLot","trans","transactionsBeforSubmit","onSubmit","fastTradeChecked","placeTransaction","isConfirmOkClicked","place","onConfirmCancel","onConfirmClosed","onConfirmOk","onExpireSelectViewChange","selectedPaymentForm","allowedPaymentForm","paymentSelectOptions","onPaymentOptionChange","onInstalmentButtonClick","onClosePaneClick","onOrderTypeChange","pipsSettings","limtPriceSetting","stopPriceSetting","canPlacePendingOrder","submitButtonClass","buyColor","sellColor","bottomButtonRow","row","marginLeft","normalButton","grayBackground","clickedPrice","fontSize","lineHeight","submitText","closeBuyLot","closeSellLot","submitButtonStyle","borderRadius","closePaneButtonStyle","marginRight","float","borderStyle","closePaneButtonClass","defaultBorderColor","closePaneButton","CloseOutlined","rowLabel","Radio","Group","placePaneMainTitle","lotComponent","enableFastTrade","EnableFastTrade","PlacingInstalmentView","padPlacePaneMain","placePaneMain","placePaneMainHeader","placePaneMainBody","maxHeight","overflowX","overflowY","rowInput","rowRightText","Checkbox","ExpireSelectView","expireSelect","EllipsisOutlined","submitButtonPane","defaultColor","fastTradeNoConfirmCheckbox","hasOpenOrder","limitPriceDoneLimit","limitPriceDoneStop","stopPriceDoneLimit","stopPriceDoneStop","paymentOptions","isOcoChecked","isOcoEnabled","isSubmitEnabled","onInputChange","limitPriceSetting","limitPriceDoneLimitSetting","limitPriceDoneStopSetting","stopPriceDoneLimitSetting","stopPriceDoneStopSetting","canPlaceLimit","AllowNewLimitStopSameTime","canPlaceStop","canPlaceDqOrder","defaultButtonColor","pendingLotPane","pendingLotPaneLabel","pendingLotPaneSelectOrder","pendingLotPaneLabel2","pendingLotPaneInput","pendingLotPaneCheckbox","pendingLimitPane","limitRow","limitRowLabel","limitRowInput","limitRowCheckbox","WorkingListItem","onItemClick","orderDetailViewType","hasPips","showCommission","enableRebate","padOrderItemRow","padOrderItemPhase","padOrderItemTime","padOrderItemAccount","padOrderItemInstrument","padOrderItemLot","padOrderItemPips","padOrderItemOpenClose","padOrderItemBuySell","padOrderItemSetPrice","padOrderItemExecutePrice","padOrderItemType","padOrderItemTradePL","padOrderItemComm","padOrderItemRebate","padOrderItemLevy","padOrderItemRemark","orderItemRow","orderItemTitleBacground","orderItemBuySell","orderItemTime","orderItemLot","orderItemPrice","orderItemOpenClose","orderItemPhase","phaseClassName","getWorkingListPhaseClassName","commission","levy","rebate","Remark","WorkingListItemComponent","onClearAllClick","onMainPaneClick","orderItems","showRebate","padMainPane","mainTitle","titleClearAllButton","titleCloseButton","reverse","pendingOrderItemRow","pendingOrderItemBuy","pendingOrderItemSell","pendingOrderItemCol","InventoryItemView","onInventoryClick","disableClick","onDeliveryButtonClick","physicalHelper","onRepaymentButtonClick","onCloseOrderButtonClick","setDeliveryLot","deliveryQuantity","onDeliveryLotChange","onCheckboxChange","getInprocessStatusText","columnProps","showInOpenPosition","canRepayment","advancePayment","AdvancePayment","unPaid","showInDelivery","avaiableMaxLot","rowCss","orderTitleBackground","checkboxStyle","whiteSpace","tradingDetail","padOrderRow","showDeliveryColumn","padOrderItemDelivery","padOrderItemClose","showInstalmentColumn","padOrderItemInstalment","showRepaymentColumn","padOrderItemRepayment","padOrderItemCode","padOrderItemWeight","padOrderItemRefPrice","padOrderItemMarketValue","padOrderItemPledge","padOrderItemFloat","padOrderItemUnpaid","padOrderItemValueAsMargin","padOrderItemDiscount","weight","background","ShoppingCartOutlined","PoweroffOutlined","FileTextOutlined","RollbackOutlined","negativeNumber","titleCss","orderRow","orderItemCheckbox","orderItemWeight","orderItemUnit","orderItemMarketValue","InventoryInstrumentTitleView","itemsVisible","onToggleClapseClick","totalQuantity","averagePrice","totalValue","totalMarketValue","borderBottomStyle","foldArrow","CaretRightOutlined","deliveryCss","padItemGroupAccount","padItemGroupUnit","padItemGroupCurrency","inventoryItemView","inventoryInstrumentView","deliveryCallback","isMarketClose","padView","itemsDisplay","inventoryInstrumentTitleViewWithRouter","refreshButton","refreshGroup","physiclHelper","onItemCheckboxChange","onPartialItemCheckboxChange","inventoryClicked","isFullPaid","fullPaidCheckedCount","partialPaidCheckedCount","instalmentCheckedCount","onSelectAllCheckboxChange","instrumentId","inventories","InventoryInstrumentView","fullPaidOrderViews","partialPaidOrderViews","mainPaneCss","placingViewTitle","inventoryFullPaidPane","paddingRight","inventoryPartialPaidPane","DeliveryInProcessView","orderViews","DeliveryInProcessItemView","padInprocessRow","padInprocessCode","padInprocessAccount","padInprocessInstrument","padInprocessTime","padInprocessWeight","padInprocessUnit","padInprocessStatus","RequireQuantity","inprocessRow","inprocessCode","inprocessWeight","inprocessUnit","inprocessStatus","inprocessTime","ViewType","SettingType","actionType","ChartType","timeFormater","timeFormat","timeFormaterWithMs","timeParser","timeParse","DataRangeType","GetDataCycleString","chartType","ret","Minute1","Minute5","Minute15","Minute30","Hour1","Hour2","Hour3","Hour4","Hour5","Hour6","Hour7","Hour8","Daily","Weekly","Monthly","CurrentRangeTypes","CurrentPeriodBeginTime","FixPeriodBeginTime","_instrumentId","_instrumentCode","_instrumentDescription","_quotePolicyId","_chartType","_commService","_model","_lastbarUpdater","_dataBufferAccessor","_dataRange","Unlimited","getSpecificRangeBeginTime","rangeType","typeName","subtract","chartDataSource","newId","x","instrumentDescription","newType","OnChartTypeChanged","dataRange","service","newModel","modelRef","GetSystemTime","st","GetInitChartData","recordCount","momt","_isValid","GetMoreChartData","GetLastBars","from","to","OnRealPrice","bid","ask","onRealPrice","OnChartDataNotify","chartData","GetFixPeriodData","GetRangeBegintTime","Month1","beginTimeDict","BeginGetFixPeriodData","GetChartFirstTradeDay","done","dates","Today","ThisWeek","ThisMonth","ThisQuarter","ThisYear","fail","err","CurrentDay","getFixPeriodBeginTimes","dict","Day2","day2BeginTime","Day3","day3BeginTime","Day4","day4BeginTime","Day5","day5BeginTime","Day10","day10BeginTime","Day15","day15BeginTime","Day30","day30BeginTime","Day45","day45BeginTime","Day60","day60BeginTime","Day90","day90BeginTime","Day120","day120BeginTime","Day180","day180BeginTime","registerLastbarUpdateCallback","listenerId","lastbar","registerCallback","unregisterLastbarUpdateCallback","unregisterCallback","registerDataBufferAccessor","accessor","getDataFromBuffer","_dataSource","_lastbar","_timeoutId","_lagFixingCount","_inLagFixing","_callbacks","lastbarUpdater","updateLastBar","bar","getChartLeadingSpan","lastBarTime","lastTime","setTime","laggingCheck","resetLagFixingState","chartLeadingSpan","startTimerWithRandDelay","datas","datasGot","interval","intMax","dataSource","open","high","low","volume","cycleBeingTime","cycleEndTime","priceTime","SD_DefaultOptions","sourcePath","windowSize","multiplier","sd","base","baseIndicator","underlyingAlgorithm","options","calculator","sma_","sma","sd_calc","slidingWindow","accumulator","lastSmaValue","sum","sqrt","sourceDatas","zip","undefinedLength","newOptions","sd_calculator","mergedAlgorithm","merge","algorithm","datum","indicator","rebind","linearRegression","pSource","Periods","Y","X","N","q1","q2","q3","XSum","YSum","XSquaredSum","YSquaredSum","XYSum","Slope","Intercept","Forecast","RSquared","Record","RecordCount","Position","Field1","Field2","Field3","Field4","pos","VIDYA_DefaultOptions","R2Scale","VIDYA","results","previousValue","R2Scaled","record","VIDYA_calculator","AO_DefaultOptions","Aroon","up","down","highestHigh","lowestLow","highPeriod","lowPeriod","os","Aroon_calculator","ToolTipText","PureComponent","rest","defaultProps","fontFamily","ToolTipTSpanLabel","fill","AroonTooltip","renderSVG","moreProps","_displayValuesFor","_ref","_ref2","fontWeight","yAccessor","displayFormat","origin","originProp","label","displayInit","displayValuesFor","appearance","labelFill","chartConfig","fullData","currentItem","aroon","functor","stroke","transform","upLIne","downLine","GenericChartComponent","clip","svgDraw","drawOn","_","CV_DefaultOptions","rateOfChange","cv","HL","start","ma1","ma2","HLma","source","average","cv_calculator","CMO_DefaultOptions","cmo","today","yesterday","upSum","downSum","cmo_calculator","convertNaN","OHLCData_sma","CCI_DefaultOptions","cci","meanDeviation","count","tp","tpsma","cci_calculator","DPO_DefaultOptions","dpo","dpo_ma","dpo_calculator","FCO_DefaultOptions","fco","fH","fL","fH1","fH2","fH3","fH4","fL1","fL2","fL3","fL4","fco_calculator","MO_DefaultOptions","mo","mo_calculator","PO_DefaultOptions","longCycle","shortCycle","po","LongMA","ShortMA","po_calculator","RO_DefaultOptions","Levels","ro","rsMA","Level","ro_calculator","TRIX_DefaultOptions","TRIX","emafunc","ema","emafunc2","EMA","value2","TRIX_calculator","tr","undefinedValue","prev","trueRangeAlgorithm","UO_DefaultOptions","Cycle1","Cycle2","Cycle3","uo","Start","TL","BP","TR","BPSum1","BPSum2","BPSum3","TRSum1","TRSum2","TRSum3","VHF_DefaultOptions","vhf","HCP","LCP","Sum","Abs","vhf_calculator","wad","TRH","TRL","wad_calculator","WR_DefaultOptions","wr","HH","LL","wr_calculator","SI_DefaultOptions","LimitMoveValue","si_calculator","si","Cy","Ct","Oy","Ot","Ht","Lt","K","R","A","B","C","siBuilder","initialData","auxHeight","axisProps","_settings$args$get","timeDisplayFormat","lineSettings","entries","yLabel","Chart","yExtents","XAxis","YAxis","MouseCoordinateX","LineSeries","strokeStyle","SingleValueTooltip","yDisplayFormat","valueFill","asi","RawSI","asi_calculator","hmlBuilder","hml_calculator","hml","LRRS_DefaultOptions","lrrs","lrrs_calculator","LRS_DefaultOptions","lrs","lrs_calculator","MI_DefaultOptions","mi","rtart","reriod","ema1","ema2","val1","val2","mi_calculator","PI_DefaultOptions","pi","firstPirce","pi_calculator","PROC_DefaultOptions","proc","prevPrice","proc_calculator","BBSeries","yAccessorForTop","_d$bb","bb","top","yAccessorForBottom","_d$bb2","yAccessorForMiddle","_d$bb3","middle","BB_DefaultOptions","movingAverageType","mediansma","temp","bb_calculator","bbBuilder","_settings$args$get2","elements","bbc","caculate_bb","strokes","line","MASeries","yAccessorForMa1","yAccessorForMa2","yAccessorForMa3","ma3","CurrentCoordinate","fillStyle","maBuilder","_args$get","_args$get2","_args$get3","wss","caculate_ma","size","sarBuilder","sar","calc","caculate_sar","accelerationFactor","maxAccelerationFactor","falling","rising","SARSeries","MAE_DefaultOptions","mae","avg","lower","upper","mae_calc","mae_calculator","MAESeries","yAccessorForUpper","_d$mae","yAccessorForLower","_d$mae2","yAccessorForScaledLower","scale","_d$mae3","rgb","hex","HEXtoRGB","AreaOnlySeries","WWS_DefaultOptions","wws","prevWWS","curr","wws_calculator","nanoid","customAlphabet","createMainIndicators","each","pair","maeBuilder","wwsBuilder","createAuxIndicator","auxElement","indicatorName","_settings$args$get3","MACDOptions","fast","signal","slow","macdAppearance","divergence","macd","zero","macdCalculator","MACDSeries","MACDTooltip","macdBuilder","RsiDefaultOptions","rsi","RSISeries","insideThreshold","outsideThreshold","RSITooltip","textFill","rsiBuilder","FullStochasticOscillator","kWindowSize","dWindowSize","stochasticOscillator","sto","StochasticSeries","kLine","dLine","StochasticTooltip","stoBuilder","ATRDefaultOptions","atr","atrBuilder","sdBuilder","VIDYABuilder","upstroke","downstroke","upAccesssor","AroonBuilder","yAccesssor","AroonOscillatorBuilder","cvBuilder","cmoBuilder","cciBuilder","dpoBuilder","fcoBuilder","moBuilder","poBuilder","roBuilder","TRIXBuilder","trBuilder","uoBuilder","vhfBuilder","wadBuilder","wrBuilder","asiBuilder","lrrsBuilder","lrsBuilder","miBuilder","piBuilder","procBuilder","hasAux","TvChartStyleProperties","getTvChartStyleProperties","symbol","has","set","TvChartConfigs","getTvChartConfigs","ChartConfigs","getChartConfigs","generalSettings","riseBarColor","fallBarColor","indictorsSettings","configId","mainIndictorsSettings","auxIndicatorSettings","EventDispatcher","barIndex","onPanEnd","plotData","xAccessor","startIndex","endIndex","onGetMoreData","onMouseMove","idx","onCurrentBarChanged","getForeColor","theme","bullColor","bearColor","ZoomHelper","_props$eventBus","_props$eventBus2","_props$eventBus3","zoomRangeStack","beginZoomIn","isInZoomIn","zoomInStateChanged","stopZoomIn","beginBarIndex","xValue","_this$props$eventBus","zoomIn","eventBus","emit","beginY","mouseXY","drawOnCanvas","ctx","pointer","helper","xScale","centerX","context","barWidth","mouseY","ratio","originX","left","originY","setTransform","translate","beginPath","pos1","pos2","rect","restore","pointWidth","show","last","first","xAxisZoom","domain","round","newStart","newEnd","pushOldRange","lastRange","foo","interpolateNumber","right","setInterval","clearInterval","zoomOut","cx","zoomMultiplier","gotRange","pop","invert","on","canvasDraw","contextTypes","PropTypes","isRequired","MOUSEMOVE","MOUSEUP","TOUCHMOVE","TOUCHEND","ChartSplitter","touchCurrentY","handleTouchStart","touches","screenY","win","defaultView","handleTouchMove","handleTouchEnd","newY","movementY","onResize","handleMouseDown","buttons","resize","endResize","_this$props$height","find","lineY","foreColor","pointerEvents","x1","y1","x2","y2","opacity","cursor","onTouchStart","coordinate","fitToText","rectWidth","font","textBaseline","measureText","edge","displayCoordinate","orient","edgeAt","hideLine","lineStrokeDasharray","lineStroke","strokeWidth","arrowWidth","rectHeight","rectRadius","dx","coordinateBase","edgeXRect","edgeYRect","edgeXText","edgeYText","dy","textAnchor","strokeDasharray","isDefined","dashArray","getStrokeDasharrayCanvas","setLineDash","lineWidth","moveTo","lineTo","halfHeight","closePath","roundRect","fillText","radius","quadraticCurveTo","BaEdgeIndicator","y_ask","itemType","getEdge","edgeType","yAxisPad","fullWidth","yScale","yValue","edgeX","edgeClip","canvasToDraw","getAxisCanvas","lineOpacity","noop","strokeOpacity","MASettings","d3Map","BBSettings","SARSettings","MACDSettings","RSISettings","STOSettings","k","ATRSettings","DefaultSetings","main","MA","BB","SAR","MAE","WWS","aux","MACD","RSI","STO","ATR","SD","AN","AO","ao","CV","CMO","CCI","DPO","FCO","MO","PO","RO","UO","VHF","WAD","WR","SI","ASI","HML","LRRS","LRS","MI","PI","PROC","ChartContext","createContext","reducer","newIndicatorSettings","newConfig","isMain","indiName","AddIndicator","indName","GetDefaultSettings","RemoveIndicator","ChangeArg","clear","ChangeLineColor","lineName","ReplaceSettings","ChangeBarColor","FrameContext","leftDomainBasedZoomAnchor","ChartCore","onDrawComplete","newChannels","enableInteractiveObject","channels_1","xScaleProvider","discontinuousTimeScaleProviderBuilder","inputDateAccessor","inZoomIn","newAuxHeight","chartHeight","candleChartExtents","yEdgeIndicator","openCloseColor","_this$props$theme","_this$props$xExtents","pricesDisplayFormat","mainIndicatorsElements","calculatedData","gridLinesStrokeWidth","tickStrokeStyle","tickLabelFill","gridLinesStrokeStyle","getThemedAxisProps","auxIndicatorElement","isShowXAxisLabel","displayXAccessor","xExtents","ChartCanvas","clamp","seriesName","zoomAnchor","useCrossHairStyleCursor","showGridLines","showTickLabel","tickFormat","CandlestickSeries","wickStroke","MouseCoordinateY","Consumer","CrossHairCursor","ChartCoreWrap","withSize","minHeight","withDeviceRatio","withOHLCData","childRef","commandDispatcher","OriginalComponent","pendingCalls","_rangeType","instanceId","isLoadingData","getMoreData","onChartTypeChanged","OnPeriodRangeChanged","onPeriodRangeChanged","resolution","ChartTypeToResolution","lastBar","setResolution","newBartime","componentWillUnmount","cancel","requestServerData","beginTimeString","searchFunc","bisector","newData","slice","requestFixPeriodData","methodName","handleFixPeriodDataResult","finally","moreData","_this$state$data","onLoadingData","showBusy","Space","LoadingOutlined","BBTooltip","_settings$lineSetting","_settings$lineSetting2","_settings$lineSetting3","currentBarData","tooltipLabel","t_color","m_color","b_color","wrap","MATooltip","lineDesc","SARTooltip","l_color","MAETooltip","u_color","WWSTooltip","changeFormat","displayTexts","l","na","ohlcFormat","percentFormat","BaseTooltip","change","getChartColor","_Fragment","ChartTooltip","indicatorSettings","myRef","tooltips","barData","setBarData","useState","setData","expanded","setExpanded","tooltip","Col","iconStyle","transition","changeExpendState","onTouchEnd","viewBox","ohlc","NumericInput","newvalue","Input","placeholder","maxLength","ColorPicker","isPickerShown","setisPickerShown","showPicker","bodyStyle","SwatchesPicker","onChangeComplete","handleColorChanged","onColorChanged","CheckableTag","Tag","allMainIndicators","allAuxIndicators","IndicatorSelector","i18n","useTranslation","dispatch","useContext","settingType","setSettingType","MainIndicator","settingItem","AuxIndicator","currentSettingItem","setCurrentSettingItem","onIndicatorSelectionChange","empty","setting","onBarColorChanged","infoName","cols","arg","span","onIndiArgChanged","paddingTop","Row","justify","isAux","General","currentSetting","hidden","tag","gutter","Divider","orientation","align","ChartView","useRef","isSymbolChanged","useReducer","isFullScreen","setFullScreen","setisLoadingData","isLoading","dataBridgeRef","dataBridge","ChartMain","CoreRef","Core","priceDecimals","waterMarkColor","copyright","chartIndex","company","setisModalVisible","addIndicator","useEffect","Provider","flex","barDatas","Draggable","bounds","handleClose","mobile","disabled_features","enabled_features","container","library_path","locale","widgetbar","watchlist","watchlist_settings","default_symbols","overrides","studies_overrides","trading_customization","brokerConfig","configFlags","autosize","debug","time_frames","client_id","user_id","charts_storage_api_version","favorites","intervals","chartTypes","_id","_ready","_readyHandlers","_onWindowResize","_autoResizeChart","datafeed","_options","preset","loading_screen","_create","onChartReady","call","headerReady","_innerWindowLoaded","_innerWindow","onGrayedObjectClicked","_doWhenInnerApiLoaded","onShortcut","_doWhenInnerWindowLoaded","createShortcutAction","subscribe","unsubscribe","chart","_innerAPI","getLanguage","setSymbol","changeSymbol","removeEventListener","_iFrame","parentNode","removeChild","closePopupsAndDialogs","selectLineTool","selectedLineTool","saveChart","loadChart","json","extendedData","getSavedCharts","loadChartFromServer","saveChartToServer","removeChartFromServer","onContextMenu","createButton","createDropdown","showNoticeDialog","showConfirmDialog","showLoadChartDialog","showSaveAsChartDialog","symbolInterval","getSymbolInterval","mainSeriesPriceFormatter","getIntervals","getStudiesList","getStudyInputs","addCustomCSSFile","applyOverrides","applyStudiesOverrides","watchList","news","activeChart","chartsCount","layout","setLayout","layoutName","changeTheme","takeScreenshot","lockAllDrawingTools","hideAllDrawingTools","drawOnAllCharts","magnetEnabled","magnetMode","undoRedoState","setIntervalLinkingEnabled","setTimeFrame","symbolSync","intervalSync","crosshairSync","timeSync","getAllFeatures","clearUndoHistory","undo","redo","startFullscreen","exitFullscreen","takeClientScreenshot","navigationButtonsVisibility","getNavigationButtonsVisibility","paneButtonsVisibility","getPaneButtonsVisibility","dateFormat","getDateFormat","tradingViewApi","contentWindow","doWhenApiIsReady","innerHeight","_render","container_id","getElementById","innerHTML","querySelector","addEventListener","Promise","widgetReady","initializationFinished","customFormatters","custom_formatters","brokerFactory","broker_factory","studiesOverrides","tradingCustomization","disabledFeatures","enabledFeatures","broker_config","restConfig","numeric_formatting","rss_news_feed","newsProvider","news_provider","loadLastChart","load_last_chart","saveLoadAdapter","save_load_adapter","settingsAdapter","settings_adapter","getCustomIndicators","custom_indicators_getter","additionalSymbolInfoFields","additional_symbol_info_fields","headerWidgetButtonsMode","header_widget_buttons_mode","customTranslateFunction","custom_translate_function","symbolSearchComplete","symbol_search_complete","contextMenu","context_menu","settingsOverrides","settings_overrides","saved_data","chartContent","saved_data_meta_info","chartContentExtendedData","encodeURIComponent","timeframe","toolbar_bg","studies_access","stringify","drawings_access","charts_storage_url","custom_css_url","custom_font_family","auto_save_delay","snapshot_url","study_count_limit","symbol_search_request_delay","compare_symbols","time_scale","TradingView","version","parseDatetime","convertData","chartDataParser","quotaions","ChartQuotaions","periodBeginTimeParser","instrumentPeriodBeginTimeParser","FixPeriodBeginTimes","OrigBarToTvBar","origBar","chartDate_orig2tv","timeOffSet","_firstbar","_resolution","_pricescale","_intraday_multipliers","_resolutions","dataApi","setDataSource","onReady","cb","supported_resolutions","searchSymbols","userInput","exchange","symbolType","onResultReadyCallback","resolveSymbol","symbolName","onResolve","onError","extension","symbol_stub","description","session","ticker","minmov","pricescale","has_intraday","intraday_multipliers","volume_precision","data_status","has_daily","has_weekly_and_monthly","full_name","listed_exchange","has_no_volume","getBars","symbolInfo","periodParams","onResult","fromTime","toTime","firstDataRequest","bars","resultParser","chartDataParserForTv","noData","dataCount","firstbar","firstbarTime","lastbarTime","subscribeBars","onTick","listenerGuid","onResetCacheNeededCallback","updateCallback","unsubscribeBars","subscriberUID","calculateHistoryDepth","resolutionBack","intervalBack","getMarks","startDate","endDate","onDataCallback","getTimeScaleMarks","serverTime","valueOf","TvChartContainer","_tvWidget","_symbol","_theme","_dark_overrides","_isInSwitchSymbol","_isChartPropertyApplied","_dataapi","executeActionById","showChartProperties","createChart","componentDidUpdate","_this$_tvWidget","removeChartWidget","applyTheme","properties","_this$_tvWidget2","getSeries","chartStyleProperties","onFullSceen","containerId","_this$_tvWidget3","tvtheme","applyChartProperty","barProperty","setChartStyleProperties","_this$props$language","_this$props$chartData","dataapi","lang","widgetOptions","libraryPath","chartsStorageUrl","chartsStorageApiVersion","clientId","userId","tvWidget","widget","addIndicatorForTv","Scrollbar","_props$theme","scrollbar","scrollX","setscrollX","rightButtonLeft","setrightButtonLeft","scrolEnd","setscrolEnd","mouseOver","setmouseOver","useResizeDetector","slide","totalspace","scrollWidth","scrollLeft","scrollSpace","clientWidth","realspace","animate","realStep","adj","floor","offsetWidth","onMouseOver","onMouseLeave","scrollCheck","widthAdjust","onResized","sizeCheckCount","bottonClass","LeftOutlined","onMouseEnter","onScroll","RightOutlined","HeaderBar","t_m","t_h","t_d","minutes","hours","days","activeColor","baseStype","paddingLeft","normalStyle","activeStyle","prevSubIndexes","zoomin_finish","isZoomInChecked","ChartTypeToUIPeriodArgs","subIndex","getPeriods","periodtype","onDataRangeChanged","onPeriodTypeClick","oldType","notifyPeriodChanged","onChangePeriod","newIndex","getPeriodUnitage","unitage","getDataRanges","ranges","rangeText","Month2","Month3","Month6","Year1","Year2","Year3","Year5","Year10","Year4","Year20","getStyle","isselected","onFullScreen","OnZoomOut","OnZoomInTagClicked","ischecked","_this$props$eventBus2","getPalletPos","getI18n","palletLen","spacingWidth","changeViewType","vt","viewType","setViewType","notifyChartCount","setChartCount","_this$props$theme2","istv","tradingview","cbBaseStyle","orgButtonStyle","tvButtonStyle","threewin","onewin","twowin","multiChartMenu","Menu","Item","FundViewOutlined","SettingOutlined","ZoomOutOutlined","ZoomInOutlined","bordered","showMultiChartMemu","Dropdown","overlay","showTV","original","getLanguageForTV","ChartFrame","_props$viewType","mitt","_isShowTv","isShowTv","showTradingView","defaultViewType","issplitterdragging","showmcMenu","tvContainerId","paddingProp","onChartFullSceen","onChartExitFullScreen","PlacePanelType","PlacingDqViewComponent","withTranslation","PlacingDqView","placeView","showPlacePanel","createChartElement","getchartConfig","configs","chartElement","subTopic","PubSub","notifyRealTimeQuotation","onPlaceMaskClick","onBuySellButtonClick","onWorkListButtonClick","bottomView","subViewFullScreen","PlacingPendingView","WorkingListView","PendingListView","InventoryView","mainPanePriceView","mainPanePriceTitle","Narrative","pricePane","instrumentTitle","instrumentTitleLeftBlock","mainPrice","priceFootPane","priceFootLeftTitle","priceFootLeftContent","Open","AskOpen","priceFootRightTitle","priceFootRightContent","subWindowTabPane","subWindowTabButton","chartPane","placeButtonPane","placePane","backgroundMask","placePaneMainContainer","SpecificationItem","onCheckBoxChange","specificationDetail","onQuantityChange","newQuantity","beforeQuantityChange","quantity","chargeBasis","showCharge","specificRow","specificRowCheck","specificRowName","specificRowCharge","specificRowWeight","specificRowInput","productName","ENG","CHT","CHS","Premium","deliveryView","businessDayAdd","momentDate","clone","add","remaining","day","init","sortSpecification","addressOptions","address","Address","specificationItems","specifications","deliverySpecification","specification","recalculateSpecification","beforeSpecificationQuantityChange","onSpecificationQuantityChange","deliveryBeginDate","DeliveryTimeBeginDay","deliveryEndDate","DeliveryTimeEndDay","deliveryProps","initDeliveryLot","selectedAddressId","deliveryDate","avialabeQuantity","onOpenOrderCheckboxChange","recalcSpecificationCharge","openOrderView","remainderQuantity","totalSpecifiedQuantity","selectedCount","remainsQuantity","deliveryLotResult","getDeliveryLotResult","sender","totalSpecifiedQuantityWithoutSender","onAddressChange","checkRequireLot","requireLot","PhysicalMinDeliveryQuantity","PhysicalDeliveryIncremental","specificationQuantity","DeliveryRequestSpecification","totalDeliveryLot","lotResult","deliveryRequestId","orderRelation","DeliveryRequestId","DeliveryQuantity","RequireLot","Charge","ChargeCurrencyId","SubmitorId","DeliveryAddressId","DeliveryRequestSpecifications","applyDelivery","specifactionDescription","getSubmitSpecifactionDescription","onDeliveryDateClick","modalDate","getDeliveryDisabledDate","isoWeekday","specificationWeight","summaryPane","deliveryRow","deliveryRowLabel","deliveryRowInput","openOrderPane","specificationPane","deliverySubmitButton","disabledDate","selectOrder","onPlacingButtonClick","buttonPane","canPlaceLimitOrder","detailMainPane","inventoryDetailRow","inventoryDetailRowLabel","inventoryDetailRowContent","ValueAsMargin","inventoryDetailButtonRow","endsWith","contractButton","paymentAmount","terminateFee","feeFactor","ContractTerminateFee","terminateXml","instalmentPayoff","instalmentPayoffCallback","inventoryDetailButton","instalmentPeriodView","InstalmentDetails","InstalmentDetail","PaidDateTime","PaymentDateTimeOnPlan","Principal","Interest","DebitInterest","dueDate","paidDate","penaltyInterest","instalmentPeriodRow","instalmentDetailDuedate","instalmentDetailPaidDate","instalmentDetailPenaltyInterest","instalmentDetailStatus","instalmentPeriodPane","instalmentSumView","paidPeriod","paidPrincipal","unpaidPrincipal","paidInterest","unpaidInterest","debitInterest","overDueNotPaid","overDuePaid","detailPane","InstalmentPeriodView","MultiChartView","chartDataSources","chartcount","splitHooks","onDragStarted","onSaveSizes","sizes","unsubscribeQuotation","getInstrumentId","getChartConfig","createChartDataSource","instrumentInfo","newTopic","ds","SplitPane","initialSizes","hooks","PadChartView","placingType","iinfo","CloseOrderItemView","onOrderSelectChanged","onSelectionLotChange","itemStyle","orderSelectionPaneTitleBackground","orderSelectionPanePad","orderSelectionPane","orderSelectionCheckBox","orderSelectionPaneItemCommon","orderSelectionBuySell","orderSelectionExecutePrice","orderSelectionExecuteTradeDay","orderSelectionTradePLFloat","orderSelectionLotPad","paymentTitle","inputCompnent","orderSelectionLot","buySellButtonClass","tradePLFloatClass","selectedBuyLot","selectedSellLot","refreshOpenOrderLot","orderChanged","unSelectSimultaneousBuySellClose","isReset","buyLotCanSelect","sellLotCanSelect","lastBuyLot","buyOrderingNotifyId","lastSellLot","sellOrderingNotifyId","canSelectOrder","IsSimultaneousBuySellClose","urlGoBack","adjustLotByQuote","adjustLotTo","newLot","orderId","remainLot","contract","buyOrderItemViews","sellOrderItemViews","totalFloating","askBidPrice","pendingOptionsVisibleStyle","dqOptionsVisibleStyle","selectAllSummaryBuy","selectAllSummarySell","mainPaneClass","closeOrderPane","orderPane","class","buySellOrdersPane","checkAllBuyPane","checkAllSellPane","instrumentTradePLFloatClass","floatPaneStyle","lotSum","floatPane","padSumPane","borderTopWidth","borderTopStyle","justifyContent","isValidInput","limitRowButton","instrumentPane","instrumentLeftPane","instrumentLeftPrice","instrumentRightPane","orderItemsPane","submitPanePlaceHolder","submitPane","dqRowLabel","limitRowFastTradeCheckBox","OpenPositionOrderView","onOrderClick","showTime","OpenPositionShowTime","padOrderLimitOrStop","padOrderLiquid","padOrderCode","padOrderAccount","padOrderInstrument","padOrderExecuteTime","padOrderLot","padOrderBuySell","padOrderExecutePrice","padOrderRefPrice","padOrderTradePLFloat","padOrderInterest","padOrderCommission","orderItemFloat","buySellClass","refPrice","disableClass","interestRatePolicy","padOrderInterestRate","ClockCircleOutlined","EstimateCloseCommission","OpenPositionOrderRouteView","openPositionGroupView","collapsed","displayStyle","isPositionSum","openLotBuy","openLotSell","priceColorStyle","floatClass","instrumentRightValue","netPosition","buyClass","positionSumLot","sellClass","netClass","isUniqueClient","IsUniqueClient","positionSumPane","positionSumInstrument","positionSumPrice","positionSumFloat","instrumentGroupPane","physicalInventories","handleInstrumentClick","instrumentLeft","arrowDown","CaretDownFilled","instrumentRight","instrumentRightTitle","OpenPositionSumView","orderGroups","OpenPositionGroupView","openPositionView","queryType","onQueryClick","orderQueryParam","param","queryOrder","queryCallback","viewData_OrderQueryResultView","OrderQueryResults","OrderQueryResult","group","InstrumentCode","tradePLSum","openLotSum","closeLotSum","instrumentSelect","daySelect","queryPane","queryRow","paramTitle","paramValue","op","queryButton","ordersGroupedByInstrument","instrumentCodes","i1","todayOrders","orderItemType","orderItemTradePL","OrderId","orderPaneTitle","ShortSellView","ShortSellItemView","rowStyle","padOrderItemUnit","padOrderItemCurrency","PadStockView","tabType","getStockTab","tabTitle","padRadioPane","padInventoryContainer","padInventorySubContainer","viewData_TodayExecuteView","Spin","MessageItemView","isRead","IsRead","timeStyle","rowClassName","padMessageItemMainPane","messageItemMainPane","timeClassName","padMessageItemTime","messageItemTime","secondaryTextColor","titleClassName","padMessageItemTitle","messageItemTitle","PublishTime","messageView","messageMainPane","messageDetailView","onDeleteButtonClick","deleteMessage","revers","updateMessageState","nextDisabled","prevDisabled","messageDetailMainPane","messageItemContent","Content","toolbar","nextButton","prevButton","deleteButton","exitButton","LogItemView","logView","ColorPickerView","colors","setProp","PriceAlertItemView","priceAlertRow","onEditClick","rowModify","FormOutlined","rowItem","rowCondition","rowPrice","rowExpirationTime","ExpirationTime","rowColorPad","rowColor","Color","priceAlertView","onAddClick","selectedPriceAlert","itemTableStyle","borderRightWidth","borderRightStyle","addButtonStyle","priceAlertEditView","selectedInstrumentId","getDefaultPrice","lastPrice","point","onSaveClick","originAlert","newPriceAlert","QuotePolicyID","hasSamePrice","MaxAlertPricePerInstrument","onDeleteClick","getDisabledDate","originPriceAlert","inputClass","editRowInput","mainPainClass","canSave","saveButtonClass","addButton","editRow","editRowLabel","DatePicker","dateString","CloseOrderViewComponent","CloseOrderView","PadBottomTabView","bottomTabType","prevBottomTabType","canPlaceOrderSpot","canPlaceOrderMarket","canPlaceOrderLimit","onPlacingDqViewCloseSubmit","closeOrderView","onPlacingPendingViewCloseSubmit","placingDqView","placingPendingView","getBottomWorkingTab","OpenPositionView","OrderQueryView","OrderQueryResultView","onGoBackButtonClick","tradingView","padTradingPane","bodyBackgroundColor","padTradingPlacing","padTradingClosing","MessageView","LogView","PriceAlertView","tab","getItemClass","padBottomTabTitleItem","bottomActiveItem","isPlacingView","showLog","ShowLog","isNoShowAccountStatus","IsNoShowAccountStatus","borderLeftWidth","borderLeftStyle","padBottomTabTitle","buyButtonColor","sellButtonColor","buyTextStyle","priceStyle","subContainerStyle","padBottomContainer","buySellButtonContainer","buySellButton","verticalAlignment","padBottomSubContainer","userName","password","savePassword","onRef","switchLanguage","getLanguageName","languageName","zh_tw","zh_cn","en","getLoginLanguage","getRegistAccountLanguage","onUserNameChanged","onPasswordChanged","onLoginButtonClick","iAgreeChecked","login","onLoginSuccess","gotoFrameWindow","onIAgreeClick","contentType","modelDialogWidth","contentStyle","okText","cancelText","cancelCallback","hideTitle","registerAccountUrl","forgotPasswordUrl","toUpperCase","addToHomeScreenUrl","frameLinkButtonStyle","textDecoration","isHideAgreement","loginButtonClass","loginButton","Translation","languageButton","changeLanguage","icon","inputRow","loginInput","autoComplete","alignItems","dangerouslySetInnerHTML","__html","block","BalanceView","isLoggedIn","getFundRows","Alias","balanceVisible","balance","getFundRow","necessaryVisible","floatingVisible","floating","notvalueinterestVisible","notvalued","equityVisible","netAssetVisible","usableVisible","pedgeVisible","paidAmountVisible","unPaidAmountVisible","togglePropName","currencyCode","rightArrow","amountClass","fundContent","fundRowContainer","toggleProp","fundTitle","fundCurrency","getAlertLevelPropmpt","hasNonePhysicalInstruments","hasInterestPLNotValued","necessaryTitle","fundComponent","balancePane","enableFund","IsEmployee","AllowSalesPayment","AllowSalesDeposit","userInfoComponent","userInfoContainer","userAvatarIcon","accountCode","accountName","logoutButton","onLogoutClick","loginButtonComponent","loginButtonContainer","functionCommonIcon","onLoginClick","functionRowContainer","functionButtonContainer","onOpenOrderClick","openOrderIcon","functionButton","onTodayExecuteClick","todayExecuteIcon","onTodayPendingClick","todayPendingIcon","onOrderQueryClick","orderQueryIcon","onMarginTitleClick","marginTitleIcon","onReportTitleClick","reportTitleIcon","pushState","replaceState","onLogout","gotoView","todayExecuteCallback","oldPassword","oldPasswordMask","newPasswordMask","confirmPasswordMask","newPassword","confirmPassword","updatePassword2","loginID","MaxPasswordReserveCount","isSucceed","isActiveAccount","IsActivateAccount","logout","errorCode","isInputValid","oldErrorClass","newErrorClass","isPasswordExpired","IsPasswordExpired","inputStyle","EyeInvisibleOutlined","EyeOutlined","marginBottom","contractRow","contractRowLabel","contractRowContent","contractButtonRow","viewData_PendingOrderView","getData","orderDate","onPendingOrderClick","pendingOrderDetailView","onModifyOrderClick","onCancelOrderClick","onWorkingListClearClick","canClearWorkingList","getToolbar","modifyVisible","modifyDisabled","cancelVisible","isWorkingList","isTradingAllowed","priceDoneLimit","priceDoneStop","ChangePlacedOrderAllowed","priceRows","orderTypeText","ocoOrder","openOrderInfo","OpenOrderExecutePrice","OpenOrderExecuteTime","remark","getCancelReasonLanguageKey","physicalRows","pendingOrderModifyView","ocoChecked","setStatePrice","setStateDonePrice","ifDoneChecked","limitPriceOfOrder","limitPriceDoneLimitOfOrder","limitPriceDoneStopOfOrder","stopPriceOfOrder","stopPriceDoneLimitOfOrder","stopPriceDoneStopOfOrder","ifOrder","prefix","setLimitStopPriceProp","setDonePriceProp","priceSetting","pricePropName","doneLimitPricePropName","doneStopPricePropName","ifOrderLimitOrStop","doneOrderLimitOrStop","ifPricePropName","donePricePropName","getRowComponent","stateProp","checkBoxContent","modifyRowContentInput","checkboxDisabled","rowClass","modifyRowContent","limitPriceChecked","stopPriceChecked","limitPriceDoneLimitChecked","limitPriceDoneStopChecked","stopPriceDoneLimitChecked","stopPriceDoneStopChecked","scrollTo","buttonClass","modifyRowButton","modifyRow","modifyRowLabel","getClass","menuItem","ishidden","deliveryRequestOptions","viewAsPdf","reportType","dayType","currentTradeDay","tradeDayBegin","tradeDayEnd","reportGroupDetail","ReportGroupDetails","ReportGroupDetail","p","getMaxTradeDayEnd","maxTradeDayEnd","getBeginDisabledDate","IsTraderReportDeadline","getEndDisabledDate","month","endOf","getDayTypeClassName","paramDatePeriod","reportParameter","CompanyName","PathName","Language","ReportType","TradeDayBeginString","TradeDayEndString","AccountIds","headers","reportParameterId","SetReportParameterResult","reportViewAsPdf","formatParam","openInNewWindow","iframeUrl","iframeTitle","isSubmitEnable","Switch","padResultMainPane","resultMainPane","onLoad","loaded","scrolling","frameBorder","lastDays","onPaymentInstructionClick","getAccountBanksApproved","accountBanks","PISettings","DisableDeposit","onDepositPinOkClick","parameter","depositPin","DepositPin","onOnlineTransferOkClicked","selectedOnlineTransferParameterId","modalContent","onOnlineTransferOptionClicked","onOnlineTransferClick","onlineTransferOptions","direction","onEDDAClick","WFFundUrl","createTokenByWFService","token","TokenResult","otp_id","enablePI","EnablePI","enableOnlineTransfer","useEDDA","UseEDDA","CustomerId","selectedBankAccountId","selectedBankAccount","bankAccountSelect","currencySelect","selectedCurrencyId","BankAccounts","BankAccount","bankAccount","bankName","BankName","banks","BankId","AccountOpener","AccountBankNo","CustomerEmail","bankProp","getBankStateProp","accountOpener","accountBankNo","getBankName","bankAddress","getBankAddress","swiftCode","SwiftCode","onResetClick","AllowEditBankAccountInTrader","targetAmount","onTextBoxChange","refreshExchangeAmount","AccountBankBCId","accountCurrency","bankCurrency","isSubmitClicked","isEWallet","AccountBankType","paymentInstruction","refNo","bank","BankProvinceId","province","provinces","BankCityId","city","cities","BankAddress","onAddBankClick","countries","getAccountBankReferenceData","ReferenceDatas","Countries","Country","country","contentClass","fundRowContent","currencyClass","fundRowInput3","bankClass","fundRowInput2","disableDeposit","canSubmit","asterisk","mobileBottomStyle","canEditBank","BankAccountOnly","canAddBank","maxCustomerBankNo","MaxCustomerBankNo","addBankButtonClass","selectedCurrency","hideDepositBankInfo","HideDepositBankInfo","hideDepositExchangeCurrency","HideDepositExchangeCurrency","tartCurrency","paymentMainPane","paymentContentPane","fundRow","fundRowTitle","verticalAlign","readOnly","rows","PaymentInstructionRemark","fundRowSubmitPane","OnlineTransferSubView","submitClicked","payCurrency","PayCurrencyId","traderMarginRequest","payAmount","onSumbitClick","maxPaymAmount","MaxPayAmount","minPayAmount","MinPayAmount","onPayAmountChange","beforeSubmit","selectedFile","onSelectFile","files","imageUrl","createObjectURL","onPayAmountLostFocus","maxPayAmount","suffix","onCopyButtonClick","copyToClipboard","navigator","clipboard","writeText","clipboardData","queryCommandSupported","textarea","textContent","execCommand","paycurrency","dropDownClass","fundRowInput","imageStyle","maxWidth","payType","isValidAmount","onlineTransferPane","AccountName","AccountNumber","BankSwiftCode","PayAddress","fundRowImage","QRCode","accept","subView","BankAccountItemComponent","bankShortTitle","deleteConfirmTitle","apply","bankAccountItemPane","bankAccountItemButton","canEdit","bankAccountItemColumn1","bankAccountItemColumn2","bankAccountView","bankAccountItems","onAddEditClick","bankMainPane","bankSubmitPane","bankAccountEditView","isCustomizedBankDefaultValue","IsCustomizedBankDefaultValue","CnyCurrencyId","countrySelect","countryId","isModified","bankAccountType","bankAccountOpen","selectedCountryId","CountryId","selectedCountry","selectedProvinceId","selectedCityId","selectedBankId","bankNo","subBranch","SubBranch","AccountBankProp","idType","IdType","idNo","IdNo","onCountryChanged","bankData","Provinces","Province","Banks","Bank","Cities","City","ProvinceCities","ProvinceCity","ProvinceId","CityIds","cityId","refreshProvince","onProvinceChanged","refreshCity","onCityChanged","provinceSelect","bankSelect","provinceId","citySelect","getBankAccountTypeLanguage","BankCardPhotoId","UploadBankCard","isValidBankAddress","isValidBankName","bankAccountEditRow","titleClass","bankAccountEditTitle","bankAccountEditInput","BankCardPhoto","onBankAccountClick","DisableUpdateBankAccount","onSelectAccountClick","onSelectInstrumentClick","getInstrumentForSetting","settingInstruments","onClientRegistrationClick","clientRegistration","ClientRegistration","enableBankAccount","IexCrmLevel","SalesId","enableSetTheme","enableOwnerReg","EnableOwnerRegistration","accountsForSelect","onChangeThemeClick","styleRow","styleRowTitle","styleRowValue","statusButton","onCloseClicked","cooKey","configKey","InstrumentItemSortView","onCheckChanged","Sequence","activeInstrumentId","instrumentItemMainPane","instrumentItemTitle","instrumentItemSortArrow","onMoveInstrumentClick","settingSortIndex","ArrowUpOutlined","ArrowDownOutlined","InstrumentItemView","instrumentItemCheckbox","InstrumentGroupView","instrumentGroupMainPane","instrumentGroupTitle","revertColor","GroupName","instrumentSettingView","ids","updateInstrumentSetting","selectInstrumentCompnent","sortInstrumentCompnent","groups","instrumentSettingMainPane","borderBottom","borderRight","selectedColor","accountSelectOptions","getAccountsForSetting","warning","selectedAccountId","accountIds","updateAccountsSetting","clientRegistrationView","reportDate","originState","lastName","LastName","titleOrganizationName","cPIDCardNO","CPIDCardNO","documentType","DocumentType","Email","tel","Phone","birthDate","BirthDate","contactPerson","ContactPerson","cPAddress","CPAddress","cPNationality","CPNationality","postcode","Postcode","iDCardPicture","IDCardPicture","iDCardPicture2","IDCardPicture2","fileId1","fileId2","callClientRegistration","selectedFile1","selectedFile2","image1Url","image2Url","onSelectFile1","onSelectFile2","clientRegTitleRow","titleRowClass","titleValueClass","clientRegTitleValue","minWidth","wholePart","numeratorString","$2","denominatorString","$3","denominatorValue","roundValue","intValue","decimalValue","power10","processQuotations","instrumentSequenceDict","quotationStringArray","Quotation","qIndex","quotationProps","Volume","TotalVolume","quotepolicyMappingValue","quotePolicyGuidMappings","pricingPolicy","AskValue","BidValue","prevBidValue","CaculateChangeWithDenominator","negtiveMark","priceTrendTimeoutHandler","setUpdateFlag","subs","getSubscriptions","publish","processLoginData","processInitData","initData","instrumentCodeDict","scrapInstruments","GuidMappingValue","QuotePolicyGuidMappings","Mapping","mapping","Currencies","Currency","DetailKey","TradeDay","LastDay","Quotations","ScrapInstruments","ScrapInstrument","scrapInstrument","ServerData","InitializeData","SystemSetting","processTradingData","ConfigExt","jsonData","sites","hostname","__uisettings","companyName","mainView","chartView","showInstrumentTitle","_invokeId","_methodName","_done","_finally","_resultParser","_state","_instanceId","_fail","_isCanceled","_finished","asyncResult","invokeId","fn","processResult","iserror","success","convertedData","finished","Comm","hubName","messageCallback","connection","handleMessage","invokeMethods","invokeCallbacks","onNotifReceived","randomId","fetch","initConfig","err1","testLogin","hubProxy","defaultConfig","configExt","demoLanguage","demoLoginUser","demoPassword","demoPath","validPathName","initHub","heartBeatTimoutId","stop","hubUrl","signalR","createHubProxy","onSend","jsonp","signalRId","user","connectionId","test_on","test_loginafter","raiseServerError","invoke","errorCallback","getInvokeMethodId","getSettingData","getInitData","getTradingData","accountIdArray","args1","heartbeat","accountID","instrumentID","serverError","loginId","isAuto","appType","descriptionInfo","keepLoginInfo","ignoreError","getServerDateTime","tranXml","transactionXml","transactionID","messageId","accountId","isSendBankCardPhoto","AccountBanks","countryID","customerId","accountBankApprovedId","bankID","accountBankType","accountBankProp","accountBankBCID","accountBankBCName","bankProvinceID","bankCityID","applicationType","bankCardPhotoId","iDCardPictureFileId","iDCardPicture2FileId","organizationName","customerName","receive","currencyValue","beneficiaryName","bankerName","bankerAddress","remarks","thisisClien","traderLanguage","onlineTransferParameterId","payVoucherId","instrumentIDs","accountIDs","deliveryRequire","deliveryPointGroupId","getOrderInstalment","orderID","currencyID","sumSourcePaymentAmount","sumSourceTerminateFee","priceAlertRequestXml","quoteLot","bsStatus","setPriceMaxMovePips","maxPasswordReserveCount","accountCodes","getChartData","quotePolicyID","dataCycleParameter","requestType","clientMethodName","method","canOverlap","SubMenu","LoginViewComponent","LoginView","BottomBarComponent","BottomBar","DeliveryViewComponent","DeliveryView","PaymentInstructionViewComponent","PaymentInstructionView","OnlineTransferViewComponent","OnlineTransferView","ClientRegistrationViewComponent","ClientRegistrationView","onResizePaneStarted","onResizePaneFinished","routeComponent","showSpin","modalDialog","modalDialogClosable","persons","splitRef","padMainPaneRef","waitingPIMenuItem","registerInterval","updateAll","beforeUnload","needUpdate","padPlaceView","padBottomTabView","onPlacingInstalmentSubmitClick","OpenContractView","ReportView","FrameView","PendingOrderView","PendingOrderDetailView","onModalDialogCancel","PendingOrderModifyView","StyleSettingView","bottomBarComponent","loginView","PriceAlertEditView","ChangePasswordView","InstrumentSettingView","AccountSettingView","BankAccountView","BankAccountEditView","MessageDetailView","RepaymentView","InstalmentSumView","okCallback","buttonStyle","onPopMessageOk","onPopMessageCancel","QuoteAnswer","dataProcessor","Command","LoginResult","modelExtension","isActivateAccount","screen","onMenuButtonClick","menuVisible","onMenuItemClick","newWindowType","padClassName","userAgent","pc","PasswordValidDay","diff","PasswordChangeTimestamp","themeColor","quotationHeight","balanceHeight","hideBalance","popMessageFooter","borderBottomLeftRadius","borderBottomRightRadius","disableStartupQuotation","StartupQuotation","padLoginView","boxShadow","fundView","tip","Breakpoint","medium","iosMainPane","Router","Route","PlaceView","AccountBriefView","TodayExecuteView","FundView","SettingView","InventoryDetailView","QuotationView","large","padTitle","MenuOutlined","defaultSize","onDragFinished","padQuotation","padBalance","CaretUpOutlined","SplitPane2","padTrading","padInstrumentTitle","destroyOnClose","assignResource","originLanguageResource","newlanguageResource","subObject","loadResource","en2","zh_cn2","zh_tw2","chart_en","chart_cn","chart_tw","use","Backend","LanguageDetector","initReactI18next","react","useSuspense","resources","translation","fallbackLng","interpolation","escapeValue","AppComponent","App","intervalCallbacks","updateIntervalId","querySelectorAll","onpopstate","ReactDOM","BreakpointProvider"],"mappings":"0FACAA,EAAOC,QAAU,CAAC,MAAQ,gCAAgC,QAAU,kCAAkC,MAAQ,gCAAgC,OAAS,iCAAiC,OAAS,iCAAiC,WAAa,qCAAqC,gBAAkB,0CAA0C,eAAiB,yCAAyC,aAAe,uCAAuC,YAAc,sC,uryNCD9c,IAAIC,EAAM,CACT,yBAA0B,IAC1B,6BAA8B,IAC9B,mCAAoC,IACpC,uCAAwC,IACxC,gCAAiC,IACjC,qCAAsC,IACtC,mCAAoC,IACpC,+BAAgC,IAChC,kCAAmC,IACnC,oCAAqC,IACrC,4BAA6B,IAC7B,qCAAsC,IACtC,uCAAwC,IACxC,uCAAwC,IACxC,qCAAsC,IACtC,uCAAwC,IACxC,gCAAiC,IACjC,iCAAkC,IAClC,6BAA8B,IAC9B,kCAAmC,IACnC,+BAAgC,IAChC,mCAAoC,IACpC,sCAAuC,IACvC,wBAAyB,IACzB,gCAAiC,GACjC,yBAA0B,IAC1B,6BAA8B,IAC9B,mCAAoC,KAIrC,SAASC,EAAeC,GACvB,IAAIC,EAAKC,EAAsBF,GAC/B,OAAOG,EAAoBF,EAC5B,CACA,SAASC,EAAsBF,GAC9B,IAAIG,EAAoBC,EAAEN,EAAKE,GAAM,CACpC,IAAIK,EAAI,IAAIC,MAAM,uBAAyBN,EAAM,KAEjD,MADAK,EAAEE,KAAO,mBACHF,C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32B,GAAO,SACpB22B,GAAa12B,GAAI,MAGjBh/B,IAGGi2D,IAAIC,MAGJD,IAAIE,MAEJF,IAAIG,MAGJrzC,KAAK,CACJszC,MAAO,CACLC,aAAa,GAEfC,UAAW,CACTv3B,GAAI,CACFw3B,YAAax3B,IAEfD,MAAO,CACLy3B,YAAaz3B,IAEfD,MAAO,CACL03B,YAAa13B,KAGjB23B,YAAa,KACb9xD,OAAO,EACP+xD,cAAe,CACbC,aAAa,KAKJ32D,EAAI,E,OCxFnB,MAAM42D,GAAej4C,cAAkBk4C,IAEvCxmI,OAAOsuB,WAAa,CAAEm4G,kBAAmB,CAAC,GAC1CzmI,OAAOsuB,WAAWuxG,iBAAmB,SAAUniI,EAAKuM,GAChDjK,OAAOsuB,WAAWm4G,kBAAkB/oI,GAAOuM,CAC/C,EAEKjK,OAAOsuB,WAAWo4G,mBACnB1mI,OAAOsuB,WAAWo4G,iBAAmBnqE,aAAY,KAC7C9sE,OAAOwY,OAAOjI,OAAOsuB,WAAWm4G,mBAAmB5pI,SAASoN,IACxDA,GAAU,GACZ,GACH,MAGPurB,SAASmxG,iBAAiB,gBAAgB,GAAGzmI,KAAOF,OAAOC,SAASg2H,SAAW,OAC/Ej2H,OAAO4mI,WAAa,WAChB,IAAIj5G,EAAO3tB,OAAOC,SAAS2tB,KAAK59B,WAAWE,cAC3CoB,QAAQC,IAAIo8B,GACA,WAARA,GACA3tB,OAAOyuB,QAAQG,GAAG,EAE1B,EACAi4G,IAAS73G,OACL7yB,eAAC2qI,qBAAkB,CAAA5qI,SAIfC,eAACynI,IAAM,CAAA1nI,SACHC,eAACoqI,GAAY,QAQrB/wG,SAASwlD,eAAe,Q","file":"static/js/main.de3d08a6.chunk.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"modal\":\"placeconfirmview_modal__2AqH7\",\"content\":\"placeconfirmview_content__3KM91\",\"title\":\"placeconfirmview_title__tpB9D\",\"footer\":\"placeconfirmview_footer__rh0xy\",\"status\":\"placeconfirmview_status__1JrEF\",\"contentRow\":\"placeconfirmview_contentRow__nPELd\",\"contentRowLabel\":\"placeconfirmview_contentRowLabel__30IQa\",\"contentRowText\":\"placeconfirmview_contentRowText__1uDq-\",\"submitButton\":\"placeconfirmview_submitButton__6LU4S\",\"closeButton\":\"placeconfirmview_closeButton__29CEn\"};","var map = {\n\t\"./black/app.module.css\": 501,\n\t\"./black/default.module.css\": 502,\n\t\"./black/quotationview.module.css\": 503,\n\t\"./common/accountbriefview.module.css\": 504,\n\t\"./common/bottombar.module.css\": 505,\n\t\"./common/closeorderview.module.css\": 506,\n\t\"./common/deliveryview.module.css\": 507,\n\t\"./common/fundview.module.css\": 508,\n\t\"./common/inputnumber.module.css\": 509,\n\t\"./common/inventoryview.module.css\": 510,\n\t\"./common/login.module.css\": 511,\n\t\"./common/messagelognews.module.css\": 512,\n\t\"./common/openpositionview.module.css\": 513,\n\t\"./common/orderqueryresult.module.css\": 514,\n\t\"./common/orderqueryview.module.css\": 515,\n\t\"./common/pendingorderview.module.css\": 516,\n\t\"./common/placeview.module.css\": 517,\n\t\"./common/pricealert.module.css\": 518,\n\t\"./common/report.module.css\": 519,\n\t\"./common/settingview.module.css\": 520,\n\t\"./common/titlebar.module.css\": 521,\n\t\"./common/todayexecute.module.css\": 522,\n\t\"./common/workinglistview.module.css\": 523,\n\t\"./mainview.module.css\": 524,\n\t\"./placeconfirmview.module.css\": 15,\n\t\"./white/app.module.css\": 525,\n\t\"./white/default.module.css\": 526,\n\t\"./white/quotationview.module.css\": 527\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 500;","// extracted by mini-css-extract-plugin\nmodule.exports = {\"body\":\"app_body__35oq3 app_body__29tEb\",\"pc\":\"app_pc__1Oy7c\",\"themeColor\":\"app_themeColor__2YN3K\",\"logo\":\"app_logo__1iuYQ app_logo__4vZjf\",\"mainPane\":\"app_mainPane__P2TRh app_mainPane__3bUKX\",\"iosMainPane\":\"app_iosMainPane__2nrhW app_iosMainPane__2lnRh\",\"padMainPane\":\"app_padMainPane__1J4aX app_padMainPane__N0-ly\",\"padTitle\":\"app_padTitle__2QKVQ app_padTitle__28IFg\",\"padQuotation\":\"app_padQuotation__12yw- app_padQuotation__2ktj1\",\"padChart\":\"app_padChart__1yr_C app_padChart__1FNry\",\"padTrading\":\"app_padTrading__37KFW app_padTrading__2Ozwi\",\"padInstrumentTitle\":\"app_padInstrumentTitle__28E8b app_padInstrumentTitle__14vFT\",\"padBalance\":\"app_padBalance__3Inj3 app_padBalance__2O8yi\",\"padBottomContainer\":\"app_padBottomContainer__3UInH app_padBottomContainer__1tZya\",\"padBottomSubContainer\":\"app_padBottomSubContainer__3cG-z app_padBottomSubContainer__DTpil\",\"padBottomTabTitle\":\"app_padBottomTabTitle__22hXR app_padBottomTabTitle__9RsKj\",\"padBottomTabTitleItem\":\"app_padBottomTabTitleItem__2gazE app_padBottomTabTitleItem__J8Z0c\",\"padTradingPane\":\"app_padTradingPane__3DCQ2 app_padTradingPane__fUXhF\",\"padTradingPlacing\":\"app_padTradingPlacing__3dXja app_padTradingPlacing__3Ku2O\",\"padTradingClosing\":\"app_padTradingClosing__1b8Dj app_padTradingClosing__2M5CD\",\"buyColor\":\"app_buyColor__7d55p app_buyColor__3Rd_C\",\"sellColor\":\"app_sellColor__IWAaY app_sellColor__1Oejm\",\"buySellButton\":\"app_buySellButton__2T4mb app_buySellButton__1d7tU\",\"buySellButtonContainer\":\"app_buySellButtonContainer__3eR5h app_buySellButtonContainer__1vz8e\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"defaultColor\":\"default_defaultColor__2yjcz\",\"defaultBorderColor\":\"default_defaultBorderColor__15PzQ\",\"bodyBackgroundColor\":\"default_bodyBackgroundColor__20QQ4\",\"defaultButtonColor\":\"default_defaultButtonColor__1bjJI\",\"secondaryTextColor\":\"default_secondaryTextColor___k0u-\",\"revertColor\":\"default_revertColor__3_L49\",\"selectedColor\":\"default_selectedColor__1JOC_\",\"highlightColor\":\"default_highlightColor__nVJgM\",\"disabledColor\":\"default_disabledColor__2GKnT\",\"negativeNumber\":\"default_negativeNumber__1ABVa\",\"userAvatarIcon\":\"default_userAvatarIcon__3wwhk\",\"sellColor\":\"default_sellColor__1Pstq\",\"buyColor\":\"default_buyColor__3j-ro\",\"errorColor\":\"default_errorColor__1N9LV\",\"bottomActiveItem\":\"default_bottomActiveItem__IEDH-\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"quotationContainer\":\"quotationview_quotationContainer__2ychW quotationview_quotationContainer__2gQkf\",\"subCompanyPane\":\"quotationview_subCompanyPane__2TY5N quotationview_subCompanyPane__1EX34\",\"subCompanyContent\":\"quotationview_subCompanyContent__9Y-am undefined\",\"padQuotationContainer\":\"quotationview_padQuotationContainer__2Tlu2 quotationview_quotationContainer__2gQkf\",\"quotationItem\":\"quotationview_quotationItem__VSKby quotationview_quotationItem__3vrde\",\"quotationItemCode\":\"quotationview_quotationItemCode__3wq-d quotationview_quotationItemCode__3g9Ui\",\"quotationItemBlank\":\"quotationview_quotationItemBlank__3Z-rM quotationview_quotationItemBlank__sr8XY\",\"quotationItemTime\":\"quotationview_quotationItemTime__2GjO5 quotationview_quotationItemTime__1BU8J\",\"quotationItemBidTitle\":\"quotationview_quotationItemBidTitle__3WHTg quotationview_quotationItemBidTitle__1vHwL\",\"quotationItemBid\":\"quotationview_quotationItemBid__2ssLP quotationview_quotationItemBid__KuNmr\",\"quotationItemFoot1\":\"quotationview_quotationItemFoot1__M083r quotationview_quotationItemFoot1__28Zx5\",\"quotationItemFoot2\":\"quotationview_quotationItemFoot2__U8WNW quotationview_quotationItemFoot2__2C71W\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"accountbriefview_mainPane__1_2yR\",\"userInfoContainer\":\"accountbriefview_userInfoContainer__OE8a0\",\"userAvatarIcon\":\"accountbriefview_userAvatarIcon__1vkZQ\",\"accountCode\":\"accountbriefview_accountCode__1NUio\",\"accountName\":\"accountbriefview_accountName__1KVG8\",\"logoutButton\":\"accountbriefview_logoutButton__pI7dl\",\"loginButtonContainer\":\"accountbriefview_loginButtonContainer__ujM3n\",\"functionRowContainer\":\"accountbriefview_functionRowContainer__2GofD\",\"functionCommonIcon\":\"accountbriefview_functionCommonIcon__2_Iq2\",\"openOrderIcon\":\"accountbriefview_openOrderIcon__27BMV\",\"todayExecuteIcon\":\"accountbriefview_todayExecuteIcon__3gi_c\",\"todayPendingIcon\":\"accountbriefview_todayPendingIcon__1omnv\",\"orderQueryIcon\":\"accountbriefview_orderQueryIcon__2zvdK\",\"marginTitleIcon\":\"accountbriefview_marginTitleIcon__13k9F\",\"reportTitleIcon\":\"accountbriefview_reportTitleIcon__GlgA6\",\"loginButton\":\"accountbriefview_loginButton__2zMeJ\",\"functionButtonContainer\":\"accountbriefview_functionButtonContainer__e4bOR\",\"functionButton\":\"accountbriefview_functionButton__FON4A\",\"fundRowContainer\":\"accountbriefview_fundRowContainer__-vdHN\",\"borderTop\":\"accountbriefview_borderTop__P-V4d\",\"fundTitle\":\"accountbriefview_fundTitle__3jG1E\",\"fundCurrency\":\"accountbriefview_fundCurrency__7AHFf\",\"fundContent\":\"accountbriefview_fundContent__3LM2D\",\"rightArrow\":\"accountbriefview_rightArrow__33mkX\",\"balancePane\":\"accountbriefview_balancePane__1Mkz0\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"bottombar_mainPane__9Gawk\",\"menuItem\":\"bottombar_menuItem__1A2NW\",\"menuItemDisabled\":\"bottombar_menuItemDisabled__c0sxJ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"closeOrderPane\":\"closeorderview_closeOrderPane__205Vr\",\"buySellOrdersPane\":\"closeorderview_buySellOrdersPane__1U0-Y\",\"lightgreyBackground\":\"closeorderview_lightgreyBackground__2xPYh\",\"padCloseOrderPane\":\"closeorderview_padCloseOrderPane__1Xc9Z\",\"instrumentPane\":\"closeorderview_instrumentPane__xhSbh\",\"instrumentLeftPane\":\"closeorderview_instrumentLeftPane__2lqH-\",\"instrumentLeftPrice\":\"closeorderview_instrumentLeftPrice__1lmep\",\"instrumentRightPane\":\"closeorderview_instrumentRightPane__18ZnT\",\"instrumentRightTitle\":\"closeorderview_instrumentRightTitle__3kY9z\",\"instrumentRightContent\":\"closeorderview_instrumentRightContent__3yN0J\",\"orderItemsPane\":\"closeorderview_orderItemsPane__38P33\",\"orderSelectionPaneItemCommon\":\"closeorderview_orderSelectionPaneItemCommon__MlMdB\",\"orderSelectionPane\":\"closeorderview_orderSelectionPane__s_n8b\",\"orderSelectionPanePad\":\"closeorderview_orderSelectionPanePad__W8u9S\",\"orderSelectionPaneTitleBackground\":\"closeorderview_orderSelectionPaneTitleBackground__38pxB\",\"orderSelectionCheckBox\":\"closeorderview_orderSelectionCheckBox__2Nn_j\",\"orderSelectionBuySell\":\"closeorderview_orderSelectionBuySell__wr_fA\",\"orderSelectionExecutePrice\":\"closeorderview_orderSelectionExecutePrice__1EZ7L\",\"orderSelectionExecuteTradeDay\":\"closeorderview_orderSelectionExecuteTradeDay__20Qav\",\"orderSelectionTradePLFloat\":\"closeorderview_orderSelectionTradePLFloat__1MIui\",\"orderSelectionLot\":\"closeorderview_orderSelectionLot__3xOwY\",\"orderSelectionLotPad\":\"closeorderview_orderSelectionLotPad__2GaiT\",\"submitPanePlaceHolder\":\"closeorderview_submitPanePlaceHolder__2Lq9n\",\"submitPane\":\"closeorderview_submitPane__2oSUs\",\"dqSubmitButton\":\"closeorderview_dqSubmitButton___uF6v\",\"submitPaneLabel\":\"closeorderview_submitPaneLabel__2maXy\",\"submitPaneSelectSummary\":\"closeorderview_submitPaneSelectSummary__1AS0F\",\"limitRow\":\"closeorderview_limitRow__lWwIb\",\"limitRowLabel\":\"closeorderview_limitRowLabel__3_tIu\",\"limitRowInput\":\"closeorderview_limitRowInput__2fGf5\",\"limitRowButton\":\"closeorderview_limitRowButton__19VpY\",\"dqRowLabel\":\"closeorderview_dqRowLabel__hQI2U\",\"limitRowFastTradeCheckBox\":\"closeorderview_limitRowFastTradeCheckBox__7y0lI\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"deliveryview_mainPane__3XQsu\",\"summaryPane\":\"deliveryview_summaryPane__BdKag\",\"openOrderPane\":\"deliveryview_openOrderPane__3k7SB\",\"specificationPane\":\"deliveryview_specificationPane__3Twve\",\"deliveryRow\":\"deliveryview_deliveryRow__1kRd-\",\"deliveryRowLabel\":\"deliveryview_deliveryRowLabel__Bq_ie\",\"deliveryRowInput\":\"deliveryview_deliveryRowInput__1IBAl\",\"deliverySubmitButton\":\"deliveryview_deliverySubmitButton__3Lsnu\",\"specificRow\":\"deliveryview_specificRow__1NHDq\",\"specificRowCheck\":\"deliveryview_specificRowCheck__1ap87\",\"specificRowName\":\"deliveryview_specificRowName__3Csre\",\"specificRowCharge\":\"deliveryview_specificRowCharge__1l259\",\"specificRowWeight\":\"deliveryview_specificRowWeight__KlhKt\",\"specificRowInput\":\"deliveryview_specificRowInput__17MR-\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"queryPane\":\"fundview_queryPane__2e3fF\",\"queryRow\":\"fundview_queryRow__122qp\",\"paramTitle\":\"fundview_paramTitle__2kqTD\",\"paramValue\":\"fundview_paramValue__gzUQN\",\"queryButton\":\"fundview_queryButton__3KPLA\",\"rightArrow\":\"fundview_rightArrow__2r5Yo\",\"fundRow\":\"fundview_fundRow__2OfkN\",\"fundRowImage\":\"fundview_fundRowImage__3jnL3\",\"fundRowTitle\":\"fundview_fundRowTitle__1YFyC\",\"fundRowContent\":\"fundview_fundRowContent__1jy3H\",\"fundRowInput\":\"fundview_fundRowInput__18kWn\",\"fundRowInput2\":\"fundview_fundRowInput2__3Qtpx\",\"fundRowInput3\":\"fundview_fundRowInput3__2gKon\",\"fundRowSubmitPane\":\"fundview_fundRowSubmitPane__YjPwg\",\"fundRowSubmitButton\":\"fundview_fundRowSubmitButton__5RQ8h\",\"paymentMainPane\":\"fundview_paymentMainPane__VsOze\",\"paymentContentPane\":\"fundview_paymentContentPane__1YyPX\",\"bankMainPane\":\"fundview_bankMainPane__1DIYb\",\"bankAccountItemPane\":\"fundview_bankAccountItemPane__QsxpL\",\"bankAccountItemColumn1\":\"fundview_bankAccountItemColumn1__3yEe1\",\"bankAccountItemColumn2\":\"fundview_bankAccountItemColumn2__72jj2\",\"bankAccountItemButton\":\"fundview_bankAccountItemButton__28QRh\",\"bankAccountEditRow\":\"fundview_bankAccountEditRow__pOaMy\",\"clientRegTitleRow\":\"fundview_clientRegTitleRow__23rdo\",\"clientRegTitleValue\":\"fundview_clientRegTitleValue__2uxDS\",\"bankAccountEditTitle\":\"fundview_bankAccountEditTitle__3Dgpm\",\"bankAccountEditContent\":\"fundview_bankAccountEditContent__3ziap\",\"bankAccountEditInput\":\"fundview_bankAccountEditInput__PJwCj\",\"bankSubmitPane\":\"fundview_bankSubmitPane__1R8-6\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"inputnumber_mainPane__QNHlf\",\"mainPanePad\":\"inputnumber_mainPanePad__2Gzhk\",\"minValue\":\"inputnumber_minValue__3ydR6\",\"maxValue\":\"inputnumber_maxValue__1XmZ7\",\"decreaseButton\":\"inputnumber_decreaseButton__Rp-4D\",\"increaseButton\":\"inputnumber_increaseButton__tWe5l\",\"lotInputTextBox\":\"inputnumber_lotInputTextBox___JCCv\",\"sliderButton\":\"inputnumber_sliderButton__2RuUi\",\"slider\":\"inputnumber_slider__1hWRq\",\"footPane\":\"inputnumber_footPane__3T_mt\",\"footTextBox\":\"inputnumber_footTextBox__6IyKh\",\"footCancelButton\":\"inputnumber_footCancelButton__pI8YE\",\"footOkButton\":\"inputnumber_footOkButton__1g79C\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"inventoryview_mainPane__2cdHb\",\"padMainPane\":\"inventoryview_padMainPane__319TN\",\"placingViewTitle\":\"inventoryview_placingViewTitle__2mXDa\",\"orderRow\":\"inventoryview_orderRow__2Y2f6\",\"padOrderRow\":\"inventoryview_padOrderRow__3Azhy\",\"orderTitleBackground\":\"inventoryview_orderTitleBackground__2UdHv\",\"padItemGroupAccount\":\"inventoryview_padItemGroupAccount__2IjTL\",\"padItemGroupWeight\":\"inventoryview_padItemGroupWeight__KtSeM\",\"padItemGroupUnit\":\"inventoryview_padItemGroupUnit__3wdh2\",\"padItemGroupCurrency\":\"inventoryview_padItemGroupCurrency__2mMdU\",\"padItemGroupPrice\":\"inventoryview_padItemGroupPrice__Afz8I\",\"padItemGroupMarketValue\":\"inventoryview_padItemGroupMarketValue__aDvVY\",\"padOrderItemDelivery\":\"inventoryview_padOrderItemDelivery__3_djy\",\"padOrderItemClose\":\"inventoryview_padOrderItemClose__EjkXF\",\"padOrderItemRepayment\":\"inventoryview_padOrderItemRepayment__2jmRJ\",\"padOrderItemInstalment\":\"inventoryview_padOrderItemInstalment__1JB4m\",\"padOrderItemCode\":\"inventoryview_padOrderItemCode__Gi1DN\",\"padOrderItemAccount\":\"inventoryview_padOrderItemAccount__1-45z\",\"padOrderItemUnit\":\"inventoryview_padOrderItemUnit__1oOye\",\"padOrderItemCurrency\":\"inventoryview_padOrderItemCurrency__3iIiK\",\"padOrderItemTime\":\"inventoryview_padOrderItemTime__2Z2Ce\",\"padOrderItemWeight\":\"inventoryview_padOrderItemWeight__3A7-P\",\"padOrderItemExecutePrice\":\"inventoryview_padOrderItemExecutePrice__1S_wv\",\"padOrderItemRefPrice\":\"inventoryview_padOrderItemRefPrice__86MPi\",\"padOrderItemMarketValue\":\"inventoryview_padOrderItemMarketValue__2Rq38\",\"padOrderItemPledge\":\"inventoryview_padOrderItemPledge__1Wqu7\",\"padOrderItemFloat\":\"inventoryview_padOrderItemFloat__39cV3\",\"padOrderItemUnpaid\":\"inventoryview_padOrderItemUnpaid__2rPzo\",\"padOrderItemValueAsMargin\":\"inventoryview_padOrderItemValueAsMargin__ldAXo\",\"padOrderItemDiscount\":\"inventoryview_padOrderItemDiscount__aG4uq\",\"orderItemCheckbox\":\"inventoryview_orderItemCheckbox__3Y-CF\",\"orderItemTime\":\"inventoryview_orderItemTime__2Dmfw\",\"orderItemWeight\":\"inventoryview_orderItemWeight__Cte9F\",\"orderItemUnit\":\"inventoryview_orderItemUnit__2lbh4\",\"orderItemPrice\":\"inventoryview_orderItemPrice__3s8qQ\",\"orderItemMarketValue\":\"inventoryview_orderItemMarketValue__1dErW\",\"inventoryPartialPaidPane\":\"inventoryview_inventoryPartialPaidPane__3s0BV\",\"inventoryFullPaidPane\":\"inventoryview_inventoryFullPaidPane__pEgFz\",\"inprocessRow\":\"inventoryview_inprocessRow__ysMmx\",\"inprocessCode\":\"inventoryview_inprocessCode__EkaqP\",\"inprocessWeight\":\"inventoryview_inprocessWeight__3AWd0\",\"inprocessUnit\":\"inventoryview_inprocessUnit__1EaDu\",\"inprocessStatus\":\"inventoryview_inprocessStatus__1oaMC\",\"inprocessTime\":\"inventoryview_inprocessTime__27iQt\",\"padInprocessRow\":\"inventoryview_padInprocessRow__2ozXR\",\"padInprocessCode\":\"inventoryview_padInprocessCode__3p98i\",\"padInprocessAccount\":\"inventoryview_padInprocessAccount__3VyRo\",\"padInprocessInstrument\":\"inventoryview_padInprocessInstrument__jemjY\",\"padInprocessWeight\":\"inventoryview_padInprocessWeight__21gBg\",\"padInprocessUnit\":\"inventoryview_padInprocessUnit__VFNI0\",\"padInprocessStatus\":\"inventoryview_padInprocessStatus__2AwG8\",\"padInprocessTime\":\"inventoryview_padInprocessTime__2O1lv\",\"detailMainPane\":\"inventoryview_detailMainPane__2F0-9\",\"inventoryDetailRow\":\"inventoryview_inventoryDetailRow__qSh8c\",\"inventoryDetailRowLabel\":\"inventoryview_inventoryDetailRowLabel__2w6eD\",\"inventoryDetailRowContent\":\"inventoryview_inventoryDetailRowContent__2LT2C\",\"inventoryDetailButtonRow\":\"inventoryview_inventoryDetailButtonRow__fkKS8\",\"inventoryDetailButton\":\"inventoryview_inventoryDetailButton__1gJms\",\"instalmentPeriodPane\":\"inventoryview_instalmentPeriodPane__3XiWT\",\"instalmentPeriodRow\":\"inventoryview_instalmentPeriodRow__2-ixm\",\"instalmentDetailPeriod\":\"inventoryview_instalmentDetailPeriod__9ojn1\",\"instalmentDetailDuedate\":\"inventoryview_instalmentDetailDuedate__1lBpi\",\"instalmentDetailCurrency\":\"inventoryview_instalmentDetailCurrency__1c5u8\",\"instalmentDetailPrincipal\":\"inventoryview_instalmentDetailPrincipal__1yFx_\",\"instalmentDetailInterest\":\"inventoryview_instalmentDetailInterest__1Lkyj\",\"instalmentDetailAmount\":\"inventoryview_instalmentDetailAmount__30qYy\",\"instalmentDetailPaidDate\":\"inventoryview_instalmentDetailPaidDate__1Ay-u\",\"instalmentDetailPenalty\":\"inventoryview_instalmentDetailPenalty__3P8tm\",\"instalmentDetailPenaltyInterest\":\"inventoryview_instalmentDetailPenaltyInterest__3YT2X\",\"instalmentDetailStatus\":\"inventoryview_instalmentDetailStatus__3_UEK\",\"padInventoryContainer\":\"inventoryview_padInventoryContainer__3WqrQ\",\"padRadioPane\":\"inventoryview_padRadioPane__2Esam\",\"padInventorySubContainer\":\"inventoryview_padInventorySubContainer__15OWY\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"login_mainPane__2MMfx\",\"languageButton\":\"login_languageButton__2p_FL\",\"loginInput\":\"login_loginInput__2WsLk\",\"inputRow\":\"login_inputRow__WU7TR\",\"serverButton\":\"login_serverButton__YJ1OR\",\"loginButton\":\"login_loginButton__lGd5f\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"messageMainPane\":\"messagelognews_messageMainPane__BcRGA\",\"messageItemMainPane\":\"messagelognews_messageItemMainPane__3u0x8\",\"padMessageItemMainPane\":\"messagelognews_padMessageItemMainPane__1MMpp\",\"messageItemTime\":\"messagelognews_messageItemTime__1mPii\",\"messageItemTitle\":\"messagelognews_messageItemTitle__3uSVT\",\"messageDetailMainPane\":\"messagelognews_messageDetailMainPane__2iDcS\",\"padMessageItemTime\":\"messagelognews_padMessageItemTime__2lJHw\",\"padMessageItemTitle\":\"messagelognews_padMessageItemTitle__RDNBk\",\"messageItemContent\":\"messagelognews_messageItemContent__nhnUn\",\"toolbar\":\"messagelognews_toolbar__O9SBR\",\"nextButton\":\"messagelognews_nextButton__2eXw3\",\"prevButton\":\"messagelognews_prevButton__3KKB3\",\"deleteButton\":\"messagelognews_deleteButton__1FRoq\",\"exitButton\":\"messagelognews_exitButton__2A2ZG\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"openpositionview_mainPane__2_yWW\",\"instrumentGroupPane\":\"openpositionview_instrumentGroupPane__3TVNX\",\"instrumentLeft\":\"openpositionview_instrumentLeft__1dpG3\",\"arrowDown\":\"openpositionview_arrowDown__2e7WQ\",\"instrumentCode\":\"openpositionview_instrumentCode__2FK8T\",\"instrumentLeftPrice\":\"openpositionview_instrumentLeftPrice__3Xa7n\",\"instrumentRight\":\"openpositionview_instrumentRight__3SHkN\",\"instrumentRightTitle\":\"openpositionview_instrumentRightTitle__zJFlw\",\"instrumentRightValue\":\"openpositionview_instrumentRightValue__3waQU\",\"orderRow\":\"openpositionview_orderRow__ZDLD4\",\"orderTitleBackground\":\"openpositionview_orderTitleBackground__1TW83\",\"orderItemDiv\":\"openpositionview_orderItemDiv__2ekC6\",\"orderItemBuySell\":\"openpositionview_orderItemBuySell__38Bd0\",\"orderItemPrice\":\"openpositionview_orderItemPrice__1XuST\",\"orderItemTime\":\"openpositionview_orderItemTime__1g6hk\",\"orderItemLot\":\"openpositionview_orderItemLot__2xPG-\",\"orderItemFloat\":\"openpositionview_orderItemFloat__2VAPM\",\"padOrderRow\":\"openpositionview_padOrderRow__Jqtnl\",\"padOrderLimitOrStop\":\"openpositionview_padOrderLimitOrStop__39e5u\",\"padOrderLiquid\":\"openpositionview_padOrderLiquid__1kI_m\",\"padOrderCode\":\"openpositionview_padOrderCode__2TXsm\",\"padOrderAccount\":\"openpositionview_padOrderAccount__3Crdp\",\"padOrderInstrument\":\"openpositionview_padOrderInstrument__3Q61T\",\"padOrderExecuteTime\":\"openpositionview_padOrderExecuteTime__YQ9DZ\",\"padOrderLot\":\"openpositionview_padOrderLot__2iqHO\",\"padOrderBuySell\":\"openpositionview_padOrderBuySell__3le_i\",\"padOrderExecutePrice\":\"openpositionview_padOrderExecutePrice___COot\",\"padOrderLimitOrder\":\"openpositionview_padOrderLimitOrder__3z-RT\",\"padOrderStopOrder\":\"openpositionview_padOrderStopOrder__7sNtl\",\"padOrderRefPrice\":\"openpositionview_padOrderRefPrice__2IRjs\",\"padOrderTradePLFloat\":\"openpositionview_padOrderTradePLFloat__1jKtT\",\"padOrderInterestPLFloat\":\"openpositionview_padOrderInterestPLFloat__1Htwo\",\"padOrderInterest\":\"openpositionview_padOrderInterest__3RAQI\",\"padOrderStorage\":\"openpositionview_padOrderStorage__20uMs\",\"padOrderCommission\":\"openpositionview_padOrderCommission___RLmW\",\"padOrderLevy\":\"openpositionview_padOrderLevy__2oBPY\",\"padOrderInterestRate\":\"openpositionview_padOrderInterestRate__1ESOy\",\"padOrderCurrencyRate\":\"openpositionview_padOrderCurrencyRate__1XM2n\",\"contractRow\":\"openpositionview_contractRow__2N0nS\",\"contractRowLabel\":\"openpositionview_contractRowLabel__2qz2t\",\"contractRowContent\":\"openpositionview_contractRowContent__3XuoW\",\"contractButtonRow\":\"openpositionview_contractButtonRow__1xlr4\",\"contractButton\":\"openpositionview_contractButton__RGNiJ\",\"positionSumPane\":\"openpositionview_positionSumPane__b_BRU\",\"positionSumInstrument\":\"openpositionview_positionSumInstrument__2XqZ9\",\"positionSumLot\":\"openpositionview_positionSumLot__1lyjg\",\"positionSumPrice\":\"openpositionview_positionSumPrice__2TqMu\",\"positionSumFloat\":\"openpositionview_positionSumFloat__3-s7L\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"orderqueryresult_mainPane__EOEzk\",\"orderPane\":\"orderqueryresult_orderPane__2qJRz\",\"instrumentTitle\":\"orderqueryresult_instrumentTitle__Hf_zt\",\"orderPaneTitle\":\"orderqueryresult_orderPaneTitle__1vVph\",\"orderItemDiv\":\"orderqueryresult_orderItemDiv__2tfd0\",\"orderItemPhase\":\"orderqueryresult_orderItemPhase__2hjAh\",\"orderItemTime\":\"orderqueryresult_orderItemTime__mfhMG\",\"orderItemType\":\"orderqueryresult_orderItemType__k6Opy\",\"orderItemPrice\":\"orderqueryresult_orderItemPrice__ShouX\",\"orderItemLot\":\"orderqueryresult_orderItemLot__36WDJ\",\"orderItemTradePL\":\"orderqueryresult_orderItemTradePL__3F_xf\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"queryPane\":\"orderqueryview_queryPane__2bAjc\",\"queryRow\":\"orderqueryview_queryRow__2Yao3\",\"paramTitle\":\"orderqueryview_paramTitle__2n1JN\",\"paramValue\":\"orderqueryview_paramValue__3w2SO\",\"input\":\"orderqueryview_input__2mHFA\",\"queryButton\":\"orderqueryview_queryButton__222us\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"pendingorderview_mainPane__1cHTA\",\"orderPane\":\"pendingorderview_orderPane__2gqll\",\"instrumentTitle\":\"pendingorderview_instrumentTitle__RSljN\",\"orderPaneTitle\":\"pendingorderview_orderPaneTitle__1U23h\",\"orderItemDiv\":\"pendingorderview_orderItemDiv__12nSJ\",\"orderItemBuySell\":\"pendingorderview_orderItemBuySell__38Ikr\",\"orderItemOpenClose\":\"pendingorderview_orderItemOpenClose__2-SnV\",\"orderItemLot\":\"pendingorderview_orderItemLot__-LODD\",\"orderItemPrice\":\"pendingorderview_orderItemPrice__2-5pZ\",\"orderItemTime\":\"pendingorderview_orderItemTime__u9Zef\",\"orderItemPhase\":\"pendingorderview_orderItemPhase__17A2p\",\"modifyRow\":\"pendingorderview_modifyRow__2NElO\",\"modifyRowLabel\":\"pendingorderview_modifyRowLabel__2GclY\",\"modifyRowContent\":\"pendingorderview_modifyRowContent__3VdjJ\",\"modifyRowContentInput\":\"pendingorderview_modifyRowContentInput__Ay8LG\",\"modifyRowButton\":\"pendingorderview_modifyRowButton__2D3R_\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"placeview_mainPane__F3861\",\"padMainPane\":\"placeview_padMainPane__1gocQ\",\"mainPanePriceView\":\"placeview_mainPanePriceView__5HNgM\",\"mainPanePriceTitle\":\"placeview_mainPanePriceTitle__3YMPU\",\"instrumentTitle\":\"placeview_instrumentTitle__2EM6t\",\"instrumentTitleLeftBlock\":\"placeview_instrumentTitleLeftBlock__D1GMK\",\"pricePane\":\"placeview_pricePane__DLeDD\",\"chartPane\":\"placeview_chartPane__3e3AZ\",\"placeButtonPane\":\"placeview_placeButtonPane__13AFZ\",\"mainPrice\":\"placeview_mainPrice__Hiobg\",\"priceFootPane\":\"placeview_priceFootPane__2b_tF\",\"priceFootLeftTitle\":\"placeview_priceFootLeftTitle__23CI-\",\"priceFootLeftContent\":\"placeview_priceFootLeftContent__jt07x\",\"priceFootRightTitle\":\"placeview_priceFootRightTitle__1uVbC\",\"priceFootRightContent\":\"placeview_priceFootRightContent__2kKLY\",\"priceFootButton\":\"placeview_priceFootButton__A24SB\",\"subWindowTabPane\":\"placeview_subWindowTabPane__2mBtI\",\"subWindowTabButton\":\"placeview_subWindowTabButton__1rBqP\",\"placePane\":\"placeview_placePane__1xBV0\",\"backgroundMask\":\"placeview_backgroundMask__tQQQq\",\"placePaneMainContainer\":\"placeview_placePaneMainContainer__xRd6T\",\"placePaneMain\":\"placeview_placePaneMain__xIgkX\",\"padPlacePaneMain\":\"placeview_padPlacePaneMain__2Vrf3\",\"placePaneMainBody\":\"placeview_placePaneMainBody__3u2tP\",\"submitButtonPane\":\"placeview_submitButtonPane__75Now\",\"placePaneMainHeader\":\"placeview_placePaneMainHeader__1Clba\",\"placePaneMainTitle\":\"placeview_placePaneMainTitle__JMNTx\",\"row\":\"placeview_row__2rVXi\",\"rowLabel\":\"placeview_rowLabel__1VSqb\",\"rowInput\":\"placeview_rowInput__SFIXE\",\"rowRightText\":\"placeview_rowRightText__uQ7ki\",\"fastTradeNoConfirm\":\"placeview_fastTradeNoConfirm__Y8S3p\",\"fastTradeNoConfirmCheckbox\":\"placeview_fastTradeNoConfirmCheckbox__1kDBE\",\"buyColor\":\"placeview_buyColor__28n9W\",\"sellColor\":\"placeview_sellColor__BE9gr\",\"normalButton\":\"placeview_normalButton__35xsa\",\"grayBackground\":\"placeview_grayBackground__yUHwM\",\"pendingLotPane\":\"placeview_pendingLotPane__vykGm\",\"pendingLotPaneLabel\":\"placeview_pendingLotPaneLabel__EfJTT\",\"pendingLotPaneSelectOrder\":\"placeview_pendingLotPaneSelectOrder__1eJG9\",\"pendingLotPaneLabel2\":\"placeview_pendingLotPaneLabel2__1d1mU\",\"pendingLotPaneInput\":\"placeview_pendingLotPaneInput__11MgK\",\"pendingLotPaneCheckbox\":\"placeview_pendingLotPaneCheckbox__2oenh\",\"pendingLimitPane\":\"placeview_pendingLimitPane__17Fol\",\"limitRow\":\"placeview_limitRow__3-9oU\",\"pendingOrderTypeLabel\":\"placeview_pendingOrderTypeLabel__1NeVK\",\"limitRowLabel\":\"placeview_limitRowLabel__1X0uF\",\"limitRowInput\":\"placeview_limitRowInput__14UHc\",\"limitRowCheckbox\":\"placeview_limitRowCheckbox__1MXmz\",\"expireSelect\":\"placeview_expireSelect__-cy-e\",\"instalmentPane\":\"placeview_instalmentPane__2GtXa\",\"instalmentRow\":\"placeview_instalmentRow__lLgZm\",\"instalmentRowCol1\":\"placeview_instalmentRowCol1__1S21x\",\"instalmentRowCol2\":\"placeview_instalmentRowCol2__2y5lg\",\"instalmentRowCol2Text\":\"placeview_instalmentRowCol2Text__3N0h3\",\"instalmentDetailPeriod\":\"placeview_instalmentDetailPeriod__2VBns\",\"instalmentDetailCurrency\":\"placeview_instalmentDetailCurrency__5FiaX\",\"instalmentDetailPrincipal\":\"placeview_instalmentDetailPrincipal__3GX9T\",\"instalmentDetailInterest\":\"placeview_instalmentDetailInterest__-ndF_\",\"instalmentDetailAmount\":\"placeview_instalmentDetailAmount__1LSlx\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"pricealert_mainPane__Lh4yL\",\"priceAlertRow\":\"pricealert_priceAlertRow__2G1Vr\",\"rowModify\":\"pricealert_rowModify__E51cX\",\"rowItem\":\"pricealert_rowItem__3sDN-\",\"rowCondition\":\"pricealert_rowCondition__1avay\",\"rowPrice\":\"pricealert_rowPrice__ku__t\",\"rowExpirationTime\":\"pricealert_rowExpirationTime__3WX_d\",\"rowColor\":\"pricealert_rowColor__1Zia-\",\"rowColorPad\":\"pricealert_rowColorPad__1ot-J\",\"addButton\":\"pricealert_addButton__1c-6N\",\"editRow\":\"pricealert_editRow__3yn28\",\"editRowLabel\":\"pricealert_editRowLabel__pGobq\",\"editRowInput\":\"pricealert_editRowInput__3px2m\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"queryPane\":\"report_queryPane__4in_T\",\"queryRow\":\"report_queryRow__2xHQJ\",\"paramTitle\":\"report_paramTitle__3sdtN\",\"paramValue\":\"report_paramValue__1bN2Y\",\"queryButton\":\"report_queryButton__wiJ-P\",\"paramDatePeriod\":\"report_paramDatePeriod__19PM1\",\"resultMainPane\":\"report_resultMainPane__gOhph\",\"padResultMainPane\":\"report_padResultMainPane__2QFwa\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"settingview_mainPane__vb1WW\",\"queryPane\":\"settingview_queryPane__1NaOV\",\"queryRow\":\"settingview_queryRow__66cyF\",\"styleRow\":\"settingview_styleRow__3R5m_\",\"styleRowTitle\":\"settingview_styleRowTitle__1NN8N\",\"styleRowValue\":\"settingview_styleRowValue__2ZTrk\",\"queryRowDisabled\":\"settingview_queryRowDisabled__2DaQc\",\"paramTitle\":\"settingview_paramTitle__LX5B5\",\"paramValue\":\"settingview_paramValue__ROGwG\",\"queryButton\":\"settingview_queryButton__OepOe\",\"rightArrow\":\"settingview_rightArrow__2HZqe\",\"status\":\"settingview_status__2PZs_\",\"statusButton\":\"settingview_statusButton__2oHM7\",\"instrumentSettingMainPane\":\"settingview_instrumentSettingMainPane__2DurP\",\"instrumentGroupMainPane\":\"settingview_instrumentGroupMainPane__2H_l7\",\"instrumentGroupTitle\":\"settingview_instrumentGroupTitle__3ZEQ4\",\"instrumentItemMainPane\":\"settingview_instrumentItemMainPane__1YPAY\",\"instrumentItemTitle\":\"settingview_instrumentItemTitle__2paxT\",\"instrumentItemCheckbox\":\"settingview_instrumentItemCheckbox__7gfOD\",\"instrumentItemSortArrow\":\"settingview_instrumentItemSortArrow__HAAgE\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"navBar\":\"titlebar_navBar__2X9WA\",\"goBackArrow\":\"titlebar_goBackArrow__2fl8R\",\"navBarTitle\":\"titlebar_navBarTitle__3-Bam\",\"moreButton\":\"titlebar_moreButton__3XTwI\",\"bottomGap\":\"titlebar_bottomGap__19JDV\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"todayexecute_mainPane__KhUCo\",\"orderPane\":\"todayexecute_orderPane__29k96\",\"instrumentTitle\":\"todayexecute_instrumentTitle__1fvpn\",\"orderPaneTitle\":\"todayexecute_orderPaneTitle__h2G7r\",\"orderItemDiv\":\"todayexecute_orderItemDiv__1Y6fV\",\"orderItemBuySell\":\"todayexecute_orderItemBuySell__2IcCB\",\"orderItemPrice\":\"todayexecute_orderItemPrice__3Ejki\",\"orderItemTime\":\"todayexecute_orderItemTime__SeAcC\",\"orderItemLot\":\"todayexecute_orderItemLot__3xccp\",\"orderItemOpenClose\":\"todayexecute_orderItemOpenClose__KWAl3\",\"orderItemPhase\":\"todayexecute_orderItemPhase__3vdBH\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"workinglistview_mainPane__3IsuW\",\"padMainPane\":\"workinglistview_padMainPane__1C8cc\",\"mainTitle\":\"workinglistview_mainTitle__1IfbT\",\"titleCloseButton\":\"workinglistview_titleCloseButton__141TE\",\"titleClearAllButton\":\"workinglistview_titleClearAllButton__1zcMD\",\"orderItemTitleBacground\":\"workinglistview_orderItemTitleBacground__1ljus\",\"orderItemRow\":\"workinglistview_orderItemRow__1Yig1\",\"orderItemBuySell\":\"workinglistview_orderItemBuySell__30KJI\",\"orderItemTime\":\"workinglistview_orderItemTime__2qqPJ\",\"orderItemLot\":\"workinglistview_orderItemLot__2uqXK\",\"orderItemPrice\":\"workinglistview_orderItemPrice__PszKO\",\"orderItemOpenClose\":\"workinglistview_orderItemOpenClose__QgsTw\",\"orderItemPhase\":\"workinglistview_orderItemPhase__2S5Rq\",\"padOrderItemRow\":\"workinglistview_padOrderItemRow__3cTA5\",\"padOrderItemPhase\":\"workinglistview_padOrderItemPhase__2dUqp\",\"padOrderItemTime\":\"workinglistview_padOrderItemTime__2K77z\",\"padOrderItemAccount\":\"workinglistview_padOrderItemAccount__1RSCj\",\"padOrderItemInstrument\":\"workinglistview_padOrderItemInstrument__2Zq_w\",\"padOrderItemLot\":\"workinglistview_padOrderItemLot__13wRj\",\"padOrderItemPips\":\"workinglistview_padOrderItemPips__3UFkW\",\"padOrderItemOpenClose\":\"workinglistview_padOrderItemOpenClose__5tUIe\",\"padOrderItemBuySell\":\"workinglistview_padOrderItemBuySell__1Y8ob\",\"padOrderItemSetPrice\":\"workinglistview_padOrderItemSetPrice__3ZGNh\",\"padOrderItemExecutePrice\":\"workinglistview_padOrderItemExecutePrice__3PG4F\",\"padOrderItemType\":\"workinglistview_padOrderItemType__327Ie\",\"padOrderItemTradePL\":\"workinglistview_padOrderItemTradePL__3dmWJ\",\"padOrderItemComm\":\"workinglistview_padOrderItemComm__3u7pk\",\"padOrderItemRebate\":\"workinglistview_padOrderItemRebate__1zf8y\",\"padOrderItemLevy\":\"workinglistview_padOrderItemLevy__2GQk8\",\"padOrderItemRemark\":\"workinglistview_padOrderItemRemark__3zma4\",\"pendingOrderItemRow\":\"workinglistview_pendingOrderItemRow__3HcTH\",\"pendingOrderItemBuy\":\"workinglistview_pendingOrderItemBuy__1PpUp\",\"pendingOrderItemSell\":\"workinglistview_pendingOrderItemSell__ZZ8En\",\"pendingOrderItemCol\":\"workinglistview_pendingOrderItemCol__1gC5G\",\"placedColor\":\"workinglistview_placedColor__2jb_v\",\"placingColor\":\"workinglistview_placingColor__2W35e\",\"canceledColor\":\"workinglistview_canceledColor__8aiD1\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"mainPane\":\"mainview_mainPane__1kmn4\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"body\":\"app_body__mZEHc app_body__29tEb\",\"pc\":\"app_pc__1Q4uM\",\"themeColor\":\"app_themeColor__212rc\",\"logo\":\"app_logo__219uj app_logo__4vZjf\",\"mainPane\":\"app_mainPane__1lXC2 app_mainPane__3bUKX\",\"padMainPane\":\"app_padMainPane__3Qrlb app_padMainPane__N0-ly\",\"iosMainPane\":\"app_iosMainPane__2RWbr app_iosMainPane__2lnRh\",\"padTitle\":\"app_padTitle__194r1 app_padTitle__28IFg\",\"padQuotation\":\"app_padQuotation__2CY1C app_padQuotation__2ktj1\",\"padChart\":\"app_padChart__u5NsB app_padChart__1FNry\",\"padTrading\":\"app_padTrading__27-0x app_padTrading__2Ozwi\",\"padInstrumentTitle\":\"app_padInstrumentTitle__35WCa app_padInstrumentTitle__14vFT\",\"padBalance\":\"app_padBalance__3BGVM app_padBalance__2O8yi\",\"padBottomContainer\":\"app_padBottomContainer__1mY6f app_padBottomContainer__1tZya\",\"padBottomSubContainer\":\"app_padBottomSubContainer__1MK2e app_padBottomSubContainer__DTpil\",\"padBottomTabTitle\":\"app_padBottomTabTitle__RMTZH app_padBottomTabTitle__9RsKj\",\"padBottomTabTitleItem\":\"app_padBottomTabTitleItem__3SW9Z app_padBottomTabTitleItem__J8Z0c\",\"padTradingPane\":\"app_padTradingPane__fw4he app_padTradingPane__fUXhF\",\"padTradingPlacing\":\"app_padTradingPlacing__1ym4k app_padTradingPlacing__3Ku2O\",\"padTradingClosing\":\"app_padTradingClosing__NU7He app_padTradingClosing__2M5CD\",\"buyColor\":\"app_buyColor__1XnGp app_buyColor__3Rd_C\",\"sellColor\":\"app_sellColor__1C7zR app_sellColor__1Oejm\",\"buySellButton\":\"app_buySellButton__2tomQ app_buySellButton__1d7tU\",\"buySellButtonContainer\":\"app_buySellButtonContainer__3Oqx_ app_buySellButtonContainer__1vz8e\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"defaultColor\":\"default_defaultColor__LJH43\",\"defaultBorderColor\":\"default_defaultBorderColor__3BsxW\",\"bodyBackgroundColor\":\"default_bodyBackgroundColor__lhPUn\",\"defaultButtonColor\":\"default_defaultButtonColor__2PUs-\",\"secondaryTextColor\":\"default_secondaryTextColor__1MpvR\",\"revertColor\":\"default_revertColor__3taMb\",\"selectedColor\":\"default_selectedColor__mmsXK\",\"highlightColor\":\"default_highlightColor__dPbse\",\"disabledColor\":\"default_disabledColor__tN3he\",\"negativeNumber\":\"default_negativeNumber__1fZYX\",\"userAvatarIcon\":\"default_userAvatarIcon__PUAsR\",\"sellColor\":\"default_sellColor__33oI9\",\"buyColor\":\"default_buyColor__3sV-U\",\"errorColor\":\"default_errorColor__1Tl9j\",\"bottomActiveItem\":\"default_bottomActiveItem__2J-P5\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"quotationContainer\":\"quotationview_quotationContainer__2JJzX quotationview_quotationContainer__2gQkf\",\"subCompanyPane\":\"quotationview_subCompanyPane__37JlX quotationview_subCompanyPane__1EX34\",\"subCompanyContent\":\"quotationview_subCompanyContent__1DHCr undefined\",\"padQuotationContainer\":\"quotationview_padQuotationContainer__PpSUV quotationview_quotationContainer__2gQkf\",\"quotationItem\":\"quotationview_quotationItem__xSxqg quotationview_quotationItem__3vrde\",\"quotationItemCode\":\"quotationview_quotationItemCode__2jFmc quotationview_quotationItemCode__3g9Ui\",\"quotationItemBlank\":\"quotationview_quotationItemBlank__2ZPfK quotationview_quotationItemBlank__sr8XY\",\"quotationItemTime\":\"quotationview_quotationItemTime__2ilFp quotationview_quotationItemTime__1BU8J\",\"quotationItemBidTitle\":\"quotationview_quotationItemBidTitle__10Cbi quotationview_quotationItemBidTitle__1vHwL\",\"quotationItemBid\":\"quotationview_quotationItemBid__1rwY- quotationview_quotationItemBid__KuNmr\",\"quotationItemFoot1\":\"quotationview_quotationItemFoot1__2-2WD quotationview_quotationItemFoot1__28Zx5\",\"quotationItemFoot2\":\"quotationview_quotationItemFoot2__vBIzH quotationview_quotationItemFoot2__2C71W\"};","\r\nfunction duplicateZero(count) {\r\n var zeroString = \"00000000\";\r\n return zeroString.substring(0, count);\r\n}\r\n\r\nBoolean.parseBoolean = function (s) {\r\n if (typeof s === \"boolean\") {\r\n return s;\r\n } else if (s === undefined) {\r\n return false;\r\n }\r\n\r\n if (parseInt(s).toString() === s) {\r\n return parseInt(s) !== 0;\r\n }\r\n\r\n var bool;\r\n bool = (function () {\r\n switch (false) {\r\n case s.toString().toLowerCase() !== 'true':\r\n return true;\r\n case s.toString().toLowerCase() !== 'false':\r\n return false;\r\n default:\r\n }\r\n })();\r\n if (typeof bool === \"boolean\") {\r\n return bool;\r\n }\r\n return void 0;\r\n};\r\n\r\n\r\nMath.round2 = function (value, digits) {\r\n return parseFloat(parseFloat(value).toFixed(digits == undefined ? 0 : digits));\r\n}\r\n\r\nString.formatFloat = function (value, decimalDigits, withKilocharacter) {\r\n if (withKilocharacter) {\r\n return String.formatWithKilocharacter(value, decimalDigits);\r\n }\r\n else {\r\n return String.formatWithoutKilocharacter(value, decimalDigits);\r\n }\r\n}\r\n\r\nDate.toMSJSON = function (d) {\r\n let timezone = d.getTimezoneOffset();\r\n var date = \"/Date(\" + d.getTime().toString() + (timezone > 0 ? \"+\" : \"\") + timezone.toString() + \")/\";\r\n console.log(date);\r\n return date;\r\n};\r\n\r\nString.formatWithKilocharacter = function (value, decimalDigits)\t//has \",\"\r\n{\r\n value = Math.round2(value, decimalDigits);\r\n //value = parseFloat(value).toFixed(decimalDigits-1);\r\n\r\n var valueString = value.toString();\r\n\r\n if (decimalDigits === 0) {\r\n return parseInt(valueString).toString();\r\n }\r\n\r\n var newStr = valueString;\r\n var symbolPN = \"\";\r\n var firstChar = newStr.substr(0, 1);\r\n if (firstChar === \"+\" || firstChar === \"-\") {\r\n symbolPN = firstChar;\r\n newStr = newStr.substr(1, newStr.length - 1);\r\n }\r\n var rightPart = \"\";\r\n var iLength = newStr.length;\r\n var index = newStr.indexOf(\".\");\r\n var padZero = 0;\r\n if (index > -1) {\r\n padZero = decimalDigits - (iLength - index - 1);\r\n rightPart = newStr.substr(index, iLength - index);\r\n newStr = newStr.substr(0, index);\r\n }\r\n else {\r\n padZero = decimalDigits;\r\n }\r\n\r\n var leftPart = \"\";\r\n iLength = newStr.length;\r\n if (iLength <= 3) leftPart = newStr;\r\n while (iLength > 3) {\r\n iLength = newStr.length;\r\n leftPart = \",\" + newStr.substr(iLength - 3, 3) + leftPart;\r\n newStr = newStr.substr(0, iLength - 3);\r\n iLength = newStr.length;\r\n if (iLength <= 3) {\r\n leftPart = newStr + leftPart;\r\n }\r\n }\r\n valueString = symbolPN + leftPart + rightPart;\r\n if (index <= -1) valueString += \".\";\r\n\r\n return valueString.concat(duplicateZero(padZero));\r\n}\r\n\r\nString.formatWithoutKilocharacter = function (s, decimalDigits) {\r\n if (decimalDigits === 0) {\r\n return parseInt(s, 10).toString();\r\n }\r\n\r\n var retStr = null;\r\n var regexExpression = \"(\\\\d+\\\\.{0,1}\\\\d{0,})\";\r\n var regex = new RegExp(regexExpression, \"i\");\r\n if (regex.exec(s) != null) {\r\n retStr = RegExp.$1;\r\n var pointPos = retStr.indexOf(\".\");\r\n var decimalFraction = \"\";\r\n if (pointPos > -1) {\r\n //patch decimalFraction with \"0\"\r\n let decimalFractionStr = (Math.pow(10, decimalDigits + 1)).toString();\r\n retStr = retStr + decimalFractionStr.substr(1);\r\n\r\n decimalFraction = \"1\" + retStr.substr(pointPos + 1, decimalDigits) + \".\" + retStr.substr(pointPos + 1 + decimalDigits, 1);\r\n decimalFractionStr = (Math.round2(decimalFraction)).toString();\r\n retStr = retStr.substr(0, pointPos + 1) + decimalFractionStr.substr(1);\r\n }\r\n else {\r\n let decimalFractionStr = (Math.pow(10, decimalDigits)).toString();\r\n retStr = retStr + \".\" + decimalFractionStr.substr(1);\r\n }\r\n }\r\n return retStr;\r\n}\r\n\r\nString.xxx = function (e) {\r\n return e + e;\r\n}\r\n\r\n","export const PriceTrend = {\r\n NotChanged: 0,\r\n Rise: 1,\r\n Fall: 2\r\n}\r\n\r\nexport const MarketInfoType = {\r\n HightLow: 0,\r\n PreCloseAndChange: 1,\r\n BuySellRate: 2\r\n // MarketDepth: 3\r\n}\r\n\r\nexport const PriceType = {\r\n WatchOnly: 0,\r\n ReferenceOnly: 1,\r\n DealingEnable: 2,\r\n OriginEnable: 3,\r\n PriceType3: 4\r\n}\r\n\r\nexport const InstrumentCategory = {\r\n Forex: 10,\r\n Physical: 20\r\n}\r\n\r\nexport const TransactionType = {\r\n Single: 0,\r\n Pair: 1,\r\n OneCancelOther: 2,\r\n Mapping: 3,\r\n MultipleClose: 4,\r\n Assign: 100,//AssigningOrderID == AssigningOrderID (the id of order been assigned from)\r\n}\r\n\r\nexport const TransactionSubType = {\r\n None: 0,\r\n Amend: 1, //AssigningOrderID == AmendedOrderId (the id of order been amended)\r\n IfDone: 2, //AssigningOrderID == IfOrderId (the id of order used as condition)\r\n Match: 3,\r\n Assign: 4, //AssigningOrderID == AssigningOrderID (id of the order been assigned from) //NotImplemented\r\n Mapping: 5,\r\n}\r\n\r\nexport const Phase = {\r\n Placing: 255,\r\n Placed: 0,\r\n Canceled: 1,\r\n Executed: 2,\r\n Completed: 3,\r\n Deleted: 4\r\n}\r\n\r\n\r\nexport const ExpireType = {\r\n Day: 0,\r\n GTC: 1,\r\n IOC: 2,\r\n GTD: 3,\r\n Session: 4,\r\n FillOrKill: 5,\r\n FillAndKill: 6,\r\n\r\n //below are not realy expire type, all these will bo convert to GTD\r\n GoodTillMonthDay: 7,\r\n GTF: 8,\r\n GTM: 9,\r\n GoodTillMonthSession: 10\r\n}\r\n\r\nexport const PendingOrderExpireType = {\r\n GoodTillDate: 0,\r\n GoodTillFriday: 1,\r\n GoodTillMonth: 2,\r\n GoodTillSession: 3,\r\n GoodTillDay: 4\r\n}\r\n\r\n\r\nexport const OrderType = {\r\n SpotTrade: 0,\r\n Limit: 1,\r\n Market: 2,\r\n MarketOnOpen: 3,\r\n MarketOnClose: 4,\r\n OneCancelOther: 5,\r\n Risk: 6,\r\n Stop: 7,\r\n MultipleClose: 8,\r\n MarketToLimit: 9,\r\n StopLimit: 10,\r\n FAK_Market: 11,\r\n BinaryOption: 12\r\n}\r\n\r\n\r\nexport const TradeOption = {\r\n Invalid: 0,\r\n Stop: 1,\r\n Better: 2\r\n}\r\n\r\nexport const PlacingSettingType = {\r\n Margin: 0,\r\n Physical: 1,\r\n BinaryOption: 2\r\n}\r\n\r\nexport const BuySell = {\r\n Buy: 0,\r\n Sell: 1\r\n}\r\n\r\nexport const LimitOrStop = {\r\n Limit: 0,\r\n Stop: 1\r\n}\r\n\r\n\r\nexport const InstrumentStatus = {\r\n None: 0,\r\n DayOpen: 1,\r\n DayClose: 2,\r\n SessionOpen: 3,\r\n SessionClose: 4,\r\n StopPlace: 5,\r\n NotInTrading: 6,\r\n DayOpening: 7,\r\n DayClosing: 8,\r\n SessionOpening: 9,\r\n SessionClosing: 10,\r\n MOOOpen: 11,\r\n MOOClosed: 12,\r\n MOCOpen: 13,\r\n MOCClosed: 14,\r\n DayCloseQuotationReceived: 15,\r\n AfterDayCloseBeforeDayOpen: 16\r\n}\r\n\r\n\r\nexport const AllowIfDoneType = {\r\n None: 0,\r\n AllowPendingIfDone: 1,\r\n AllowAll: 2 // Allow Dq And Pending IfDone\r\n}\r\n\r\n/////////// physical\r\n\r\nexport const PhysicalTradeSide = Object.freeze({\r\n None: 0,\r\n Buy: 1,\r\n Sell: 2,\r\n ShortSell: 4,\r\n Delivery: 8,\r\n Deposit: 16\r\n});\r\n\r\n\r\nexport const DeliveryRequestStatus = {\r\n Accepted: 0,\r\n Approved: 1,\r\n Stocked: 2,\r\n Delivered: 3,\r\n OrderCreated: 4,\r\n Hedge: 5,\r\n Cancelled: 100\r\n}\r\n\r\nexport const ScrapDepositStatus = {\r\n //0,待化验;1已化验;2已产生转仓单;100,已取消\r\n ExaminationInProcess: 0,\r\n ExaminationCompleted: 1,\r\n ContractConverted: 2,\r\n Canceled: 100\r\n}\r\n\r\n\r\nexport const InventoryInProcessStatus = {\r\n ExaminationInProcess: 0,\r\n ExaminationCompleted: 1,\r\n ContractConverted: 2,\r\n Submitted: 3,\r\n Approved: 4,\r\n StockIsAvailable: 5,\r\n DeliveryCompletede: 6,\r\n Canceled: 7\r\n}\r\n\r\n\r\nexport const PaymentForm = {\r\n FullPayment: 1,\r\n AdvancePayment: 2,\r\n Instalment: 4\r\n}\r\n\r\nexport const PhysicalInstalmentType = {\r\n None: 0,\r\n EqualPrincipal: 1,\r\n EqualInstalment: 2\r\n}\r\n\r\nexport const InstalmentFrequence = {\r\n Occasional: -1,\r\n Month: 0,\r\n Quarterly: 1,\r\n Fortnight: 2,\r\n Year: 3\r\n}\r\n\r\nexport const RecalculateRateType = {\r\n RecalucateNextMonth: 1,\r\n RecalucateNextYear: 2\r\n}\r\n\r\nexport const ContractTerminateType = {\r\n RepaymentRatio: 0,\r\n DeductOneInstalment: 1,\r\n FixedAmount: 2,\r\n LumpSum: 3\r\n}\r\n\r\nexport const AllowCloseInstalment = {\r\n DisAllow: 0,\r\n AllowAll: 1,\r\n AllowWhenNoOutstandingInstalment: 2,\r\n AllowPrepayment: 3\r\n}\r\n\r\nexport const AdvancePaymentOption = {\r\n DisallowAll: 0,\r\n AllowAll: 1,\r\n AllowInstalment: 2,\r\n AllowPrepayment: 3\r\n}\r\n\r\nexport const PhysicalChargeBasis = {\r\n DayOpenPrice: 0,\r\n MkTPrice: 1,\r\n UnitFixAmount: 2,\r\n OnSpecification: 3\r\n}\r\n\r\nexport const DiscountOption = {\r\n Progressive: 0,\r\n Flat: 1\r\n}\r\n\r\nexport const DiscountBasis = {\r\n Percentage: 0,\r\n UnitAmount: 1\r\n}\r\n\r\nexport const PayType = {\r\n Wire: 1,\r\n CryptoCurrency: 2,\r\n QRCode: 3\r\n}\r\n\r\n/////////////\r\nexport const CooKey = {\r\n ThemeName: \"w#e%%@b_t!%h&e\",\r\n QuotationRiseColor: \"w#e%%@b_xt!%h&eA\",\r\n QuotationRiseForeColor: \"w#e%%@b_xt!%h&eB\",\r\n QuotationFallColor: \"w#e%%@b_xt!%h&eC\",\r\n QuotationFallForeColor: \"w#e%%@b_xt!%h&eD\",\r\n MarketInfoType: \"w#e%%@b_xt!%h&eE\",\r\n Login: \"_@!#a$r%e^\",\r\n LoginName: \"n@!#a$m%e^\",\r\n LoginPassword: \"p@a!s#_$%o^rd\"\r\n}\r\n\r\nexport const BankAccountType = {\r\n BankCard: \"00\",\r\n BankBook: \"01\",\r\n EWallet: \"02\",\r\n NotSet: \"\"\r\n}\r\n\r\nexport const PriceAlertState = {\r\n Pending: 0,\r\n Hit: 1,\r\n Processed: 2,\r\n Expired: 3\r\n}\r\n\r\nexport const PriceAlertCondition = {\r\n BidLessThan: 0,\r\n BidGreaterThan: 1,\r\n AskLessthan: 2,\r\n AskGreaterThan: 3\r\n}\r\n\r\n\r\n\r\nexport const PopMessageType = {\r\n Message: \"Message\",\r\n PriceAlert: \"PriceAlert\"\r\n}\r\n\r\n\r\nexport const UpdateAction = {\r\n Init: 0,\r\n Add: 1,\r\n Modify: 2,\r\n Delete: 3\r\n}\r\n\r\nexport const BSStatus = {\r\n None: -1,\r\n SellOnly: 0,\r\n BuyOnly: 1,\r\n Both: 2\r\n}\r\n\r\nexport const AcceptNewLimitStop =\r\n{\r\n AllowNewForHedgingOnly: 0,\r\n AllowAll: 1,\r\n DisallowAll: 2,\r\n DissallowNewHedgeButAcceptUnLock: 3\r\n}\r\n\r\nexport const UploadBankCardType = {\r\n Hidden: 0,\r\n Optional: 1,\r\n Essential: 2\r\n}\r\n\r\nexport const OrderDetailViewType = {\r\n Modify: 0,\r\n WorkingList: 1\r\n}\r\n\r\nexport const UserRelation = {\r\n Sales: 1,\r\n Manager: 2\r\n}\r\n\r\nexport const BillType =\r\n{\r\n Commission: 1,\r\n Levy: 2,\r\n PhysicalPaymentDiscount: 37,\r\n OtherFee: 40,\r\n}\r\n\r\nexport const FeeFormula = {\r\n FixedAmount: 0,\r\n CS: 1,\r\n CSDividePrice: 2,\r\n CSMultiplyPrice: 3,\r\n Pips: 4,\r\n PricePips: 5,\r\n RealizedLoss: 6,\r\n RealizedProfit: 7,\r\n RealizedPL: 8,\r\n SharedPL: 9\r\n}\r\n\r\nexport const FeeCalculateType = {\r\n Commission: 0,\r\n Levy: 1,\r\n EstimateCloseCommission: 2,\r\n EstimateCloseLevy: 3\r\n}\r\n\r\nexport const AdministrationFeeBaseType = {\r\n //手续费\r\n //0:Fixed Amount(数量*比例), 1:%(价值*比例), 2:LumpSum(固定金额)\r\n FixedAmount: 0,\r\n Percentage: 1,\r\n LumpSum: 2\r\n}\r\n\r\nexport const DeliveryMode =\r\n{\r\n ShowDetails: 0,\r\n Summarized: 1\r\n}\r\n\r\nexport const CancelReason =\r\n{\r\n CustomerCanceled: 0,\r\n DealerCanceled: 1,\r\n RiskMonitorCanceled: 2,\r\n MooMocNewPositionNotAllowed: 3,\r\n InitialOrderCanNotBeAmended: 4,\r\n OrderExpired: 5,\r\n InvalidPrice: 6,\r\n RiskMonitorDelete: 7,\r\n AccountResetFailed: 8,\r\n NecessaryIsNotWithinThreshold: 9,\r\n MarginIsNotEnough: 10,\r\n AccountIsNotTrading: 11,\r\n InstrumentIsNotAccepting: 12,\r\n TimingIsNotAcceptable: 13,\r\n OrderTypeIsNotAcceptable: 14,\r\n HasNoAccountsLocked: 15,\r\n IsLockedByAgent: 16,\r\n LossExecutedOrderInOco: 17,\r\n ExceedOpenLotBalance: 18,\r\n OneCancelOther: 19,\r\n AccountIsInAlerting: 20,\r\n LimitStopAddPositionNotAllowed: 21,\r\n TransactionCannotBeBooked: 22,\r\n OnlySptMktIsAllowedForPreCheck: 23,\r\n InvalidTransactionPhase: 24,\r\n TransactionExpired: 25,\r\n OtherReason: 26,\r\n PriceChanged: 27,\r\n OpenOrderIsClosed: 28,\r\n ReplacedWithMaxLot: 29,\r\n SplittedForHasShortSell: 30,\r\n AdjustedToFullPaidOrderForHasShortSell: 31,\r\n TimeSpanBetweenOrders: 32,\r\n ExceedHighLowPrice: 33,\r\n ExceedDQVariation: 34,\r\n NotPaidoffInstalmentOrderCanNotBeClosed: 35,\r\n OrderBatchExecuteFailed: 36,\r\n\r\n ShortSellNotAllowed: 300,\r\n ExceedMaxPhysicalValue: 301,\r\n BalanceOrEquityIsShort: 302,\r\n PriceIsOutOfDate: 303,\r\n HitIsReseted: 304,\r\n InvalidInstalmentTrade: 305,\r\n PrepaymentIsNotAllowed: 306,\r\n ExistPendingLimitCloseOrder: 307,\r\n\r\n // Reasons Added for CME\r\n MarketPausedOrClosed: 1003,\r\n PriceMustBeGreaterThanZero: 1012,\r\n MarketPriceOrdersNotSupportedByOppositeLimit: 2013,\r\n SellOrderStopPriceMustBeBelowLastTradePrice: 2060,\r\n BuyOrderStopPriceMustBeAboveLastTradePrice: 2061,\r\n OrderTypeNotPermittedInPreOpen: 2130,\r\n OrderPriceOutsideTheLimits: 2137,\r\n OrderPriceOutsideBands: 2179,\r\n OrderTypeNotPermittedForGroup: 2311,\r\n OrderCannotBeModifiedInNoCancel: 7024\r\n}\r\n\r\nexport function getEnumLangaugeKey(enumName, value) {\r\n let languageKey = null;\r\n\r\n if (enumName === \"InstalmentFrequence\") {\r\n switch (value) {\r\n case (InstalmentFrequence.Year):\r\n languageKey = \"DialogWindow.Frequence_Year\";\r\n break;\r\n case (InstalmentFrequence.Month):\r\n languageKey = \"DialogWindow.Frequence_Month\";\r\n break;\r\n case (InstalmentFrequence.Quarterly):\r\n languageKey = \"DialogWindow.Frequence_Quarterly\";\r\n break;\r\n case (InstalmentFrequence.Fortnight):\r\n languageKey = \"DialogWindow.Frequence_Fortnight\";\r\n break;\r\n case (InstalmentFrequence.Occasional):\r\n languageKey = \"DialogWindow.Frequence_Occasional\";\r\n break;\r\n default:\r\n languageKey = \"\";\r\n };\r\n }else if (enumName === \"RecalculateRateType\") {\r\n return value == RecalculateRateType.RecalucateNextMonth ? \"DialogWindow.Physical_RecalucateNextMonth\" : \"DialogWindow.Physical_RecalucateNextYear\";\r\n }\r\n return languageKey;\r\n}","import React from 'react';\r\nimport { DOMParser } from 'xmldom';\r\nimport moment from 'moment';\r\nimport { Trans } from 'react-i18next';\r\nimport cookie from 'react-cookies';\r\nimport CryptoJS from 'crypto-js/crypto-js';\r\n\r\nimport { message as antMessage } from 'antd';\r\nimport { ExpireType, Phase, OrderType, MarketInfoType, PendingOrderExpireType } from './const';\r\n\r\n\r\nexport function exchangeRate(amount, rateIn, rateOut, sourceDecimals, targetDecimals) {\r\n return Math.round2(Math.round2(amount, sourceDecimals) * (amount > 0 ? parseFloat(rateIn) : parseFloat(rateOut)), targetDecimals);\r\n}\r\n\r\nexport function formatPrice(price, denominator) {\r\n return parseFloat(price).toFixed(denominator.toString().length - 1);\r\n}\r\n\r\nexport function formatNumber(floatNum, decimals) {\r\n if (typeof (floatNum) == 'string') {\r\n floatNum = parseFloat(floatNum);\r\n }\r\n\r\n if (floatNum != undefined && !isNaN(floatNum)) {\r\n return floatNum.toFixed(decimals).replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\r\n } else {\r\n return undefined;\r\n }\r\n}\r\n\r\nexport function uuidEmpty() {\r\n const value = '00000000-0000-0000-0000-000000000000';\r\n return value;\r\n}\r\n\r\nexport function uuid() {\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\r\n let r = Math.random() * 16 | 0, v = c === 'x' ? r : ((r & 0x3) | 0x8);\r\n return v.toString(16);\r\n });\r\n}\r\n\r\nexport function format() {\r\n if (arguments.length === 0)\r\n return null;\r\n\r\n var str = arguments[0];\r\n for (var i = 1, length = arguments.length; i < length; i++) {\r\n var re = new RegExp('\\\\{' + (i - 1) + '\\\\}', 'gm');\r\n str = str.replace(re, arguments[i]);\r\n }\r\n return str;\r\n}\r\n\r\nexport function format2(string) {\r\n var args = arguments;\r\n var pattern = new RegExp(\"%([1-\" + arguments.length + \"])\", \"g\");\r\n return String(string).replace(pattern, function (match, index) {\r\n return args[index];\r\n });\r\n};\r\n\r\n\r\nexport function getDateString(dt) {\r\n if (dt === undefined) dt = new Date();\r\n\r\n var y = dt.getFullYear();\r\n var m = dt.getMonth() + 1;\r\n var d = dt.getDate();\r\n\r\n return format(\"{0}-{1}-{2}\", (y < 10 ? \"0\" : \"\") + y.toString(), (m < 10 ? \"0\" : \"\") + m.toString(), (d < 10 ? \"0\" : \"\") + d.toString());\r\n}\r\n\r\nexport function getTimeString(dt, withMilliseconds) {\r\n\r\n if (dt === undefined) dt = new Date();\r\n\r\n var h = dt.getHours();\r\n var m = dt.getMinutes();\r\n var s = dt.getSeconds();\r\n var f = withMilliseconds ? \".\" + dt.getMilliseconds().toString() : \"\";\r\n\r\n return format(\"{0}:{1}:{2}{3}\", (h < 10 ? \"0\" : \"\") + h.toString(), (m < 10 ? \"0\" : \"\") + m.toString(), (s < 10 ? \"0\" : \"\") + s.toString(), f);\r\n}\r\n\r\n\r\nexport function getDateTimeString(dt, withMilliseconds) {\r\n if (dt === undefined) dt = new Date();\r\n\r\n return getDateString(dt) + ' ' + getTimeString(dt, withMilliseconds);\r\n}\r\n\r\nexport function parseDate(s) {\r\n return new Date(moment(s, \"YYYY-MM-DD HH:mm:ss\"));\r\n}\r\n\r\nexport function isInTradeDay(time, tradeDay) {\r\n return time > tradeDay.BeginTime && time <= tradeDay.EndTime;\r\n}\r\n\r\n// parameters format must like '1900-01-01 01:01:00', only compoare string time part\r\nexport function isInTime(now, beginTime, endTime) {\r\n if (beginTime && endTime) {\r\n\r\n let current = moment('2000-01-01 ' + now.substring(11, 19));\r\n let begin = moment('2000-01-01 ' + beginTime.substring(11, 19));\r\n let end = moment('2000-01-01 ' + endTime.substring(11, 19));\r\n\r\n let result = current > begin && current <= end;\r\n console.log(format('isInTime({0}, {1}, {2}) = {3}', now, beginTime, endTime, result));\r\n return result;\r\n } else {\r\n return false;\r\n }\r\n}\r\n\r\n\r\nexport function isEmpty(o) {\r\n return o === undefined || o == null || o === '';\r\n}\r\n\r\nexport function isNumeric(n) {\r\n return !isNaN(n) && isFinite(n);\r\n}\r\n\r\nexport function isInteger(n) {\r\n return parseInt(n).toString() == n;\r\n}\r\n\r\nexport function isObject(val) {\r\n return val != null && typeof val === 'object' && Array.isArray(val) === false;\r\n}\r\n\r\nexport function forceToArray(arr) {\r\n if (Array.isArray(arr)) {\r\n return arr;\r\n } else {\r\n let result = [];\r\n if (arr) {\r\n result.push(arr);\r\n }\r\n return result;\r\n }\r\n}\r\n\r\n\r\nexport function getPhaseLanguageKey(phase) {\r\n switch (parseInt(phase)) {\r\n case Phase.Placed: return \"MainView.PlacedPhase\";\r\n case Phase.Canceled: return \"MainView.CanceledPhase\";\r\n case Phase.Executed: return \"MainView.ExecutedPhase\";\r\n case Phase.Completed: return \"MainView.CompletedPhase\";\r\n case Phase.Deleted: return \"MainView.DeletedPhase\";\r\n case Phase.Placing: return \"MainView.PlacingPhase\";\r\n default: return \"\";\r\n }\r\n}\r\n\r\n\r\nexport function getExpireLanguageKey(expireType) {\r\n switch (parseInt(expireType)) {\r\n case PendingOrderExpireType.GoodTillDate: return \"DialogWindow.ExpireType_GoodTillDate\";\r\n case PendingOrderExpireType.GoodTillFriday: return \"DialogWindow.ExpireType_GTF\";\r\n case PendingOrderExpireType.GoodTillMonth: return \"DialogWindow.ExpireType_GTM\";\r\n case PendingOrderExpireType.GoodTillSession: return \"DialogWindow.ExpireType_Session\";\r\n case PendingOrderExpireType.GoodTillDay: return \"DialogWindow.ExpireType_Day\";\r\n default: return \"\";\r\n }\r\n}\r\n\r\n\r\n\r\nexport function getConditionLanguage(condition) {\r\n let result = '';\r\n switch (parseInt(condition)) {\r\n case 0:\r\n result = DialogWindow.BidMainView.Price<;\r\n break;\r\n case 1:\r\n result = DialogWindow.BidMainView.Price>;\r\n break;\r\n case 2:\r\n result = DialogWindow.AskMainView.Price<;\r\n break;\r\n case 3:\r\n result = DialogWindow.AskMainView.Price>;\r\n break;\r\n default:\r\n }\r\n return result;\r\n}\r\n\r\n\r\n\r\n\r\nexport function convertToXml(o, nodeName) {\r\n return addToXml(undefined, o, nodeName);\r\n}\r\n\r\nfunction addToXml(xmlDoc, o, nodeName) {\r\n if (!xmlDoc) {\r\n xmlDoc = new DOMParser().parseFromString(format('<{0} >', nodeName), 'text/xml').documentElement;\r\n }\r\n\r\n for (let attr in o) {\r\n let value = o[attr];\r\n\r\n if (Array.isArray(value)) {\r\n value.forEach((item, index) => {\r\n let node = xmlDoc.ownerDocument.createElement(attr);// xmlDoc.createElement(attr);\r\n xmlDoc.appendChild(node);\r\n addToXml(node, item, attr)\r\n }\r\n );\r\n\r\n } else if (isObject(value)) {\r\n let node = xmlDoc.ownerDocument.createElement(attr);// xmlDoc.createElement(attr);\r\n xmlDoc.appendChild(node);\r\n addToXml(node, value, attr);\r\n }\r\n else if (value != undefined) {\r\n if (isNaN(value) && value.toString() == 'NaN') {\r\n console.error('addToXml', attr, value);\r\n } else {\r\n xmlDoc.setAttribute(attr, value);\r\n }\r\n }\r\n\r\n\r\n }\r\n\r\n return xmlDoc;\r\n\r\n}\r\n\r\nexport function getDecimals(num) {\r\n let decimalPart = parseFloat((parseFloat(num) - parseInt(num)).toFixed(6))\r\n return decimalPart == 0 ? 0 : decimalPart.toString().length - 2;\r\n}\r\n\r\nexport function encodeHtml(s) {\r\n return s.replace(/&/g, '&')\r\n .replace(//g, '>')\r\n .replace(/\"/g, '"')\r\n .replace(/'/g, ''');\r\n}\r\n\r\nexport function decodeHtml(s) {\r\n return s.replace(/'/g, \"'\")\r\n .replace(/"/g, '\"')\r\n .replace(/>/g, '>')\r\n .replace(/</g, '<')\r\n .replace(/&/g, '&');\r\n}\r\n\r\nexport function isPC() {\r\n if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {\r\n return false;\r\n }\r\n else { return true; }\r\n}\r\n\r\n\r\nexport function isSafari() {\r\n if (navigator.userAgent.match(/(Android)/i)) {\r\n return false;\r\n }\r\n else { return true; }\r\n}\r\n\r\nexport function getAbsoluteLocation(element) {\r\n if (arguments.length != 1 || element == null) {\r\n return null;\r\n }\r\n var offsetTop = element.offsetTop;\r\n var offsetLeft = element.offsetLeft;\r\n var offsetWidth = element.offsetWidth;\r\n var offsetHeight = element.offsetHeight;\r\n while (element !== element.offsetParent) {\r\n offsetTop += element.offsetTop;\r\n offsetLeft += element.offsetLeft;\r\n }\r\n return {\r\n top: offsetTop, left: offsetLeft,\r\n width: offsetWidth, height: offsetHeight\r\n };\r\n}\r\n\r\nexport function saveCookie(key, data, isSession) {\r\n if (data != undefined) {\r\n let cipherkey = \"eee3ZZ6F\";\r\n let cookieData = CryptoJS.AES.encrypt(data.toString(), cipherkey).toString();\r\n if (isSession) {\r\n sessionStorage.setItem(key, cookieData);\r\n } else {\r\n const expirationDate = new Date();\r\n expirationDate.setDate(expirationDate.getDate() + 180);\r\n\r\n cookie.save(key, cookieData, { expires: expirationDate });\r\n //cookie.save(key, cookieData);\r\n }\r\n }\r\n}\r\n\r\nexport function removeCookie(key, isSession) {\r\n if (isSession) {\r\n sessionStorage.removeItem(key);\r\n } else {\r\n cookie.remove(key);\r\n }\r\n}\r\n\r\nexport function loadCookie(key, isSession) {\r\n let cipherkey = \"eee3ZZ6F\";\r\n let data = isSession ? sessionStorage.getItem(key) : cookie.load(key);\r\n // console.log(\"loadCookie\", key, cookey);\r\n try {\r\n return data ? CryptoJS.AES.decrypt(data, cipherkey).toString(CryptoJS.enc.Utf8) : undefined;\r\n }\r\n catch (ex) {\r\n console.error('loadCookie', ex);\r\n }\r\n}\r\n\r\n\r\nexport function getMarketInfoText(marketInfoType) {\r\n // let marketInfoType = (model.config.MarketInfoType ? parseInt(model.config.MarketInfoType) : MarketInfoType.HightLow);\r\n let marketInfoText = '';\r\n switch (marketInfoType) {\r\n case MarketInfoType.PreCloseAndChange:\r\n marketInfoText = \"MainView.PrevClose\";\r\n break;\r\n case MarketInfoType.BuySellRate:\r\n marketInfoText = \"DialogWindow.InterestRate\";\r\n break;\r\n default:\r\n marketInfoText = \"DialogWindow.HighLow\";\r\n }\r\n\r\n return {marketInfoText}\r\n}\r\n\r\nexport function geti18nLanguage(language) {\r\n switch (language) {\r\n case 'cht':\r\n return 'zh_tw';\r\n case 'chs':\r\n return 'zh_cn';\r\n default:\r\n return 'en';\r\n }\r\n}\r\n\r\nexport function getWfLanguage(language) {\r\n switch (language) {\r\n case 'cht' || 'zh_tw':\r\n return 'tc';\r\n case 'chs' || 'zh_cn':\r\n return 'sc';\r\n default:\r\n return 'en';\r\n }\r\n}\r\n\r\nexport function parseBoolean(s) {\r\n if (typeof s === \"boolean\") {\r\n return s;\r\n } else if (s === undefined) {\r\n return false;\r\n }\r\n\r\n if (isInteger(s)) {\r\n return parseInt(s) !== 0;\r\n }\r\n\r\n var bool;\r\n bool = (function () {\r\n switch (false) {\r\n case s.toString().toLowerCase() !== 'true':\r\n return true;\r\n case s.toString().toLowerCase() !== 'false':\r\n return false;\r\n default:\r\n }\r\n })();\r\n if (typeof bool === \"boolean\") {\r\n return bool;\r\n }\r\n return void 0;\r\n};\r\n\r\nexport function getWeekEnd(date) {\r\n var lastday = date.getDate() - (date.getDay() - 1) + 6;\r\n return moment(new Date(date.setDate(lastday)));\r\n}\r\n\r\nexport function isValidEmail(email) {\r\n const res = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{1,}))$/;\r\n return res.test(String(email).toLowerCase());\r\n}\r\n\r\nexport function isValidPhoneNumber(num) {\r\n // if (num.length >= 3 && !num.startsWith('-') || (num.substring(0, 1) == \"+\" && (num.substring(1, 1) != \"-\" && isInteger(num.substring(1)))))) {\r\n if (num.length >= 3 && isInteger(num) && !num.startsWith('-')) {\r\n return true;\r\n } else {\r\n // var re = /^[\\+]?[(]?[0-9]{3}[)]?[-\\s\\.]?[0-9]{3}[-\\s\\.]?[0-9]{4,6}$/im;\r\n let re = /^(\\+)?\\d{2,3}-?\\d{5,13}$/;\r\n return re.test(num);\r\n }\r\n}\r\n\r\nexport function getQueryString(name) {\r\n let url = new URL(window.location.href);\r\n let result = url.searchParams.get(name);\r\n return result ? result : '';\r\n\r\n // if (window.location.href.indexOf(\"?\") == -1 || window.location.href.indexOf(name + '=') == -1) {\r\n // return '';\r\n // }\r\n\r\n // var queryString = window.location.href.substring(window.location.href.indexOf(\"?\") + 1);\r\n\r\n // var parameters = queryString.split(\"&\");\r\n\r\n // var pos, paraName, paraValue;\r\n // for (var i = 0; i < parameters.length; i++) {\r\n // pos = parameters[i].indexOf('=');\r\n // if (pos == -1) { continue; }\r\n\r\n // paraName = parameters[i].substring(0, pos);\r\n // paraValue = parameters[i].substring(pos + 1);\r\n\r\n // if (paraName == name) {\r\n // paraValue = unescape(paraValue.replace(/\\+/g, \" \"))\r\n // // console.error('getQueryString', name, paraValue)\r\n // return paraValue;\r\n // }\r\n // }\r\n // return '';\r\n}\r\n\r\nexport function logError(content, duration) {\r\n console.error(content);\r\n antMessage.destroy()\r\n if (duration > 0) {\r\n window.setTimeout(() => antMessage.destroy(), duration * 1000);\r\n }\r\n antMessage.error(content, duration);\r\n\r\n}","\r\n// priceStyle1 : 17590 17592\r\n// priceStyle2 : 127.08 127.09\r\n// priceStyle3 : 127.8/16 127.9/16\r\n// priceStyle4 : 12700 12705 12710\r\n\r\n//static\r\n//var _regexExpression = \"(\\\\d+)(\\\\.(\\\\d+)(/(\\\\d+)|)|)\";\r\n\r\nfunction NormalizePrice() {\r\n this.PriceString = null; //string\r\n this.PriceValue = null; //double\r\n\r\n this.Clear = function () {\r\n this.PriceString = null;\r\n this.PriceValue = null;\r\n }\r\n}\r\n\r\nexport function Price() {\r\n \r\n var priceRegexExpression = \"(\\\\d+)(?:\\\\.(\\\\d+)(?:/(\\\\d+)|)|)\";\r\n var PriceRegex = new RegExp(priceRegexExpression, \"i\");\r\n PriceRegex.compile(priceRegexExpression, \"i\");\r\n\r\n //property\r\n this.numeratorUnit = null;\r\n this.denominator = null;\r\n this.normalizedPrice = null;\r\n this.normalizedValue = null;\r\n\r\n //method\r\n this.Clear = function () {\r\n this.numeratorUnit = null;\r\n this.denominator = null;\r\n this.normalizedPrice = null;\r\n this.normalizedValue = null;\r\n }\r\n\r\n this.Parse = function (priceString, numeratorUnit, denominator) {\r\n this.numeratorUnit = numeratorUnit;\r\n this.denominator = denominator;\r\n\r\n var normalizePrice = this.Normalize(priceString, numeratorUnit, denominator);\r\n if (normalizePrice != null) {\r\n this.normalizedPrice = normalizePrice.PriceString;\r\n this.normalizedValue = normalizePrice.PriceValue;\r\n }\r\n }\r\n\r\n this.Clone = function () {\r\n var price = new Price();\r\n\r\n price.numeratorUnit = this.numeratorUnit;\r\n price.denominator = this.denominator;\r\n price.normalizedPrice = this.normalizedPrice;\r\n price.normalizedValue = this.normalizedValue;\r\n\r\n return price;\r\n }\r\n\r\n this.ToString = function () {\r\n return (this.normalizedPrice == null) ? \"\" : this.normalizedPrice;\r\n }\r\n\r\n this.ToDouble = function () {\r\n return this.normalizedValue;\r\n }\r\n\r\n this.IsSameType = function (price, price2) {\r\n var isSameType = true;\r\n\r\n if (price == null || price2 == null) return false;\r\n\r\n if (price.numeratorUnit !== price2.numeratorUnit || price.denominator !== price2.denominator) {\r\n alert(\"Prices are not belong to the same instrument\");\r\n isSameType = false;\r\n }\r\n\r\n return isSameType;\r\n }\r\n\r\n this.Add = function (points) {\r\n var normalizedValue = this.normalizedValue + points / this.denominator;\r\n var price = Price.GetPrice(normalizedValue.toString(), this.numeratorUnit, this.denominator);\r\n\r\n return price;\r\n }\r\n\r\n\r\n this.SubStract = function (price) {\r\n if (this.IsSameType(this, price) === false) return null;\r\n\r\n return parseInt(Math.round2((this.normalizedValue - price.normalizedValue) * this.denominator));\r\n }\r\n this.SubStract3 = function (price) {\r\n if (this.IsSameType(this, price) === false) return null;\r\n\r\n return parseInt(Math.round2((this.normalizedValue - price.normalizedValue) * this.denominator)) / this.denominator;\r\n }\r\n this.Avg = function (prices) {\r\n if (prices.length <= 0) return null;\r\n var total = 0.0000;\r\n var iCount = prices.length;\r\n\r\n var price = prices[0];\r\n for (var i = 0; i < iCount; i++) {\r\n let price2 = prices[i];\r\n\r\n if (this.IsSameType(price, price2) === false) return null;\r\n\r\n total += price2.normalizedValue;\r\n }\r\n\r\n var mean = total / iCount;\r\n var meanPrice = Price.GetPrice(mean.toString(), this.numeratorUnit, this.denominator);\r\n\r\n return meanPrice;\r\n }\r\n\r\n this.CompareTo = function (price) {\r\n if (this.IsSameType(this, price) === false) return 0;\r\n\r\n var error = 0.0000001;\r\n if ((this.normalizedValue - price.normalizedValue) < -error) {\r\n return -1;\r\n }\r\n else if ((this.normalizedValue - price.normalizedValue) > error) {\r\n return 1;\r\n }\r\n else {\r\n return 0;\r\n }\r\n }\r\n\r\n this.More = function (price) {\r\n if (this.IsSameType(this, price) === false) return false;\r\n\r\n if (!price)\r\n return true;\r\n else\r\n return this.normalizedValue > price.normalizedValue;\r\n }\r\n\r\n this.Less = function (price) {\r\n if (this.IsSameType(this, price) === false) return false;\r\n\r\n if (!price)\r\n return true;\r\n else\r\n return this.normalizedValue < price.normalizedValue;\r\n }\r\n\r\n this.Equal = function (price) {\r\n if (this.IsSameType(this, price) === false) return false;\r\n\r\n if (!price)\r\n return true;\r\n else\r\n return this.normalizedValue === price.normalizedValue;\r\n }\r\n\r\n this.MoreEqual = function (price) {\r\n if (this.IsSameType(this, price) === false) return false;\r\n\r\n if (!price)\r\n return true;\r\n else\r\n return this.normalizedValue >= price.normalizedValue;\r\n }\r\n\r\n this.LessEqual = function (price) {\r\n if (this.IsSameType(this, price) === false) return null;\r\n\r\n if (!price)\r\n return true;\r\n else\r\n return this.normalizedValue <= price.normalizedValue;\r\n }\r\n\r\n this.Normalize = function (priceString, numeratorUnit, denominator) {\r\n // var normalizedPrice = null;\r\n var normalizedValue = 0;\r\n if (priceString == null || priceString === \"\" || priceString === \"0\") return null;\r\n\r\n var searchResult = null;\r\n try {\r\n \r\n searchResult = PriceRegex.exec(priceString); \r\n // console.log(RegExp.$1);\r\n \r\n }\r\n catch (e) {\r\n //alert(\"There is a not valid price: \" + priceString);\r\n console.log(e);\r\n }\r\n // console.log(RegExp.$1);\r\n if (searchResult == null) return null;\r\n\r\n var wholePart = parseInt(RegExp.$1);\r\n\r\n \r\n let priceValue = parseFloat(priceString);\r\n if (denominator == 1)\r\n {\r\n //normalize value to multiple of numeratorUnit\r\n normalizedValue = Math.round2(priceValue / numeratorUnit) * numeratorUnit;\r\n }\r\n else if (numeratorUnit > denominator)\r\n {\r\n let unit = numeratorUnit / denominator;\r\n\r\n normalizedValue = Math.round2(priceValue / unit) * unit;\r\n }\r\n else\r\n {\r\n //int integralPart = (int)priceValue;\r\n //decimal numerator = (priceValue - integralPart) * denominator;\r\n\r\n ////normalize numerator to multiple of numeratorUnit\r\n //decimal normalizedNumerator = Math.Round(numerator / numeratorUnit) * numeratorUnit;\r\n //normalizedPrice = integralPart + normalizedNumerator / denominator;\r\n\r\n let numerator = priceValue * denominator;\r\n //normalize numerator to multiple of numeratorUnit\r\n let normalizedNumerator = Math.round2(numerator / numeratorUnit) * numeratorUnit;\r\n normalizedValue = normalizedNumerator / denominator;\r\n\r\n }\r\n\r\n if (normalizedValue == 0) return null;\r\n\r\n var normalizePrice = new NormalizePrice();\r\n normalizePrice.PriceString = normalizedValue.toFixed(denominator.toString().length-1);;\r\n normalizePrice.PriceValue = normalizedValue;\r\n\r\n return normalizePrice;\r\n }\r\n\r\n}\r\n\r\nPrice.GetPrice = function (priceString, numeratorUnit, denominator) {\r\n var price = new Price();\r\n price.Parse(priceString, numeratorUnit, denominator);\r\n\r\n return (price.normalizedPrice == null) ? null : price;\r\n}\r\n\r\n\r\nPrice.GetDecimals = function (priceString) {\r\n var decimalPosition = priceString.indexOf('.');\r\n if (decimalPosition === -1) {\r\n return 0;\r\n } else {\r\n return priceString.length - decimalPosition - 1;\r\n }\r\n}","import React from 'react';\r\nimport { InstalmentFrequence, InstrumentCategory, PhysicalInstalmentType, DiscountOption, DiscountBasis, Phase, PhysicalChargeBasis } from '../common/const';\r\nimport { Trans } from 'react-i18next';\r\nimport * as utils from '../common/utils';\r\nimport { PhysicalTradeSide } from '../common/const';\r\n\r\nexport function getRate(frequence, interestrate) {\r\n if (frequence == InstalmentFrequence.Month) {\r\n return (interestrate / 12);\r\n }\r\n else if (frequence == InstalmentFrequence.Quarterly) {\r\n return (interestrate / 4);\r\n }\r\n else if (frequence == InstalmentFrequence.Fortnight) {\r\n return (interestrate / 4);\r\n }\r\n else {\r\n return interestrate;\r\n }\r\n}\r\n\r\n\r\nexport function getDownpaymentSettings(instalmentPolicyDetail, defaultValue) {\r\n if (!instalmentPolicyDetail) return {};\r\n\r\n let downPaymentSettings = { step: 1, decimals: 1 };\r\n if (parseInt(instalmentPolicyDetail.DownPaymentBasis) === 0) {\r\n downPaymentSettings.max = Math.round2(instalmentPolicyDetail.MaxDownPayment * 100, 2);\r\n downPaymentSettings.min = Math.round2(instalmentPolicyDetail.MinDownPayment * 100, 2);\r\n downPaymentSettings.unit = \"%\";\r\n downPaymentSettings.default = defaultValue ? defaultValue * 100 : downPaymentSettings.min;\r\n }\r\n else {\r\n downPaymentSettings.max = parseFloat(instalmentPolicyDetail.MaxDownPayment);\r\n downPaymentSettings.min = parseFloat(instalmentPolicyDetail.MinDownPayment);\r\n downPaymentSettings.unit = DialogWindow.Physical_PerLot\r\n downPaymentSettings.default = defaultValue ? defaultValue : downPaymentSettings.min;\r\n }\r\n\r\n //\r\n let decimals = (utils.getDecimals(downPaymentSettings.min));\r\n decimals = Math.max(decimals, utils.getDecimals(downPaymentSettings.max));\r\n decimals = Math.max(decimals, utils.getDecimals(downPaymentSettings.default));\r\n if (decimals != 0) {\r\n downPaymentSettings.decimals = decimals;\r\n downPaymentSettings.step = 1 / Math.pow(10, decimals);\r\n }\r\n\r\n let result = {\r\n // periodOptions: periodOptions,\r\n // periods: periods,\r\n selectedPeriod: parseInt(instalmentPolicyDetail.Period),\r\n instalmentPolicyDetail: instalmentPolicyDetail,\r\n downPaymentSettings: downPaymentSettings,\r\n downPayment: downPaymentSettings.default\r\n };\r\n\r\n return result;\r\n}\r\n\r\nexport function getRepaymentAmount(amount, rate, installments, decimals) {\r\n let tmp = Math.pow(1 + rate, installments);//返回指定数字的指定次幂。\r\n return Math.round2((amount * rate * tmp / (tmp - 1)), decimals);\r\n}\r\n\r\n\r\nexport function calculateInstalmentDetails(physicalInstalmentType, amount, period, frequence, interestrate, decimals, currencyName) {\r\n period = parseFloat(period);\r\n interestrate = parseFloat(interestrate);\r\n if (physicalInstalmentType == PhysicalInstalmentType.EqualInstalment) {\r\n return calculateEqualInstalment(amount, period, frequence, interestrate, decimals, currencyName);\r\n } else {\r\n return calculateEqualPrincipal(amount, period, frequence, interestrate, decimals, currencyName);\r\n }\r\n}\r\n\r\nfunction calculateEqualPrincipal(amount, period, frequence, interestrate, decimals, currencyName) {\r\n let instalmentCalculateResults = [];\r\n let principal = 0, totalInstalmentAmount = 0, totalPrincipal = 0, totalInterest = 0;\r\n let rate0 = 0, instalmentAmount = 0;\r\n\r\n let rate = getRate(frequence, interestrate);\r\n\r\n principal = Math.round2(amount / period, decimals);\r\n let interest = 0;\r\n\r\n for (let i = 1; i <= period; i++) {\r\n interest = Math.round2(amount * rate, decimals);\r\n amount = Math.round2(amount - principal, decimals);\r\n\r\n if (i == period && amount != 0) {\r\n principal = Math.round2(principal + amount, decimals);\r\n if (rate != 0)\r\n interest = Math.round2(interest - amount, decimals);\r\n amount = 0;\r\n }\r\n\r\n instalmentAmount = Math.round2(principal + interest, decimals);\r\n\r\n totalInstalmentAmount += instalmentAmount;\r\n totalPrincipal += principal;\r\n totalInterest += interest;\r\n\r\n let instalmentDetail = { period: i, principal: Math.round2(principal, decimals), interest: Math.round2(interest, decimals), instalmentAmount: instalmentAmount, currencyName: currencyName };\r\n instalmentCalculateResults.push(instalmentDetail);\r\n }\r\n\r\n return {\r\n totalPrincipal: Math.round2(totalPrincipal, decimals),\r\n totalInterest: Math.round2(totalInterest, decimals),\r\n totalInstalmentAmount: Math.round2(totalInstalmentAmount, decimals),\r\n instalments: instalmentCalculateResults\r\n };\r\n}\r\n\r\n\r\nfunction calculateEqualInstalment(amount, period, frequence, interestrate, decimals, currencyName) {\r\n let instalmentCalculateResults = [];\r\n let principal = 0, totalInstalmentAmount = 0, totalPrincipal = 0, totalInterest = 0;\r\n let rate0 = 0, instalmentAmount = 0;\r\n\r\n let rate = getRate(frequence, interestrate);\r\n\r\n if (rate == 0)\r\n principal = Math.round2(amount / period, decimals);\r\n\r\n for (let i = 1; i <= period; i++) {\r\n let interest = Math.round2(amount * rate, decimals);\r\n if (rate != 0) {\r\n if (rate0 != rate) instalmentAmount = getRepaymentAmount(amount, rate0 = rate, period, decimals);\r\n principal = Math.round2(instalmentAmount - interest, decimals);\r\n amount -= principal;\r\n if (i == period && amount != 0) {\r\n principal += amount;\r\n interest -= amount;\r\n amount = 0;\r\n }\r\n }\r\n else {\r\n instalmentAmount = principal;\r\n }\r\n\r\n totalInstalmentAmount += instalmentAmount;\r\n totalPrincipal += principal;\r\n totalInterest += interest;\r\n\r\n let instalmentDetail = { period: i, principal: Math.round2(principal, decimals), interest: Math.round2(interest, decimals), instalmentAmount: instalmentAmount, currencyName: currencyName };\r\n instalmentCalculateResults.push(instalmentDetail);\r\n }\r\n\r\n return {\r\n totalPrincipal: Math.round2(totalPrincipal, decimals),\r\n totalInterest: Math.round2(totalInterest, decimals),\r\n totalInstalmentAmount: Math.round2(totalInstalmentAmount, decimals),\r\n instalments: instalmentCalculateResults\r\n };\r\n\r\n}\r\n\r\n\r\nexport function calculatePhysicalValue(lotInteger, lotRemainder, livePrice, discountOfOdd, tradePLFormula, contractSize) {\r\n let value = 0;\r\n livePrice = parseFloat(livePrice);\r\n discountOfOdd = parseFloat(discountOfOdd);\r\n contractSize = parseFloat(contractSize);\r\n tradePLFormula = parseInt(tradePLFormula);\r\n\r\n switch (tradePLFormula) {\r\n case 0:\r\n value = lotInteger * contractSize * livePrice + lotRemainder * contractSize * livePrice * discountOfOdd;\r\n break;\r\n case 1:\r\n case 3:\r\n value = lotInteger * contractSize + lotRemainder * contractSize * discountOfOdd;\r\n break;\r\n case 2:\r\n livePrice = 1 / livePrice;\r\n value = lotInteger * contractSize * livePrice + lotRemainder * contractSize * livePrice * discountOfOdd;\r\n break;\r\n default:\r\n }\r\n return value;\r\n}\r\n\r\nexport function calculateMarketValue(model, instrument, order) {\r\n order.UnpaidAmount = 0;\r\n order.MarketValue = 0;\r\n order.PedgeAmount = 0;\r\n order.MarketValueInStock = 0;\r\n\r\n if (parseInt(instrument.Category) !== InstrumentCategory.Physical) {\r\n return;\r\n }\r\n\r\n let account = model.accounts[order.Transaction.AccountID];\r\n let quotePolicyId = (utils.parseBoolean(account.UseQuotePolicyId) ? account.UseQuotePolicyId : account.PublicQuotePolicyId);\r\n let quotation = instrument.quotations ? instrument.quotations[quotePolicyId] : instrument.lastQuotation;\r\n\r\n let tradePolicyDetail = account.TradePolicyDetails[instrument.Id];\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n let numerator = parseInt(instrument.NumeratorUnit);\r\n let denominator = parseInt(instrument.Denominator);\r\n\r\n let isBuy = Boolean.parseBoolean(order.IsBuy);\r\n // let buy = isNormal ? Price.GetPrice(quotation.Bid, 1, denominator).ToDouble() : Price.GetPrice(quotation.Ask, 1, denominator).ToDouble(); //instrument.Bid : instrument.Ask;\r\n // let sell = isNormal ? Price.GetPrice(quotation.Ask, 1, denominator).ToDouble() : Price.GetPrice(quotation.Bid, 1, denominator).ToDouble(); //instrument.Ask : instrument.Bid;\r\n let buy = isNormal ? parseFloat(quotation.Bid) : parseFloat(quotation.Ask);\r\n let sell = isNormal ? parseFloat(quotation.Ask) : parseFloat(quotation.Bid);\r\n let pedgeAmount = 0;\r\n let value = 0;\r\n let unpaidAmount = 0;\r\n // let marketValue =0;\r\n let isPayoff = Math.abs(order.PaidPledgeBalance) === Math.abs(order.PhysicalOriginValueBalance);\r\n\r\n let lotBalance = parseFloat(order.LotBalance) - (order.deliveryLotInProcess ? order.deliveryLotInProcess : 0);\r\n if (buy == null && sell == null) {\r\n order.MarketValue = 0;\r\n }\r\n else {\r\n if (isBuy) {\r\n order.LivePrice = buy;\r\n }\r\n else {\r\n order.LivePrice = sell;\r\n }\r\n let lotInteger = parseInt(lotBalance);\r\n let lotRemainder = parseFloat((lotBalance - lotInteger).toFixed(6));\r\n value = calculatePhysicalValue(lotInteger, lotRemainder, order.LivePrice, tradePolicyDetail.DiscountOfOdd, instrument.TradePLFormula, order.Transaction.ContractSize);\r\n\r\n }\r\n\r\n\r\n if (isBuy && !isPayoff && order.PhysicalOriginValueBalance != null && order.PaidPledgeBalance != null)\r\n unpaidAmount = order.PhysicalOriginValueBalance - Math.abs(order.PaidPledgeBalance); // -this.PhysicalPaymentDiscount;\r\n\r\n let decimals = 0;\r\n if (Boolean.parseBoolean(account.IsMultiCurrency)) {\r\n let currency = model.currencies[instrument.CurrencyId];\r\n decimals = currency.Decimals;\r\n order.MarketValueInStock = Math.round2(value, decimals);\r\n unpaidAmount = Math.round2(unpaidAmount, decimals);\r\n }\r\n else {\r\n order.MarketValueInStock = model.exchangeRate(value, instrument.CurrencyId, account.CurrencyID);\r\n let currency = model.currencies[account.CurrencyID];\r\n decimals = currency.Decimals;\r\n unpaidAmount = Math.round2(unpaidAmount, currency.Decimals);\r\n }\r\n if (isPayoff) {\r\n pedgeAmount = order.MarketValueInStock * tradePolicyDetail.ValueDiscountAsMargin;\r\n }\r\n pedgeAmount = Math.round2(pedgeAmount, decimals);\r\n order.UnpaidAmount = unpaidAmount;\r\n order.MarketValue = Math.round2(value, decimals);\r\n if (buy != null || sell != null)\r\n order.PedgeAmount = pedgeAmount;\r\n\r\n if (!utils.isEmpty(tradePolicyDetail.DeliveryChargeId)) {\r\n let deliveryCharge = model.deliveryCharges[tradePolicyDetail.DeliveryChargeId];\r\n\r\n if (parseInt(deliveryCharge.ChargeBasis) === PhysicalChargeBasis.UnitFixAmount) {\r\n // let charge = order.MarketValue * deliveryCharge.ChargeRate;\r\n\r\n let charge = lotBalance * deliveryCharge.ChargeRate;\r\n charge = Math.max(parseFloat(deliveryCharge.MinCharge), charge);\r\n if (utils.parseBoolean(account.IsMultiCurrency)) {\r\n charge = model.exchangeRate(charge, instrument.CurrencyId, account.CurrencyID);\r\n }\r\n order.deliveryCharge = charge;\r\n }\r\n }\r\n}\r\n\r\nfunction findLastDiscountDetail(details, lot) {\r\n for (let i = details.length - 1; i >= 0; i--) {\r\n if (parseFloat(details[i].From) < lot) return details[i];\r\n }\r\n return undefined;\r\n}\r\n\r\nexport function calculateDiscount(paymentDiscountPolicy, lot, marketValue, paymentForm, rateIn, rateOut, sourceDecimals, targetDecimals) {\r\n let details = paymentDiscountPolicy.details.sort((a, b) => parseFloat(a.From) - parseFloat(b.From));\r\n\r\n if ((paymentForm & paymentDiscountPolicy.AllowedPaymentForm) != paymentForm || details.length == 0) return 0;\r\n\r\n\r\n if (paymentDiscountPolicy.Option == DiscountOption.Flat) {\r\n let detail = findLastDiscountDetail(details, lot);\r\n let discount = 0;\r\n if (detail != undefined) {\r\n discount = parseInt(paymentDiscountPolicy.DiscountBasis) == DiscountBasis.UnitAmount ? (rateIn == undefined ? lot * detail.DiscountValue : utils.exchangeRate(lot * detail.DiscountValue, rateIn, rateOut, sourceDecimals, targetDecimals)) : marketValue * detail.DiscountValue;\r\n }\r\n return discount;\r\n }\r\n else if (parseInt(paymentDiscountPolicy.Option) == DiscountOption.Progressive) {\r\n let discount = 0;\r\n\r\n let index = 0;\r\n while (index < details.length && lot > parseFloat(details[index].From)) {\r\n let detail = details[index];\r\n let calculateLot = lot - parseFloat(detail.From);\r\n if (index < details.length - 1) {\r\n let range = (parseFloat(details[index + 1].From) - parseFloat(detail.From));\r\n calculateLot = Math.min(calculateLot, range);\r\n }\r\n\r\n let calculateValue = (marketValue * calculateLot) / lot;\r\n\r\n discount += parseInt(paymentDiscountPolicy.DiscountBasis) == DiscountBasis.UnitAmount ? (rateIn == undefined ? calculateLot * detail.DiscountValue : utils.exchangeRate(calculateLot * detail.DiscountValue, rateIn, rateOut, sourceDecimals, targetDecimals)) : calculateValue * detail.DiscountValue;\r\n index++;\r\n }\r\n\r\n return discount;\r\n }\r\n else {\r\n console.error(utils.format(\"Option = {0} is not supported\", this.Option));\r\n }\r\n}\r\n\r\nexport function calcAdministrativeCharge(model, account, instrument, order) {\r\n\r\n // this.CurrentAccount.RawAccount.SettingsAccount.SetAdministrativeCharge(instrument.RawInstrument.SettingsInstrument.Id, 0);\r\n\r\n let tradePolicyDetail = account.TradePolicyDetails[instrument.Id];\r\n // BuySell? buySell = this.CurrentAccount.BuySell;\r\n // if (this.CurrentAccount.ClosingContractsAssistant.BuySell != null)\r\n // {\r\n // buySell = (this.CurrentAccount.ClosingContractsAssistant.BuySell == BuySell.Buy ? BuySell.Sell : BuySell.Buy);\r\n // }\r\n\r\n if (tradePolicyDetail.AdministrativeChargeId != null && tradePolicyDetail.AdministrativeChargeConvertRate != 0) {\r\n let administrativeChargeId = tradePolicyDetail.AdministrativeChargeId;\r\n let totalConvertedAmount = 0;\r\n\r\n Object.values(model.instruments).forEach((otherInstrument) => {\r\n if (otherInstrument.openPositions != undefined) {\r\n Object.values(otherInstrument.openPositions).forEach((order) => {\r\n let lotBalance = parseFloat(order.LotBalance);\r\n if (order.Phase == Phase.Executed && lotBalance > 0) {\r\n // Settings.TradePolicyDetail itemTradePolicyDetail = this.PlacingAssistant.SettingsManager.GetTradePolicyDetail(contract.OriginOrder.Transaction.Account.SettingsAccount.TradePolicyId, contract.OriginOrder.Transaction.Instrument.SettingsInstrument.Id);\r\n let itemTradePolicyDetail = account.TradePolicyDetails[otherInstrument.Id];\r\n if (itemTradePolicyDetail.AdministrativeChargeId == administrativeChargeId) {\r\n //totalOpenLots += contract.LotBalance;\r\n totalConvertedAmount += lotBalance * itemTradePolicyDetail.AdministrativeChargeConvertRate;\r\n }\r\n }\r\n });\r\n }\r\n });\r\n\r\n\r\n let lot = parseFloat(order.Lot);\r\n\r\n // if (this.CurrentAccount.OpenClose == OpenClose.Open)\r\n // { \r\n totalConvertedAmount += lot * tradePolicyDetail.AdministrativeChargeConvertRate;\r\n // }\r\n\r\n let rate = getAdministrativeChargeRate(model, administrativeChargeId, totalConvertedAmount);\r\n\r\n // let sourceCurrencyId = instrument.CurrencyId;\r\n // let targetCurrencyId = account.CurrencyId;\r\n //Settings.CurrencyRate currencyRate = this.PlacingAssistant.SettingsManager.GetCurrencyRate(sourceCurrencyId, targetCurrencyId);\r\n let convertedAmount = rate * lot * tradePolicyDetail.ContractSize * parseFloat(order.SetPrice);\r\n\r\n let ratedCharge = utils.parseBoolean(account.IsMultiCurrency) ? convertedAmount : model.exchangeRate(convertedAmount, instrument.CurrencyId, account.CurrencyId);\r\n\r\n model.placingData.physicalOptions.administrativeCharge = ratedCharge;\r\n return ratedCharge;\r\n }\r\n\r\n return 0;\r\n}\r\n\r\nfunction getAdministrativeChargeRate(model, administrativeChargeId, convertedAmount) {\r\n let chargePolicy = model.administrativeCharges[administrativeChargeId];\r\n if (chargePolicy != undefined) {\r\n let charges = model.administrativeCharges[administrativeChargeId].details.sort((a, b) => parseFloat(a.Quantity) - parseFloat(b.Quantity));\r\n\r\n // charges.Sort();\r\n if (charges.length == 1) {\r\n return charges[0].ChargeRate;\r\n }\r\n else if (charges.length >= 2) {\r\n if (convertedAmount <= charges[0].Quantity) {\r\n return charges[0].ChargeRate;\r\n }\r\n else if (convertedAmount > charges[charges.length - 1].Quantity) {\r\n return charges[charges.length - 1].ChargeRate;\r\n }\r\n else {\r\n for (let i = 1; i < charges.length - 1; i++) {\r\n if (convertedAmount <= charges[i].Quantity) {\r\n return charges[i].ChargeRate;\r\n }\r\n }\r\n return charges[charges.length - 1].ChargeRate;\r\n }\r\n }\r\n\r\n\r\n }\r\n\r\n return 0;\r\n}\r\n\r\nexport function canDelivery(inventory) {\r\n let physicalOriginValueBalance = parseFloat(inventory.PhysicalOriginValueBalance);\r\n let paidPledgeBalance = parseFloat(inventory.PaidPledgeBalance);\r\n let lotBalance = parseFloat(inventory.LotBalance) - parseFloat(inventory.deliveryLotInProcess.toFixed(6));\r\n return (parseFloat(lotBalance) > 0 && physicalOriginValueBalance == Math.abs(paidPledgeBalance));\r\n}\r\n\r\nexport function gotoDelivery(model, account, instrument, inventory, callback) {\r\n let tradePolicyDetail = account.TradePolicyDetails[instrument.Id];\r\n if ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.Delivery) == PhysicalTradeSide.Delivery) {\r\n let hasDeliveryOrder = false;\r\n Object.values(instrument.physicalInventory).forEach((item, index) => {\r\n item.checked = (inventory == undefined);\r\n item.deliveryLot = (inventory == undefined) ? parseFloat(item.LotBalance) - item.deliveryLotInProcess : 0;\r\n\r\n if (canDelivery(item)) {\r\n hasDeliveryOrder = true;\r\n }\r\n });\r\n\r\n if (hasDeliveryOrder) {\r\n if (inventory) {\r\n let unPaid = !inventory ? '' : parseFloat(inventory.PhysicalOriginValueBalance) - Math.abs(parseFloat(inventory.PaidPledgeBalance));\r\n if (unPaid != 0) {\r\n return;\r\n }\r\n inventory.checked = true;\r\n inventory.deliveryLot = parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess;\r\n }\r\n\r\n model.placingData.selectedInstrument = instrument;\r\n // let tradePolicyDetail = account.TradePolicyDetails[instrument.Id];\r\n model.commService.getDeliveryAddress(tradePolicyDetail.DeliveryPointGroupId, (d) => deliveryAddressCallback(d, model, callback));\r\n // this.goto('/delivery');\r\n }\r\n }\r\n}\r\n\r\nfunction deliveryAddressCallback(d, model, callback) {\r\n console.log('deliveryAddressCallback', d);\r\n let data = JSON.parse(d);\r\n\r\n if (data.Result.content_result.DeliveryAddresses) {\r\n model.placingData.deliveryAddresses = utils.forceToArray(data.Result.content_result.DeliveryAddresses.DeliveryAddress);\r\n\r\n // this.goto('/delivery');\r\n callback();\r\n }\r\n}\r\n","import { InstrumentCategory, PhysicalTradeSide, Phase, OrderType, TransactionType, TradeOption, AcceptNewLimitStop, BillType, FeeFormula, FeeCalculateType } from '../common/const.js';\r\nimport * as utils from '../common/utils.js';\r\nimport { Price } from './price2.js';\r\nimport { calculateMarketValue } from './physicalHelper';\r\n\r\nfunction calculateTradePL(buy, sell, close, tradePLFormula, lotBalance, contractSize) {\r\n let tradePL = 0;\r\n switch (tradePLFormula) {\r\n case 0:\r\n tradePL = lotBalance * (sell - buy) * contractSize;\r\n break;\r\n case 1:\r\n tradePL = lotBalance * (sell - buy) * contractSize / close;\r\n break;\r\n case 2:\r\n tradePL = lotBalance * (1 / sell - 1 / buy) * contractSize;\r\n break;\r\n case 3: // Added 2007-11-20\r\n let openPrice = (close == buy) ? sell : buy;\r\n tradePL = lotBalance * (sell - buy) * contractSize / openPrice;\r\n break;\r\n default:\r\n }\r\n return tradePL;\r\n}\r\n\r\nexport function calculateOrderFloating(model, instrument, order) { \r\n if (order.Transaction && order.Transaction.AccountID != model.selectedAccount.Id) return;\r\n\r\n let account = model.selectedAccount; // model.accounts[order.Transaction.AccountID];\r\n\r\n\r\n if (order.Bills && order.Bills.Bill && order.Levy === undefined && order.Commission === undefined && order.OtherFee === undefined && order.PhysicalPaymentDiscount === undefined) {\r\n order.Levy = 0;\r\n order.Commission = 0;\r\n order.OtherFee = 0;\r\n order.PhysicalPaymentDiscount = 0;\r\n\r\n utils.forceToArray(order.Bills.Bill).forEach((bill) => {\r\n if (bill.Type == BillType.Commission) {\r\n order.Commission += -parseFloat(bill.Value);\r\n } else if (bill.Type == BillType.Levy) {\r\n order.Levy += -parseFloat(bill.Value);\r\n } else if (bill.Type == BillType.OtherFee) {\r\n order.OtherFee += -parseFloat(bill.Value);\r\n } else if (bill.Type == BillType.PhysicalPaymentDiscount) {\r\n order.PhysicalPaymentDiscount += -parseFloat(bill.Value);\r\n }\r\n });\r\n }\r\n\r\n // tradepl\r\n if (!utils.parseBoolean(order.IsOpen) && (order.Phase == Phase.Executed || order.Phase == Phase.Completed)) {\r\n let tradePL = 0, interestPL = 0;\r\n utils.forceToArray(order.OrderRelations.OrderRelation).forEach((relation) => {\r\n // tradePL += utils.isEmpty(relation.TradePL) ? 0 : model.exchangeRate(parseFloat(relation.TradePL), instrument.CurrencyId, account.CurrencyID);\r\n // interestPL += utils.isEmpty(relation.InterestPL) ? 0 : parseFloat(model.exchangeRate(relation.InterestPL, instrument.CurrencyId, account.CurrencyID));\r\n tradePL += utils.isEmpty(relation.TradePL) ? 0 : utils.exchangeRate(relation.TradePL, relation.RateIn, relation.RateOut, relation.TargetDecimals, relation.TargetDecimals);\r\n interestPL += utils.isEmpty(relation.InterestPL) ? 0 : utils.exchangeRate(relation.InterestPL, relation.RateIn, relation.RateOut, relation.TargetDecimals, relation.TargetDecimals);\r\n });\r\n\r\n // if (utils.parseBoolean(account.IsMultiCurrency)) {\r\n // let currency = model.currencies[instrument.CurrencyId];\r\n // let decimals = currency.Decimals;\r\n\r\n // tradePL = Math.round2(tradePL, decimals);\r\n // interestPL = Math.round2(interestPL, decimals);\r\n // }\r\n // else {\r\n // // tradePL = model.exchangeRate(tradePL, instrument.CurrencyId, account.CurrencyID);\r\n // // interestPL = model.exchangeRate(interestPL, instrument.CurrencyId, account.CurrencyID);\r\n // }\r\n\r\n order.TradePL = tradePL;\r\n order.InterestPL = interestPL;\r\n }\r\n /// floating\r\n else if (utils.parseBoolean(order.IsOpen) && parseFloat(order.LotBalance) == 0) {\r\n order.InterestPLFloat = 0;\r\n order.StoragePLFloat = 0;\r\n order.TradePLFloat = 0;\r\n }\r\n else if (utils.parseBoolean(order.IsOpen) && parseFloat(order.LotBalance) > 0 && order.Phase == Phase.Executed) {\r\n let lotBalance = parseFloat(order.LotBalance);\r\n if (instrument.lastQuotation && !utils.isEmpty(instrument.lastQuotation.Bid) && parseInt(order.Phase) === Phase.Executed && Boolean.parseBoolean(order.IsOpen) && lotBalance > 0) {\r\n // Instrument instrument = this.OriginOrder.Transaction.Instrument;\r\n // Guid quotePolicyId = settingsManager.GetAccountQuotePolicyId(this.OriginOrder.Transaction.Account.Id, this.OriginOrder.Transaction.Instrument.SettingsInstrument.Id);\r\n // Common.Quotation quotation = instrument.GetQuotation(quotePolicyId);\r\n\r\n // Phase == undefined means order in placing confirmation \r\n let isPayoff = (order.Phase == undefined ? utils.isEmpty(order.Period) : Math.abs(order.PaidPledgeBalance) == Math.abs(order.PhysicalOriginValueBalance));\r\n\r\n let quotation = instrument.quotations[account.UseQuotePolicyId];\r\n if (!quotation) {\r\n quotation = instrument.quotations[account.PublicQuotePolicyId];\r\n }\r\n let buy = utils.parseBoolean(instrument.IsNormal) ? quotation.Bid : quotation.Ask; // instrument.Bid : instrument.Ask;\r\n let sell = utils.parseBoolean(instrument.IsNormal) ? quotation.Ask : quotation.Bid; //instrument.Ask : instrument.Bid;\r\n\r\n if (!buy && !sell)\r\n return;\r\n\r\n let close;\r\n if (utils.parseBoolean(order.IsBuy)) {\r\n close = buy;\r\n buy = order.ExecutePrice;\r\n sell = close;\r\n }\r\n else {\r\n close = sell;\r\n buy = close;\r\n sell = order.ExecutePrice;\r\n }\r\n\r\n let interestPLFloat = lotBalance * parseFloat(order.InterestPerLot);\r\n let storagePLFloat = lotBalance * parseFloat(order.StoragePerLot);\r\n\r\n if (buy == null) buy = order.ExecutePrice;\r\n if (sell == null) sell = order.ExecutePrice;\r\n if (close == null) close = order.ExecutePrice;\r\n\r\n\r\n let numerator = 1; // instrument.NumeratorUnit;\r\n let denominator = instrument.Denominator;\r\n let buyPrice = Price.GetPrice(buy.toString(), numerator, denominator);\r\n if (buyPrice == null) {\r\n debugger;\r\n }\r\n buy = Price.GetPrice(buy.toString(), numerator, denominator).ToDouble();\r\n sell = Price.GetPrice(sell.toString(), numerator, denominator).ToDouble();\r\n close = Price.GetPrice(close.toString(), numerator, denominator).ToDouble();\r\n order.LivePrice = close;\r\n\r\n let tradePLFloat = 0;\r\n let instrumentCategory = order.Transaction ? order.Transaction.InstrumentCategory : order.InstrumentCategory;\r\n if (instrumentCategory == InstrumentCategory.Forex\r\n || (order.PhysicalTradeSide == PhysicalTradeSide.ShortSell)\r\n || (instrumentCategory == InstrumentCategory.Physical && !isPayoff)) {\r\n tradePLFloat = calculateTradePL(parseFloat(buy), parseFloat(sell), parseFloat(close), parseInt(instrument.TradePLFormula), lotBalance, parseFloat(order.Transaction.ContractSize));\r\n }\r\n\r\n if (utils.parseBoolean(account.IsMultiCurrency)) {\r\n let currency = model.currencies[instrument.CurrencyId];\r\n let decimals = currency.Decimals;\r\n\r\n interestPLFloat = Math.round2(interestPLFloat, decimals);\r\n storagePLFloat = Math.round2(storagePLFloat, decimals);\r\n tradePLFloat = Math.round2(tradePLFloat, decimals);\r\n // console.log('calculateOrderFloating order.tradePLFloat', tradePLFloat);\r\n }\r\n else {\r\n // Guid sourceCurrencyId = instrument.CurrencyId;\r\n // Guid targetCurrencyId = this.OriginOrder.Transaction.Account.SettingsAccount.CurrencyId;\r\n\r\n // CurrencyRate currencyRate = settingsManager.GetCurrencyRate(sourceCurrencyId, targetCurrencyId);\r\n\r\n interestPLFloat = model.exchangeRate(interestPLFloat, instrument.CurrencyId, account.CurrencyID);\r\n storagePLFloat = model.exchangeRate(storagePLFloat, instrument.CurrencyId, account.CurrencyID);\r\n tradePLFloat = model.exchangeRate(tradePLFloat, instrument.CurrencyId, account.CurrencyID);\r\n }\r\n\r\n order.InterestPLFloat = interestPLFloat;\r\n order.StoragePLFloat = storagePLFloat;\r\n order.TradePLFloat = tradePLFloat;\r\n\r\n calculateMarketValue(model, instrument, order);\r\n } else {\r\n\r\n order.InterestPLFloat = 0;\r\n order.StoragePLFloat = 0;\r\n order.TradePLFloat = 0;\r\n }\r\n }\r\n}\r\n\r\nexport function getOrderTypeLanguageKey(order) {\r\n if (order.Transaction.OrderType == OrderType.SpotTrade) {\r\n return \"MainView.OrderType_Spot\";\r\n } else if (order.Transaction.OrderType == OrderType.Market) {\r\n return \"MainView.OrderType_Market\";\r\n } else if (order.Transaction.Type == TransactionType.OneCancelOther) {\r\n return (order.TradeOption == TradeOption.Better ? \"MainView.LimitOfOCO\" : \"MainView.StopOfOCO\");\r\n } else {\r\n return order.TradeOption == TradeOption.Better ? \"MainView.OrderType_Limit\" : \"MainView.OrderType_Stop\";\r\n };\r\n\r\n}\r\n\r\nexport function isAcceptedNewLimitPosition(account, instrument, isOpen, isBuy, lot, exceptOrderId) {\r\n let tradePolicyDetail = account.TradePolicyDetails[instrument.Id];\r\n if (!tradePolicyDetail) return false;\r\n if (tradePolicyDetail.IsAcceptNewLimit == AcceptNewLimitStop.AllowAll) {\r\n return true;\r\n }\r\n\r\n let buyLot = 0, sellLot = 0;\r\n\r\n if (instrument.openPositions) {\r\n Object.values(instrument.openPositions).forEach((order) => {\r\n if (order.Transaction.AccountID == account.Id) {\r\n if (Boolean.parseBoolean(order.IsBuy) == isBuy) {\r\n buyLot += parseFloat(order.LotBalance);\r\n }\r\n else {\r\n sellLot += parseFloat(order.LotBalance);\r\n }\r\n }\r\n });\r\n\r\n Object.values(instrument.orders).forEach((order) => {\r\n if ((order.Transaction.Phase == Phase.Placed || order.Transaction.Phase == Phase.Placing)\r\n && order.Transaction.AccountID == account.Id\r\n && (order.TradeOption == TradeOption.Better\r\n || (!Boolean.parseBoolean(tradePolicyDetail.IsAcceptNewMOOMOC) && (order.Transaction.OrderType == OrderType.MarketOnOpen || order.Transaction.OrderType == OrderType.MarketOnClose)))\r\n && (exceptOrderId && !exceptOrderId.indexOf(order.Id) > 0)) {\r\n if (Boolean.parseBoolean(order.IsBuy) == isBuy) {\r\n buyLot += parseFloat(order.Lot);\r\n }\r\n else {\r\n sellLot += parseFloat(order.Lot);\r\n }\r\n }\r\n });\r\n }\r\n if (isOpen) {\r\n if (tradePolicyDetail.IsAcceptNewLimit == AcceptNewLimitStop.AllowNewForHedgingOnly) {\r\n let net = isBuy ? sellLot - buyLot : buyLot - sellLot;\r\n return lot <= net;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else // openClose == OpenClose.Close\r\n {\r\n if (tradePolicyDetail.IsAcceptNewLimit == AcceptNewLimitStop.DissallowNewHedgeButAcceptUnLock) {\r\n return true;\r\n }\r\n else {\r\n if (isBuy) // buy close\r\n {\r\n return (sellLot > buyLot && lot <= (sellLot - buyLot));\r\n }\r\n else // sell close\r\n {\r\n return (buyLot > sellLot && lot <= (buyLot - sellLot));\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function isAcceptedNewStopPosition(account, instrument, isOpen, isBuy, lot, exceptOrderId) {\r\n let tradePolicyDetail = account.TradePolicyDetails[instrument.Id];\r\n if (tradePolicyDetail.IsAcceptNewStop == AcceptNewLimitStop.AllowAll) {\r\n return true;\r\n }\r\n\r\n let buyLot = 0, sellLot = 0;\r\n if (instrument.openPositions) {\r\n Object.values(instrument.openPositions).forEach((order) => {\r\n if (order.Transaction.AccountID == account.Id) {\r\n if (Boolean.parseBoolean(order.IsBuy) == isBuy) {\r\n buyLot += parseFloat(order.LotBalance);\r\n }\r\n else {\r\n sellLot += parseFloat(order.LotBalance);\r\n }\r\n }\r\n })\r\n\r\n Object.values(instrument.orders).forEach((order) => {\r\n if ((order.Transaction.Phase == Phase.Placed || order.Transaction.Phase == Phase.Placing)\r\n && order.Transaction.AccountID == account.Id\r\n && (order.TradeOption == TradeOption.Stop\r\n || (!Boolean.parseBoolean(tradePolicyDetail.IsAcceptNewMOOMOC) && (order.Transaction.OrderType == OrderType.MarketOnOpen || order.Transaction.OrderType == OrderType.MarketOnClose)))\r\n && (exceptOrderId && !exceptOrderId.indexOf(order.Id) >= 0)) {\r\n if (Boolean.parseBoolean(order.IsBuy) == isBuy) {\r\n buyLot += parseFloat(order.Lot);\r\n }\r\n else {\r\n sellLot += parseFloat(order.Lot);\r\n }\r\n }\r\n });\r\n }\r\n if (isOpen) {\r\n if (tradePolicyDetail.IsAcceptNewStop == AcceptNewLimitStop.AllowNewForHedgingOnly) {\r\n let net = isBuy ? sellLot - buyLot : buyLot - sellLot;\r\n return lot <= net;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n else // openClose == OpenClose.Close\r\n {\r\n if (tradePolicyDetail.IsAcceptNewStop == AcceptNewLimitStop.DissallowNewHedgeButAcceptUnLock) {\r\n return true;\r\n }\r\n else {\r\n if (isBuy) // buy close\r\n {\r\n return (sellLot > buyLot && lot <= (sellLot - buyLot));\r\n }\r\n else // sell close\r\n {\r\n return (buyLot > sellLot && lot <= (buyLot - sellLot));\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\nexport function getWorkingListPhaseClassName(phase) {\r\n switch (parseInt(phase)) {\r\n case Phase.Placed:\r\n return 'placedColor';\r\n case Phase.Placing:\r\n return 'placingColor';\r\n case Phase.Canceled:\r\n return 'canceledColor';\r\n default:\r\n return undefined;\r\n }\r\n\r\n}\r\n\r\n// export function calculateCommission(model, instrument, order, feeCalculateType) {\r\n// console.log('calculateCommission');\r\n// let account = model.selectedAccount;\r\n// let commission = 0;\r\n// let instrumentId = instrument.Id;\r\n// let isCommission = (feeCalculateType == FeeCalculateType.Commission || feeCalculateType == FeeCalculateType.EstimateCloseCommission);\r\n\r\n// let commissionFormula = isCommission ? parseInt(instrument.CommissionFormula) : parseInt(instrument.LevyFormula);\r\n// let tradePLFormula = parseInt(instrument.TradePLFormula);\r\n\r\n// let quotePolicyId = (account.UseQuotePolicyId ? account.UseQuotePolicyId : account.PublicQuotePolicyId);\r\n// let quotation = instrument.lastQuotation; //.quotations(quotePolicyId);\r\n\r\n// let tradePolicyDetail = account.TradePolicyDetails[instrument.Id];\r\n// let rateCommission = parseFloat(isCommission ? account.RateCommission : account.RateLevy);\r\n// let tradePolicyId = tradePolicyDetail.TradePolicyId;\r\n// let contractSize = (order.Transaction ? order.Transaction.ContractSize : parseFloat(order.ContractSize));\r\n// let executePrice = parseFloat(utils.isEmpty(order.ExecutePrice) ? order.SetPrice : order.ExecutePrice);\r\n\r\n// let commissionCloseD = parseFloat(isCommission ? tradePolicyDetail.CommissionCloseD : tradePolicyDetail.LevyClose);\r\n// let commissionCloseO = parseFloat(isCommission ? tradePolicyDetail.CommissionCloseO : tradePolicyDetail.LevyClose);\r\n// let commissionClose = 0;\r\n\r\n// let pairRelationFactor = 1;\r\n// // if (this.OriginOrder.Transaction.Type == TransactionType.Pair && tradePolicyDetail.PairRelationFactor != null)\r\n// // {\r\n// // pairRelationFactor = tradePolicyDetail.PairRelationFactor.Value;\r\n// // }\r\n\r\n// // if (transaction.ExecuteTime < settingsManager.TradeDay.BeginTime)\r\n// // {\r\n// // commissionClose = commissionCloseO * pairRelationFactor;\r\n// // }\r\n// // else\r\n// // {\r\n// commissionClose = commissionCloseD * pairRelationFactor;\r\n// //}\r\n\r\n// let lotBalance = parseFloat(order.LotBalance == undefined ? order.Lot : order.LotBalance);\r\n// let commission2 = commissionClose * rateCommission;\r\n// switch (commissionFormula) {\r\n// case FeeFormula.FixedAmount:\r\n// commission = commission2 * lotBalance;\r\n// break;\r\n// case FeeFormula.CS:\r\n// commission = commission2 * lotBalance * contractSize;\r\n// break;\r\n// case FeeFormula.CSDividePrice:\r\n// commission = commission2 * lotBalance * contractSize / executePrice;\r\n// break;\r\n// case FeeFormula.CSMultiplyPrice:\r\n// commission = commission2 * lotBalance * contractSize * executePrice;\r\n// break;\r\n// case FeeFormula.Pips:\r\n// let buy = 0;\r\n// let sell = 0;\r\n// let close = 0;\r\n// if (tradePLFormula == 2) {\r\n// buy = executePrice + parseFloat(commissionClose);\r\n// close = sell = executePrice;\r\n// }\r\n// else {\r\n// close = buy = executePrice;\r\n// sell = executePrice + parseFloat(commissionClose);\r\n// }\r\n// //commission = this.CalculateTradePL(buy, sell, close);\r\n// commission = calculateTradePL(buy, sell, close, tradePLFormula, lotBalance, contractSize);\r\n// break;\r\n// case FeeFormula.PricePips:\r\n// commission = 0;\r\n// break;\r\n// case FeeFormula.RealizedLoss:\r\n// calculateOrderFloating(model, instrument, order);\r\n// // this.CalculatePLFloat(settingsManager);\r\n// commission = (this.TradePLFloat < 0 ? commission2 * this.TradePLFloat : 0);\r\n// break;\r\n// case FeeFormula.RealizedProfit:\r\n// // this.CalculatePLFloat(settingsManager);\r\n// calculateOrderFloating(model, instrument, order);\r\n// commission = (this.TradePLFloat > 0 ? commission2 * this.TradePLFloat : 0);\r\n// break;\r\n// case FeeFormula.RealizedPL:\r\n// // this.CalculatePLFloat(settingsManager);\r\n// calculateOrderFloating(model, instrument, order);\r\n// commission = commission2 * Math.abs(this.TradePLFloat);\r\n// break;\r\n// case FeeFormula.SharedPL:\r\n// // this.CalculatePLFloat(settingsManager);\r\n// calculateOrderFloating(model, instrument, order);\r\n// commission = commission2 * this.TradePLFloat;\r\n// break;\r\n// default:\r\n\r\n// }\r\n\r\n// if (isCommission) {\r\n// if (commissionFormula < FeeFormula.PricePips)//5--->Price Pips\r\n// {\r\n// if (commission >= 0) {\r\n// let minCommission = parseFloat(tradePolicyDetail.MinCommissionClose);\r\n// commission = Math.max(minCommission, commission);\r\n// }\r\n// }\r\n// if (feeCalculateType == FeeCalculateType.Commission) {\r\n// order.CommissionSum = commission;\r\n// }\r\n// else if (commissionFormula < FeeFormula.RealizedLoss || commissionFormula > FeeFormula.SharedPL) {\r\n// order.EstimateCloseCommission = commission;\r\n// }\r\n// }\r\n// else {\r\n// if (feeCalculateType == FeeCalculateType.Levy) {\r\n// order.LevySum = commission;\r\n// }\r\n// else if (commissionFormula < FeeFormula.RealizedLoss || commissionFormula > FeeFormula.SharedPL) {\r\n// order.EstimateCloseLevy = commission;\r\n// }\r\n// }\r\n// }\r\n\r\n","import { InstrumentCategory, OrderType, PhysicalTradeSide, Phase, ExpireType } from '../common/const';\r\nimport { calculateOrderFloating } from './orderHelper.js';\r\nimport { calculateMarketValue } from './physicalHelper.js';\r\nimport * as utils from \"../common/utils\";\r\n\r\nexport function bindFunctions(instrument) {\r\n instrument.isPhysical = isPhysical.bind(instrument);\r\n instrument.getOrderTypes = getOrderTypes.bind(instrument);\r\n instrument.calculateFloating = calculateFloating.bind(instrument);\r\n instrument.formatRearPrice = formatRearPrice.bind(instrument);\r\n instrument.needQuote = needQuote.bind(instrument);\r\n instrument.getAvailableOrderTypes = getAvailableOrderTypes.bind(instrument);\r\n // instrument.calculatePhysical = calculatePhysical.bind(instrument);\r\n}\r\n\r\nfunction needQuote(dealLot) {\r\n let orderTypes = this.getAvailableOrderTypes();\r\n let isMarket = orderTypes.indexOf(OrderType.Market) >= 0;\r\n console.log(this.dealingPolicyDetail);\r\n return !isMarket && (parseFloat(dealLot) > (!this.dealingPolicyDetail ? parseFloat(this.DQQuoteMinLot) : parseFloat(this.dealingPolicyDetail.DQQuoteMinLot)));\r\n}\r\n\r\nfunction formatRearPrice(price1, price2) {\r\n if (utils.isEmpty(price1) || utils.isEmpty(price2)) {\r\n return '';\r\n }\r\n\r\n let differenceIndex = price1.length - 2;\r\n if (price1.length <= 2){ \r\n differenceIndex = 0;\r\n }else{\r\n for (let index = 0; index < price1.length; index++){\r\n if (price1.substr(index,1) != price2.substr(index,1)){\r\n differenceIndex = index;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n let startOf = price1.length - parseInt(this.RearPrice);\r\n if(startOf > differenceIndex) {\r\n startOf = differenceIndex;\r\n }\r\n if (startOf < 0) {\r\n startOf = 0;\r\n }else if(startOf > price1.length){\r\n startOf = price1.length;\r\n }\r\n\r\n let rearPrice = price2.substring(startOf);\r\n if (rearPrice.startsWith(\".\")) {\r\n startOf--;\r\n if (startOf < 0) startOf = 0;\r\n\r\n rearPrice = price2.substring(startOf);\r\n }\r\n return utils.format(\"{0}/{1}\", price1, rearPrice);\r\n}\r\n\r\nfunction isPhysical() {\r\n return (parseInt(this.Category) === InstrumentCategory.Physical);\r\n}\r\n\r\nfunction orderTypeToMask(orderType) {\r\n if (orderType == OrderType.SpotTrade) {\r\n return 1;\r\n }\r\n else if (orderType == OrderType.Limit\r\n || orderType == OrderType.Stop\r\n || orderType == OrderType.StopLimit) {\r\n return 2;\r\n }\r\n else if (orderType == OrderType.Market\r\n //|| orderType == OrderType.FAK_Market\r\n || orderType == OrderType.MarketToLimit) {\r\n return 4;\r\n }\r\n else if (orderType == OrderType.MarketOnOpen) {\r\n return 8;\r\n }\r\n else if (orderType == OrderType.MarketOnClose) {\r\n return 16;\r\n }\r\n else if (orderType == OrderType.OneCancelOther) {\r\n return 32;\r\n }\r\n else if (orderType == OrderType.BinaryOption) {\r\n return 128;\r\n }\r\n else {\r\n return -1;\r\n }\r\n}\r\n\r\nfunction getOrderTypes() {\r\n let result = [];\r\n let orderTypeMask = parseInt(this.OrderTypeMask);\r\n\r\n if (Boolean.parseBoolean(this.IsActive)) {\r\n for (let value = 0; value <= 32; value++) {\r\n let mask = orderTypeToMask(value);\r\n if ((mask & orderTypeMask) === mask) {\r\n result.push(value);\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\n\r\nfunction calculateFloating(model) {\r\n this.TradePLFloat = 0;\r\n this.InterestPLFloat = 0;\r\n this.StoragePLFloat = 0;\r\n\r\n this.totalBuyLot = 0.0;\r\n this.totalSellLot = 0.0;\r\n this.averageBuyPrice = '';\r\n this.averageSellPrice = '';\r\n\r\n let totalBuyPrice = 0;\r\n let totalSellPrice = 0;\r\n\r\n // let totalBuyLot = 0;\r\n // let totalSellLot = 0; \r\n\r\n if (this.openPositions) {\r\n // console.log('instrument.calculateFloating');\r\n let openPositions = Object.values(this.openPositions)\r\n //let orders = Object.values(this.orders);\r\n openPositions.forEach((order, index) => {\r\n let isBuy = Boolean.parseBoolean(order.IsBuy);\r\n if (isBuy) {\r\n this.totalBuyLot += parseFloat(order.LotBalance);\r\n totalBuyPrice += (parseFloat(order.ExecutePrice) * parseFloat(order.LotBalance));\r\n } else {\r\n this.totalSellLot += parseFloat(order.LotBalance);\r\n totalSellPrice += (parseFloat(order.ExecutePrice) * parseFloat(order.LotBalance));\r\n }\r\n // if (Boolean.parseBoolean(order.IsOpen) && parseFloat(order.LotBalance) > 0 && order.Phase == Phase.Executed) {\r\n calculateOrderFloating(model, this, order);\r\n if (order.TradePLFloat) this.TradePLFloat += parseFloat(order.TradePLFloat);\r\n if (order.InterestPLFloat) this.InterestPLFloat += order.InterestPLFloat;\r\n if (order.StoragePLFloat) this.StoragePLFloat += order.StoragePLFloat;\r\n\r\n if (order.MarketValue) this.MarketValue += order.MarketValue;\r\n if (order.UnpaidAmount) this.UnpaidAmount += order.UnpaidAmount;\r\n if (order.PedgeAmount) this.PedgeAmount += order.PedgeAmount;\r\n // } \r\n });\r\n }\r\n\r\n // this.totalBuyLot = totalBuyLot;\r\n // this.totalSellLot = totalSellLot;\r\n this.averageBuyPrice = totalBuyPrice > 0 ? utils.formatPrice(totalBuyPrice / this.totalBuyLot, this.Denominator) : '';\r\n this.averageSellPrice = totalSellPrice > 0 ? utils.formatPrice(totalSellPrice / this.totalSellLot, this.Denominator) : '';\r\n}\r\n\r\nfunction getAvailableOrderTypes() {\r\n /// DealingPolicyDetail dealingPolicyDetail = this.TradingConsole.SettingsManager.GetDealingPolicyDetail(settingsInstrument.Id); \r\n\r\n let maxDQLot = parseFloat(this.MaxDQLot);\r\n let maxOtherLot = parseFloat(this.MaxOtherLot);\r\n\r\n if (this.dealingPolicyDetail != undefined) {\r\n maxDQLot = parseFloat(this.dealingPolicyDetail.MaxDQLot);\r\n maxOtherLot = parseFloat(this.dealingPolicyDetail.MaxOtherLot);\r\n }\r\n\r\n let result = [];\r\n this.getOrderTypes().forEach((orderType, index) => {\r\n if (orderType === OrderType.SpotTrade || orderType === OrderType.Market) {\r\n if (maxDQLot > 0) result.push(orderType);\r\n }\r\n else if (orderType === OrderType.Limit && maxOtherLot > 0) {\r\n if (maxOtherLot > 0) result.push(orderType);\r\n } else {\r\n result.push(orderType);\r\n }\r\n });\r\n return result;\r\n}\r\n\r\n// function calculateNecessary(model, account) {\r\n// // Contract.CalculateMargin in silverlight\r\n// //buyMarginSum, out decimal sellMarginSum, out decimal buySum, out decimal sellSum, out decimal physcialUnPaidBuyMarginSum, out decimal physcialUnPaidBuySum, out decimal physcialPaidPledgeSellMarginSum, out decimal physcialPaidPledgeSellSum\r\n// let buyMarginSum = sellMarginSum = buySum = sellSum = physcialUnPaidBuyMarginSum = physcialUnPaidBuySum = physcialPaidPledgeSellMarginSum = physcialPaidPledgeSellSum = 0;\r\n// let instrument = this.OriginOrder.Transaction.Instrument;\r\n// if (instrument.openPositions) {\r\n// Object.values(instrument.openPositions).forEach((order) => {\r\n\r\n// let contractSize = order.ContractSize;\r\n\r\n// let sourceCurrencyId = instrument.CurrencyId;\r\n// let targetCurrencyId = (utils.parseBoolean(account.IsMultiCurrency) ? sourceCurrencyId : account.CurrencyId);\r\n// let decimals = model.currencies(targetCurrencyId).Decimals;\r\n// let quotePolicyId = (utils.parseBoolean(account.UseQuotePolicyId) ? account.UseQuotePolicyId : account.PublicQuotePolicyId);\r\n// let quotation = instrument.quotations ? instrument.quotations[quotePolicyId] : instrument.lastQuotation;\r\n\r\n// let buy = (utils.parseBoolean(instrument.IsNormal) ? quotation.Bid : quotation.Ask);\r\n// let sell = (utils.parseBoolean(instrument.IsNormal) ? quotation.Ask : quotation.Bid);\r\n\r\n// let close = (utils.parseBoolean(order.IsBuy) ? buy : sell);\r\n\r\n \r\n// // if (order.Phase == Common.Phase.Canceled)\r\n// // continue;\r\n// let marginm = 0;\r\n// if ((instrument.MarginFormula == 6 || instrument.MarginFormula == 7)\r\n// && (util.isEmpty(close)) {\r\n// marginm = 0;\r\n// }\r\n// else {\r\n// marginm = CalculateMargin(instrument.MarginFormula, order.LotBalance, contractSize,\r\n// (instrument.MarginFormula == 6 || instrument.MarginFormula == 7) ? close : order.ExecutePrice,\r\n// currencyRate, decimals);\r\n// }\r\n// if (order.BuySell == BuySell.Buy) {\r\n// if (order.OpenClose == OpenClose.Open) {\r\n// if (this.OriginOrder.Transaction.InstrumentCategory == TradingConsole.Silverlight.Common.InstrumentCategory.Physical) {\r\n// if (!this.IsPayoff) {\r\n// physcialUnPaidBuyMarginSum += marginm;\r\n// physcialUnPaidBuySum += this.LotBalance;\r\n// }\r\n// }\r\n// else {\r\n// buyMarginSum += marginm;\r\n// buySum += this.LotBalance * contractSize;\r\n// }\r\n// }\r\n// }\r\n// else {\r\n// if (order.OpenClose == OpenClose.Open) {\r\n// if (this.OriginOrder.Transaction.InstrumentCategory == TradingConsole.Silverlight.Common.InstrumentCategory.Physical\r\n// && order.PaidPledgeBalance != null && order.PaidPledgeBalance.Value != 0) {\r\n// physcialPaidPledgeSellMarginSum += marginm;\r\n// physcialPaidPledgeSellSum += this.LotBalance;\r\n// }\r\n// else {\r\n// sellMarginSum += marginm;\r\n// sellSum += this.LotBalance * contractSize;\r\n// }\r\n// }\r\n// }\r\n \r\n\r\n// if ((instrument.SettingsInstrument.MarginFormula == 6 || instrument.SettingsInstrument.MarginFormula == 7)\r\n// && (close == null)) {\r\n// if (this.OriginOrder.BuySell == BuySell.Buy) {\r\n// if (this.OriginOrder.OpenClose == OpenClose.Open) {\r\n// if (this.OriginOrder.Transaction.InstrumentCategory == TradingConsole.Silverlight.Common.InstrumentCategory.Physical) {\r\n// if (!this.IsPayoff) {\r\n// physcialUnPaidBuyMarginSum += this.Necessary;\r\n// }\r\n// }\r\n// else {\r\n// buyMarginSum += this.Necessary;\r\n// }\r\n// }\r\n// }\r\n// else {\r\n// if (this.OriginOrder.OpenClose == OpenClose.Open) {\r\n// if (this.OriginOrder.Transaction.InstrumentCategory == TradingConsole.Silverlight.Common.InstrumentCategory.Physical\r\n// && this.OriginOrder.PaidPledgeBalance != null && this.OriginOrder.PaidPledgeBalance.Value != 0) {\r\n// physcialPaidPledgeSellMarginSum += this.Necessary;\r\n// }\r\n// else\r\n// sellMarginSum += this.Necessary;\r\n// }\r\n// }\r\n// }\r\n// });\r\n// }\r\n// // endof Contract.CalculateMargin in silverlight\r\n\r\n// let useNightNecessaryWhenBreak = utils.parseBoolean(model.settingData.SystemParameter.UseNightNecessaryWhenBreak);\r\n \r\n// decimal netNecessary = 0;\r\n// decimal hedgeNecessary = 0;\r\n// if (instrument.MarginFormula == 2 || instrument.MarginFormula == 3 ||\r\n// instrument.MarginFormula == 6 || instrument.MarginFormula == 7 ||\r\n// instrument.MarginFormula == 8 || instrument.MarginFormula == 9 ||\r\n// instrument.MarginFormula == 10 || instrument.MarginFormula == 11) {\r\n// decimal buyAvarage = buySum == 0 ? 0 : buyMarginSum / buySum;\r\n// decimal sellAvarage = sellSum == 0 ? 0 : sellMarginSum / sellSum;\r\n// decimal hedge = Math.Min(buySum, sellSum);\r\n// decimal netAvarage = buySum > sellSum ? buyAvarage : sellAvarage;\r\n// decimal net = Math.Abs(buySum - sellSum);\r\n\r\n// bool useDayNecessary = this.ShouldUseDayNecessary(DateTime.Now, useNightNecessaryWhenBreak);\r\n// decimal rateMarginD = useDayNecessary ? account.RateMarginD : account.RateMarginO;\r\n// decimal rateMarginLockD = useDayNecessary ? account.RateMarginLockD : account.RateMarginLockO;\r\n// decimal marginD = useDayNecessary ? tradePolicyDetail.MarginD : tradePolicyDetail.MarginO;\r\n// decimal marginLockedD = useDayNecessary ? tradePolicyDetail.MarginLockedD : tradePolicyDetail.MarginLockedO;\r\n\r\n// netNecessary = rateMarginD * marginD * net * netAvarage;\r\n\r\n// if (instrument.MarginFormula == 8) {\r\n// hedgeNecessary = rateMarginLockD * marginLockedD * hedge * Math.Max(buyAvarage, sellAvarage);\r\n// }\r\n// else if (instrument.MarginFormula == 10) {\r\n// hedgeNecessary = rateMarginLockD * marginLockedD * hedge * Math.Min(buyAvarage, sellAvarage);\r\n// }\r\n// else if (instrument.MarginFormula == 9) {\r\n// hedgeNecessary = rateMarginLockD * marginLockedD * hedge * Math.Max((decimal)tradingInstrument.Ask, (decimal)tradingInstrument.Bid);\r\n// }\r\n// else if (instrument.MarginFormula == 11) {\r\n// hedgeNecessary = rateMarginLockD * marginLockedD * hedge * Math.Min((decimal)tradingInstrument.Ask, (decimal)tradingInstrument.Bid);\r\n// }\r\n// else {\r\n// hedgeNecessary = rateMarginLockD * marginLockedD * hedge * (buyAvarage + sellAvarage);\r\n// }\r\n// }\r\n// else if (instrument.MarginFormula == 0 || instrument.MarginFormula == 1) {\r\n// if (this.ShouldUseDayNecessary(DateTime.Now, useNightNecessaryWhenBreak)) {\r\n// if (instrument.MarginFormula == 0 && tradePolicyDetail.VolumeNecessaryId != null)\r\n// netNecessary = this.CalculateVolumeNecessary(settingsManager, tradePolicyDetail, account.RateMarginD, tradePolicyDetail.MarginD, Math.Abs(buyMarginSum - sellMarginSum), true);\r\n// else\r\n// netNecessary = account.RateMarginD * tradePolicyDetail.MarginD * Math.Abs(buyMarginSum - sellMarginSum);\r\n// hedgeNecessary = account.RateMarginLockD * tradePolicyDetail.MarginLockedD * Math.Min(buyMarginSum, sellMarginSum);\r\n// }\r\n// else {\r\n// if (instrument.MarginFormula == 0 && tradePolicyDetail.VolumeNecessaryId != null)\r\n// netNecessary = this.CalculateVolumeNecessary(settingsManager, tradePolicyDetail, account.RateMarginO, tradePolicyDetail.MarginO, Math.Abs(buyMarginSum - sellMarginSum), false);\r\n// else\r\n// netNecessary = account.RateMarginO * tradePolicyDetail.MarginO * Math.Abs(buyMarginSum - sellMarginSum);\r\n// hedgeNecessary = account.RateMarginLockO * tradePolicyDetail.MarginLockedO * Math.Min(buyMarginSum, sellMarginSum);\r\n// }\r\n// }\r\n// else {\r\n// throw new Exception(string.Format(\"Invalid Instrument MarginFormula found, referInstrument Id:{0}, MarginFormula{1}\", instrument.Id, instrument.MarginFormula));\r\n// }\r\n// return netNecessary + hedgeNecessary;\r\n// }","import moment from 'moment';\r\nimport React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport XMLParser from 'react-xml-parser';\r\nimport axios from 'axios';\r\nimport cookie from 'react-cookies';\r\nimport { message as antMessage } from 'antd';\r\n\r\n\r\nimport * as utils from '../common/utils.js';\r\nimport * as instrumentExtension from './instrumentextension';\r\nimport { CooKey, TransactionType, TransactionSubType, OrderType, PlacingSettingType, InstrumentCategory, TradeOption, AllowIfDoneType, UserRelation, Phase, PhysicalTradeSide, DeliveryRequestStatus, ScrapDepositStatus, InventoryInProcessStatus, PhysicalInstalmentType, InstalmentFrequence, RecalculateRateType, PriceAlertState, PopMessageType, InstrumentStatus, PendingOrderExpireType, ExpireType, UpdateAction, MarketInfoType, AllowCloseInstalment, PaymentForm, FeeCalculateType, AdministrationFeeBaseType } from '../common/const';\r\nimport { getDownpaymentSettings, calculatePhysicalValue, calculateDiscount } from './physicalHelper';\r\nimport { calculateCommission, calculateOrderFloating } from '../model/orderHelper.js'\r\nimport xml2json from 'xml-js';\r\n\r\nexport function bindFunctions(model, commService, showLoadingSpin, showModalDialog, t) {\r\n model.commService = commService;\r\n model.config = commService.state.config;\r\n loadUserConfig(model.config);\r\n model.showLoadingSpin = showLoadingSpin;\r\n model.showModalDialog = showModalDialog;\r\n model.logs = [];\r\n\r\n model.t = t;\r\n model.isLogedin = isLogedin.bind(model);\r\n model.processCommand = processCommand.bind(model);\r\n model.processSettingData = processSettingData.bind(model);\r\n model.processTradingCommand = processTradingCommand.bind(model);\r\n model.processCommandTransaction = processCommandTransaction.bind(model);\r\n\r\n model.resetAlertLevel = resetAlertLevel.bind(model);\r\n model.calculateFloating = calculateFloating.bind(model);\r\n model.exchangeRate = exchangeRate.bind(model);\r\n\r\n model.allowTrading = allowTrading.bind(model);\r\n model.canPlaceOrder = canPlaceOrder.bind(model);\r\n model.canPlaceIfDoneOrder = canPlaceIfDoneOrder.bind(model);\r\n model.canPlaceOcoOrder = canPlaceOcoOrder.bind(model);\r\n model.buildTransactions = buildTransactions.bind(model);\r\n model.buildPlacingData = buildPlacingData.bind(model);\r\n model.buildPlacingPhysicalOptions = buildPlacingPhysicalOptions.bind(model);\r\n model.calcPhysicalMarketValue = calcPhysicalMarketValue.bind(model);\r\n model.calculatePhysicalPaymentDiscount = calculatePhysicalPaymentDiscount.bind(model);\r\n model.setTransactionPhysicalOptions = setTransactionPhysicalOptions.bind(model);\r\n\r\n model.buildDefaultOrder = buildDefaultOrder.bind(model);\r\n model.buildDefaultTransaction = buildDefaultTransaction.bind(model);\r\n\r\n model.getServerTime = getServerTime.bind(model);\r\n model.getPricingPolicyDetail = getPricingPolicyDetail.bind(model);\r\n model.getExpireTypes = getExpireTypes.bind(model);\r\n model.getInstalmentPolicyDetail = getInstalmentPolicyDetail.bind(model);\r\n model.getPaymentParameter = getPaymentParameter.bind(model);\r\n model.isValidWithdrawTime = isValidWithdrawTime.bind(model);\r\n model.resetInput = resetInput.bind(model);\r\n model.getMaxCloseLot = getMaxCloseLot.bind(model);\r\n model.switchQuotationMarketInfo = switchQuotationMarketInfo.bind(model);\r\n model.refreshAllowedCloseLot = refreshAllowedCloseLot.bind(model);\r\n model.hasPhysicalInstruments = hasPhysicalInstruments.bind(model);\r\n model.hasForexInstruments = hasForexInstruments.bind(model);\r\n model.startDqPriceCountDown = startDqPriceCountDown.bind(model);\r\n model.orderingNotify = orderingNotify.bind(model);\r\n model.uploadFile = uploadFile.bind(model);\r\n}\r\n\r\nfunction loadUserConfigItem(config, key, propName) {\r\n let data = cookie.load(key);\r\n if (data) config.setValue(propName, data);\r\n}\r\n\r\nfunction loadUserConfig(config) {\r\n if (!config.getValue('quotationRiseForeColor')) config.setValue('quotationRiseForeColor', 'white');\r\n if (!config.getValue('quotationFallForeColor')) config.setValue('quotationFallForeColor', 'white');\r\n\r\n loadUserConfigItem(config, CooKey.QuotationRiseColor, 'quotationRiseColor');\r\n loadUserConfigItem(config, CooKey.QuotationRiseForeColor, 'quotationRiseForeColor');\r\n loadUserConfigItem(config, CooKey.QuotationFallColor, 'quotationFallColor');\r\n loadUserConfigItem(config, CooKey.QuotationFallForeColor, 'quotationFallForeColor');\r\n loadUserConfigItem(config, CooKey.MarketInfoType, 'MarketInfoType');\r\n}\r\n\r\nfunction isLogedin() {\r\n return this.loginResult && this.loginResult.isLogedin && !this.commService.isDisconnected();\r\n}\r\n\r\nfunction processCommand(data) {\r\n console.log('processCommand', data);\r\n if (!this.accounts) return;\r\n\r\n if (data.Account) {\r\n this.processTradingCommand(data.Account);\r\n } else if (data.SettingSource) {\r\n this.processSettingData(data.SettingSource);\r\n } else if (data.Messages) {\r\n utils.forceToArray(data.Messages.Message).forEach((message, index) => {\r\n this.messages[message.Id] = message;\r\n\r\n let popMessage = {\r\n type: PopMessageType.Message,\r\n onCancelClick: function (callback) {\r\n console.info('onCancelClick');\r\n },\r\n onOkClick: function (callback) {\r\n this.popMessages.shift();\r\n this.selectedMessage = message;\r\n if (callback) callback();\r\n },\r\n content:
\r\n
DialogWindow.ReceiveMessage
\r\n
{message.Title}
\r\n
\r\n };\r\n\r\n if (this.popMessages === undefined) {\r\n this.popMessages = [];\r\n }\r\n this.popMessages.unshift(popMessage);\r\n });\r\n } else if (data.Log) {\r\n\r\n this.commService.getLogData(data.Log.QtAppId, this.loginResult.loginParam.language, (jsonMessage) => {\r\n console.log(jsonMessage);\r\n if (!this.logsCache || this.logsCache.length > 50) {\r\n delete this.logsCache;\r\n this.logsCache = [];\r\n }\r\n if (this.logsCache.indexOf(jsonMessage) >= 0) {\r\n return;\r\n } else {\r\n this.logsCache.unshift(jsonMessage);\r\n }\r\n\r\n let d = JSON.parse(jsonMessage);\r\n if (d.Result.error) {\r\n console.error(d.Result.error);\r\n } else {\r\n let logData = d.Result.content_result.Log;\r\n logData.id = data.Log.QtAppId;\r\n if (!this.logs) {\r\n this.logs = [];\r\n }\r\n\r\n if (logData.Action.indexOf('') >= 0) {\r\n try {\r\n // let contentPrefix = '';\r\n let style1Position = logData.Action.indexOf('');\r\n let action = logData.Action;\r\n if (style1Position >= 0) { // dispense this kind log\r\n // contentPrefix = logData.Action.substring(0, style1Position)\r\n action = logData.Action.substring(style1Position);\r\n }\r\n /// User xxx Receive notification:\r\n logData.titleNotify = (style1Position > 0 ? logData.Action.substring(0, style1Position) : '');\r\n\r\n let arr = undefined;\r\n try {\r\n arr = JSON.parse(action.replace('', '\",\"').replace('', '[\"').replace('', '\"]'));\r\n logData.title = arr[0].substring(16);\r\n logData.content = arr[1];\r\n\r\n } catch (e) {\r\n arr = logData.Action.split('');\r\n logData.title = arr[0].substring(arr[0].indexOf('') + 25); // arr[0].replace('', '');\r\n if (logData.title.lastIndexOf(' ') > 0) {\r\n logData.title = logData.title.substring(logData.title.lastIndexOf(' '));\r\n }\r\n logData.content = arr[1];\r\n if (arr.length > 2) {\r\n logData.content += arr[2].replace('', ' ');\r\n }\r\n }\r\n\r\n // this.logs[data.Log.QtAppId] = logData.Result.content_result.Log; \r\n logData.time = logData.Time.substring(10);\r\n\r\n // if (style1Position <= 0) {\r\n this.logs.unshift(logData);\r\n // }\r\n\r\n } catch (e) {\r\n console.error(logData, e);\r\n\r\n }\r\n\r\n } else {\r\n console.warn(logData);\r\n logData.title = logData.Time;\r\n logData.content = logData.Action;\r\n this.logs.unshift(logData);\r\n }\r\n\r\n }\r\n });\r\n } else if (data.PriceAlerts) {\r\n console.log(data.PriceAlerts);\r\n utils.forceToArray(data.PriceAlerts.PriceAlert).forEach((triggeredAlert) => {\r\n if (parseInt(triggeredAlert.State) == PriceAlertState.Hit) {\r\n triggeredAlert.ID = triggeredAlert.Id;\r\n triggeredAlert.ModifyFlag = \"2\";\r\n triggeredAlert.UserID = this.loginResult.UserId;\r\n\r\n let priceAlert = this.priceAlerts[triggeredAlert.Id]\r\n if (priceAlert) {\r\n let instrument = this.instruments[priceAlert.InstrumentId];\r\n let popMessage = {\r\n type: PopMessageType.PriceAlert,\r\n onOkClick: function (callback) {\r\n let alerts = { PriceAlert: triggeredAlert };\r\n this.commService.updatePriceAlerts(utils.convertToXml(alerts, \"PriceAlerts\").toString(), (d) => {\r\n\r\n let data = JSON.parse(d);\r\n if (data.Result && data.Result.content_result && data.Result.content_result === 'true') {\r\n\r\n delete this.priceAlerts[alerts.PriceAlert.ID];\r\n this.popMessages.shift();\r\n this.popMessages.length = 0;\r\n if (callback) {\r\n callback();\r\n }\r\n } else {\r\n antMessage.info(d);\r\n }\r\n });\r\n },\r\n content:
\r\n
{instrument.Description} DialogWindow.PriceAlertHit
\r\n
{utils.getConditionLanguage(priceAlert.Condition)} {triggeredAlert.HitPrice}
\r\n
DialogWindow.isTriggered
\r\n
\r\n };\r\n\r\n if (this.popMessages === undefined) {\r\n this.popMessages = [];\r\n }\r\n this.popMessages.push(popMessage);\r\n }\r\n }\r\n });\r\n\r\n } else if (data.SettingUpdate) {\r\n if (data.SettingUpdate.InstrumentStatuses) {\r\n utils.forceToArray(data.SettingUpdate.InstrumentStatuses.InstrumentStatus).forEach((idStatus) => {\r\n let instrument = this.instruments[idStatus.Id];\r\n if (instrument) {\r\n instrument.status = parseInt(idStatus.Value);\r\n }\r\n });\r\n }\r\n } else if (data.InstrumentDailyCloseQuotations) {\r\n utils.forceToArray(data.InstrumentDailyCloseQuotations.InstrumentDailyCloseQuotation).forEach((dayQuotation) => {\r\n dayQuotation.Timestamp = new Date(2011, 3, 1, 0, 0, data.InstrumentDailyCloseQuotations.TimeStamp, 0);\r\n let instrument = this.instruments[dayQuotation.InstrumentId];\r\n if (instrument) {\r\n if (!instrument.quotations) instrument.quotations = {};\r\n let quotation = instrument.quotations[dayQuotation.QuotePolicyId];\r\n if (quotation) {\r\n let timestamp = quotation.Timestamp;\r\n Object.assign(quotation, dayQuotation); //assign AskOpen, Open, etc\r\n // if (timestamp > quotation.Timestamp) { // when first price open, InstrumentDailyCloseQuotation command may arrived after quotationCommand, and timestamp is less than quotationCommand\r\n quotation.Timestamp = timestamp;\r\n // }\r\n } else {\r\n instrument.quotations[dayQuotation.QuotePolicyId] = dayQuotation;\r\n }\r\n }\r\n });\r\n }\r\n}\r\n\r\n\r\nexport function processSettingData(settingData) {\r\n console.log('processSettingData started.');\r\n console.log(settingData);\r\n let model = this;\r\n if (!model.settingData) model.settingData = settingData;\r\n\r\n let action = settingData.UpdateAction;\r\n\r\n let oldCustomer = { ...this.settingData.Customer };\r\n if (settingData.Customer) {\r\n if (!model.customer) {\r\n model.customer = settingData.Customer;\r\n } else if (model.customer.Id == settingData.Customer.Id) {\r\n // if(oldCustomer.DealingPolicyId != settingData.Customer.DealingPolicyId && model.instruments){\r\n // Object.values(model.instruments).forEach((instrument) => {\r\n // if(utils.isEmpty(settingData.Customer.DealingPolicyId)){\r\n // delete instrument.dealingPolicyDetail;\r\n // }else{\r\n\r\n // }\r\n\r\n // });\r\n // }\r\n Object.assign(model.customer, settingData.Customer);\r\n }\r\n }\r\n if (!this.customer) return;\r\n\r\n if (settingData.Instruments) {\r\n utils.forceToArray(settingData.Instruments.Instrument).forEach((instrument, index) => {\r\n if (!model.instruments) model.instruments = {};\r\n\r\n if (!model.instruments[instrument.Id]) {\r\n model.instruments[instrument.Id] = instrument;\r\n } else {\r\n Object.assign(model.instruments[instrument.Id], instrument);\r\n }\r\n\r\n Object.values(model.instruments).forEach((instrument) => {\r\n instrumentExtension.bindFunctions(instrument);\r\n });\r\n });\r\n }\r\n\r\n if (settingData.Accounts) {\r\n // this.state.ServerData.accounts = utils.forceToArray(settingData.Accounts.Account);\r\n if (!model.accounts) {\r\n model.accounts = {};\r\n }\r\n\r\n utils.forceToArray(settingData.Accounts.Account).forEach((account) => {\r\n account.ID = account.Id;\r\n account.CurrencyID = account.CurrencyId;\r\n if (action == undefined || action == UpdateAction.Init || action == UpdateAction.Add) {\r\n if (model.accounts[account.Id]) {\r\n Object.assign(model.accounts[account.Id], account);\r\n } else {\r\n model.accounts[account.Id] = account;\r\n }\r\n }\r\n\r\n if (action == UpdateAction.Modify && model.accounts[account.Id] /* && !utils.isEmpty(account.QuotePolicyId) */) {\r\n // model.accounts[account.Id].UseQuotePolicyId = account.QuotePolicyId;\r\n window.location.assign('#/');\r\n window.location.reload();\r\n }\r\n\r\n if (!model.selectedAccount) {\r\n model.selectedAccount = model.accounts[account.Id];\r\n }\r\n\r\n });\r\n\r\n // if (model.selectedAccount) {\r\n // let accountQuotePolicyId = (model.selectedAccount.UseQuotePolicyId ? model.selectedAccount.UseQuotePolicyId : model.selectedAccount.PublicQuotePolicyId);\r\n // Object.values(model.instruments).forEach((instrument) => {\r\n // if (instrument.quotations) {\r\n // Object.values(instrument.quotations).forEach((quotation) => {\r\n // if (quotation.QuotePolicyId == accountQuotePolicyId) {\r\n // instrument.quotation = instrument.lastQuotation = quotation;\r\n // }\r\n // });\r\n // }\r\n // });\r\n // }\r\n }\r\n\r\n if (settingData.InterestRates) {\r\n if (!model.interestRates) model.interestRates = {};\r\n utils.forceToArray(settingData.InterestRates.InterestRate).forEach((interestRate) => {\r\n model.interestRates[interestRate.InterestRateId] = interestRate;\r\n });\r\n }\r\n\r\n if (model.selectedAccount && settingData.TradePolicyDetails) {\r\n\r\n if (!model.selectedAccount.TradePolicyDetails) model.selectedAccount.TradePolicyDetails = {};\r\n let policies = utils.forceToArray(settingData.TradePolicyDetails.TradePolicyDetail);\r\n\r\n policies.forEach((tradePolicyDetail) => {\r\n if (action == UpdateAction.Initialize || action == UpdateAction.Add || action == UpdateAction.Modify) {\r\n if (tradePolicyDetail.TradePolicyId === model.selectedAccount.TradePolicyId) {\r\n model.selectedAccount.TradePolicyDetails[tradePolicyDetail.InstrumentId] = tradePolicyDetail;\r\n }\r\n } else if (settingData.UpdateAction == UpdateAction.Delete) {\r\n // let instrument = model.instruments[tradePolicyDetail.InstrumentId];\r\n delete model.selectedAccount.TradePolicyDetails[tradePolicyDetail.InstrumentId];\r\n for (let i = model.orderedInstruments.length - 1; i >= 0; i--) {\r\n let oi = model.orderedInstruments[i];\r\n if (oi.Id == tradePolicyDetail.InstrumentId) {\r\n model.orderedInstruments.splice(i, 1);\r\n }\r\n };\r\n // delete model.instrumentCodeDict[instrument.Code];\r\n // delete model.instruments[tradePolicyDetail.InstrumentId];\r\n // delete model.instrumentSequenceDict[instrument.GuidMappingValue];\r\n }\r\n });\r\n\r\n\r\n }\r\n\r\n if (settingData.DealingPolicyDetails) {\r\n if (!model.settingData.DealingPolicyDetails) {\r\n model.settingData.DealingPolicyDetails = settingData.DealingPolicyDetails;\r\n } else {\r\n Object.assign(model.settingData.DealingPolicyDetails, settingData.DealingPolicyDetails);\r\n }\r\n if (!this.customer.dealingPolicyDetails) {\r\n this.customer.dealingPolicyDetails = {};\r\n }\r\n\r\n utils.forceToArray(model.settingData.DealingPolicyDetails.DealingPolicyDetail).forEach((dealingPolicyDetail, index) => {\r\n if (dealingPolicyDetail.DealingPolicyId == this.customer.DealingPolicyId) {\r\n this.customer.dealingPolicyDetails[dealingPolicyDetail.InstrumentId] = dealingPolicyDetail;\r\n }\r\n });\r\n\r\n }\r\n\r\n if ((oldCustomer && oldCustomer.DealingPolicyId != this.customer.DealingPolicyId) || settingData.DealingPolicyDetails) {\r\n utils.forceToArray(model.settingData.DealingPolicyDetails.DealingPolicyDetail).forEach((dealingPolicyDetail) => {\r\n if (dealingPolicyDetail.DealingPolicyId == this.customer.DealingPolicyId && dealingPolicyDetail.InstrumentId) {\r\n this.customer.dealingPolicyDetails[dealingPolicyDetail.InstrumentId] = dealingPolicyDetail;\r\n }\r\n });\r\n\r\n Object.values(model.instruments).forEach((instrument) => {\r\n if (utils.isEmpty(this.customer.DealingPolicyId)) {\r\n delete instrument.dealingPolicyDetail;\r\n } else {\r\n\r\n instrument.dealingPolicyDetail = this.customer.dealingPolicyDetails[instrument.Id];\r\n console.log(instrument.Description, instrument.dealingPolicyDetail == undefined ? 'no dealingPolicyDetail' : instrument.dealingPolicyDetail.DealingPolicyId);\r\n }\r\n });\r\n\r\n }\r\n\r\n if (settingData.PricingPolicyDetails) {\r\n let pricingPolicyDetails = utils.forceToArray(settingData.PricingPolicyDetails.PricingPolicyDetail).sort((a, b) => {\r\n return parseFloat(a.Price) - parseFloat(b.Price);\r\n });\r\n\r\n\r\n //let pricingPolicyDict = {};\r\n if (!model.pricingPolicyDict) model.pricingPolicyDict = {};\r\n\r\n pricingPolicyDetails.forEach((detail, index) => {\r\n let list = model.pricingPolicyDict[detail.PricingPolicyId];\r\n if (!list) {\r\n list = []; //new Array(); \r\n model.pricingPolicyDict[detail.PricingPolicyId] = list;\r\n }\r\n list.push(detail);\r\n });\r\n // model.pricingPolicyDict = pricingPolicyDict;\r\n }\r\n\r\n if (!model.instalmentPolicies) model.instalmentPolicies = {};\r\n if (settingData.InstalmentPolicies) {\r\n utils.forceToArray(settingData.InstalmentPolicies.InstalmentPolicy).forEach((instalmentPolicy, index) => {\r\n model.instalmentPolicies[instalmentPolicy.Id] = instalmentPolicy;\r\n instalmentPolicy.details = {};\r\n });\r\n }\r\n\r\n if (settingData.InstalmentPolicyDetails) {\r\n utils.forceToArray(settingData.InstalmentPolicyDetails.InstalmentPolicyDetail).forEach((instalmentPolicyDetail, index) => {\r\n let policy = model.instalmentPolicies[instalmentPolicyDetail.InstalmentPolicyId];\r\n if (policy != undefined) {\r\n policy.details[instalmentPolicyDetail.Frequence.toString() + '_' + instalmentPolicyDetail.Period.toString()] = instalmentPolicyDetail;\r\n }\r\n });\r\n }\r\n\r\n if (!model.deliverySpecificationDetails) model.deliverySpecificationDetails = {};\r\n if (settingData.DeliverySpecificationDetails) {\r\n utils.forceToArray(settingData.DeliverySpecificationDetails.DeliverySpecificationDetail).forEach((deliverySpecificationDetail, index) => {\r\n let specificationDetails = model.deliverySpecificationDetails[deliverySpecificationDetail.DeliverySpecificationId];\r\n if (specificationDetails === undefined) {\r\n specificationDetails = {};\r\n model.deliverySpecificationDetails[deliverySpecificationDetail.DeliverySpecificationId] = specificationDetails;\r\n }\r\n specificationDetails[deliverySpecificationDetail.Size] = deliverySpecificationDetail;\r\n });\r\n }\r\n\r\n if (!model.deliveryCharges) model.deliveryCharges = {};\r\n if (settingData.DeliveryCharges) {\r\n utils.forceToArray(settingData.DeliveryCharges.DeliveryCharge).forEach((deliveryCharge, index) => {\r\n model.deliveryCharges[deliveryCharge.Id] = deliveryCharge;\r\n });\r\n }\r\n\r\n\r\n if (!model.physicalPaymentDiscounts) model.physicalPaymentDiscounts = {};\r\n if (settingData.PhysicalPaymentDiscounts) {\r\n utils.forceToArray(settingData.PhysicalPaymentDiscounts.PhysicalPaymentDiscount).forEach((physicalPaymentDiscount, index) => {\r\n physicalPaymentDiscount.details = [];\r\n model.physicalPaymentDiscounts[physicalPaymentDiscount.Id] = physicalPaymentDiscount;\r\n });\r\n\r\n if (settingData.PhysicalPaymentDiscountDetails) {\r\n utils.forceToArray(settingData.PhysicalPaymentDiscountDetails.PhysicalPaymentDiscountDetail).sort((a, b) => parseFloat(a.From) - parseFloat(b.From)).forEach((detail, index) => {\r\n model.physicalPaymentDiscounts[detail.PhysicalPaymentDiscountId].details.push(detail);\r\n });\r\n }\r\n }\r\n\r\n\r\n if (!model.administrativeCharges) model.administrativeCharges = {};\r\n if (settingData.AdministrativeCharges) {\r\n utils.forceToArray(settingData.AdministrativeCharges.AdministrativeCharge).forEach((administrativeCharge, index) => {\r\n administrativeCharge.details = [];\r\n model.administrativeCharges[administrativeCharge.Id] = administrativeCharge;\r\n });\r\n\r\n if (settingData.AdministrativeChargeDetails) {\r\n utils.forceToArray(settingData.AdministrativeChargeDetails.AdministrativeChargeDetail).sort((a, b) => parseFloat(a.Quantity) - parseFloat(b.Quantity)).forEach((detail, index) => {\r\n model.administrativeCharges[detail.AdministrativeChargeId].details.push(detail);\r\n });\r\n }\r\n }\r\n\r\n if (settingData.InstrumentUnits) {\r\n if (!model.instrumentUnits) model.instrumentUnits = {};\r\n\r\n utils.forceToArray(settingData.InstrumentUnits.InstrumentUnit).forEach((instrumentUnit, index) => {\r\n model.instrumentUnits[instrumentUnit.Id] = instrumentUnit;\r\n });\r\n }\r\n if (settingData.SystemParameter) {\r\n model.settingData.SystemParameter = settingData.SystemParameter;\r\n }\r\n\r\n if (settingData.Organizations) {\r\n if (!model.organizations) model.organizations = {};\r\n\r\n utils.forceToArray(settingData.Organizations.Organization).forEach((organization) => {\r\n model.organizations[organization.Id] = organization;\r\n });\r\n }\r\n console.log('processSettingData completed.');\r\n}\r\n\r\nfunction resetAlertLevel() {\r\n debugger;\r\n if (utils.parseBoolean(this.settingData.SystemParameter.AllowTraderResetAlertLevel) && parseFloat(this.selectedAccount.ForbiddenAlert) <= 0) {\r\n this.commService.resetAlertLevel(this.selectedAccount.Id, this.selectedAccount.Code, (d) => {\r\n console.log(d);\r\n });\r\n }\r\n}\r\n\r\nfunction processTradingCommand(data) {\r\n if (!this.accounts) return;\r\n\r\n let account = this.accounts[data.ID];\r\n if (this.selectedAccount.ID == data.ID && parseFloat(data.AlertLevel) > 0 && (parseFloat(account.AlertLevel) < parseFloat(data.AlertLevel) || utils.isEmpty(account.AlertLevel))) {\r\n this.showModalDialog(utils.format2(this.t('DialogWindow.AccountMarginNotify'), account.Code), this.resetAlertLevel, { hideCancelButton: true, modelDialogTitle:
DialogWindow.Warning
});\r\n }\r\n\r\n if (data.AlertLevel != undefined) account.AlertLevel = data.AlertLevel;\r\n if (data.AlertTime != undefined) account.AlertTime = data.AlertTime;\r\n if (data.RealAlertLevel != undefined) account.RealAlertLevel = data.RealAlertLevel;\r\n if (data.Version != undefined) account.Version = data.Version;\r\n if (data.CurrencyID != undefined) account.CurrencyID = data.CurrencyID;\r\n\r\n if (data.Balance) {\r\n account.Balance = data.Balance;\r\n if (data.Necessary != undefined) account.Necessary = data.Necessary;\r\n if (data.Equity != undefined) account.Euity = data.Equity;\r\n\r\n if (data.Funds && data.Funds.Fund) {\r\n utils.forceToArray(data.Funds.Fund).forEach((fund) => {\r\n let accountFund = account.funds[fund.CurrencyID];\r\n if (!accountFund) {\r\n accountFund = fund;\r\n account.funds[fund.CurrencyID] = accountFund;\r\n }\r\n if (fund.Balance != undefined) {\r\n accountFund.Balance = fund.Balance;\r\n this.calculateFloating();\r\n }\r\n\r\n if (fund.Necessary != undefined) accountFund.Necessary = fund.Necessary;\r\n\r\n });\r\n }\r\n }\r\n\r\n if (data.DeliveryRequests && data.DeliveryRequests.DeliveryRequest) {\r\n utils.forceToArray(data.DeliveryRequests.DeliveryRequest).forEach((deliveryRequest, index) => {\r\n let deliveryStatus = parseInt(deliveryRequest.Status);\r\n let instrument = undefined; // this.instruments[deliveryRequest.InstrumentId];\r\n if (utils.isEmpty(deliveryRequest.InstrumentId)) {\r\n Object.values(this.instruments).forEach((item) => {\r\n if (item.deliveryInProcess && item.deliveryInProcess[deliveryRequest.Id]) {\r\n instrument = item;\r\n }\r\n });\r\n } else {\r\n instrument = this.instruments[deliveryRequest.InstrumentId];\r\n }\r\n\r\n if (!instrument.deliveryInProcess) instrument.deliveryInProcess = {};\r\n\r\n let existedDeliveryRequest = instrument.deliveryInProcess[deliveryRequest.Id];\r\n if (existedDeliveryRequest) {\r\n Object.assign(existedDeliveryRequest, deliveryRequest);\r\n deliveryRequest = existedDeliveryRequest;\r\n } else {\r\n instrument.deliveryInProcess[deliveryRequest.Id] = deliveryRequest;\r\n }\r\n\r\n\r\n // if (deliveryStatus === DeliveryRequestStatus.Accepted) {\r\n\r\n // utils.forceToArray(deliveryRequest.DeliveryRequestOrderRelations.DeliveryRequestOrderRelation).forEach((deliveryRequestOrderRelation) => {\r\n // let openOrder = instrument.physicalInventory[deliveryRequestOrderRelation.OpenOrderId];\r\n // // openOrder.deliveryRequest = deliveryRequest;\r\n // openOrder.LotBalance = (parseFloat(openOrder.LotBalance) - parseFloat(deliveryRequestOrderRelation.DeliveryLot)).toFixed(4);\r\n // });\r\n // }\r\n\r\n if (deliveryStatus === DeliveryRequestStatus.Accepted || deliveryStatus === DeliveryRequestStatus.Stocked || deliveryStatus === DeliveryRequestStatus.Approved) {\r\n let settlementTime = undefined;\r\n if (deliveryStatus === DeliveryRequestStatus.Accepted || deliveryStatus === DeliveryRequestStatus.Approved) {\r\n if (deliveryRequest.DeliveryTime != null) settlementTime = deliveryRequest.DeliveryTime;\r\n }\r\n else {\r\n if (deliveryRequest.AvailableTime != null) settlementTime = deliveryRequest.AvailableTime;\r\n }\r\n\r\n // let inProcessStatus = undefined;\r\n // switch (deliveryStatus) {\r\n // case DeliveryRequestStatus.Accepted:\r\n // inProcessStatus = InventoryInProcessStatus.Submitted;\r\n // break;\r\n // case DeliveryRequestStatus.Approved:\r\n // inProcessStatus = InventoryInProcessStatus.Approved;\r\n // break;\r\n // case DeliveryRequestStatus.Stocked:\r\n // inProcessStatus = InventoryInProcessStatus.StockIsAvailable;\r\n // break;\r\n // case DeliveryRequestStatus.Delivered:\r\n // inProcessStatus = InventoryInProcessStatus.DeliveryCompletede;\r\n // break;\r\n // case DeliveryRequestStatus.Canceled:\r\n // inProcessStatus = InventoryInProcessStatus.Canceled;\r\n // break;\r\n // default:\r\n // }\r\n\r\n deliveryRequest.SettlementTime = settlementTime;\r\n if (!deliveryRequest.AccountID) {\r\n deliveryRequest.AccountID = deliveryRequest.AccountId;\r\n }\r\n // deliveryRequest.Status = inProcessStatus;\r\n\r\n\r\n }\r\n });\r\n }\r\n\r\n if (data.Transactions && data.Transactions.Transaction) {\r\n this.processCommandTransaction(data.Transactions.Transaction);\r\n }\r\n\r\n}\r\n\r\nfunction processCommandTransaction(transactions) {\r\n console.log('processCommandTransaction', transactions);\r\n utils.forceToArray(transactions).forEach((transaction, i) => {\r\n let existingTran = this.selectedAccount.transactions ? this.selectedAccount.transactions[transaction.ID] : undefined;\r\n\r\n if (existingTran) {\r\n let orderArray = existingTran.Orders.Order;\r\n let orders = existingTran.orders;\r\n Object.assign(existingTran, transaction);\r\n if (transaction.Orders && transaction.Orders.Order) {\r\n utils.forceToArray(transaction.Orders.Order).forEach((order) => {\r\n let existingOrder = orders[order.ID];\r\n if (existingOrder) {\r\n Object.assign(existingOrder, order);\r\n } else {\r\n orders[order.ID] = order;\r\n }\r\n if (order.OrderRelations && order.OrderRelations.OrderRelation) {\r\n let instrument = this.instruments[existingTran.InstrumentID];\r\n utils.forceToArray(order.OrderRelations.OrderRelation).forEach((relation) => {\r\n if (instrument && instrument.orderRelations) {\r\n let existsRelation = instrument.orderRelations[relation.ID];\r\n if (existsRelation) {\r\n Object.assign(existsRelation, relation);\r\n Object.assign(relation, existsRelation); // replace relation to merged result\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n existingTran.orders = orders;\r\n } else {\r\n if (!this.selectedAccount.transactions) {\r\n this.selectedAccount.transactions = {};\r\n }\r\n this.selectedAccount.transactions[transaction.ID] = transaction;\r\n transaction.orders = {};\r\n existingTran = transaction;\r\n\r\n }\r\n\r\n\r\n\r\n if (this.placingData !== undefined && this.placingData.transactions !== undefined && this.placingData.transactions.length > 0\r\n && this.placingData.transactions[0].ID === transaction.ID) {\r\n Object.assign(this.placingData.transactions[0], transaction);\r\n }\r\n\r\n\r\n let instrument = this.instruments[existingTran.InstrumentID];\r\n if (transaction.Orders && transaction.Orders.Order) {\r\n utils.forceToArray(transaction.Orders.Order).forEach((order, i) => {\r\n order.Transaction = existingTran;\r\n let existingOrder = existingTran.orders[order.ID];\r\n\r\n if (existingOrder) {\r\n Object.assign(existingOrder, order);\r\n } else {\r\n existingOrder = order;\r\n existingTran.orders[order.ID] = order;\r\n }\r\n\r\n\r\n if (this.placingData !== undefined && this.placingData.transactions !== undefined && this.placingData.transactions.length > 0) {\r\n\r\n this.placingData.transactions.forEach((placingTran) => {\r\n if (placingTran.ID === transaction.ID) {\r\n placingTran.Order.forEach((placingOrder) => {\r\n if (placingOrder.ID === order.ID) {\r\n Object.assign(placingOrder, existingTran.orders[order.ID]);\r\n }\r\n })\r\n // Object.assign(this.placingData.transactions[0].Order[0], order);\r\n\r\n }\r\n });\r\n\r\n }\r\n\r\n if (existingTran.AccountID === this.selectedAccount.Id && existingTran.Orders.Order) {\r\n\r\n if (instrument) {\r\n if (!instrument.orders) instrument.orders = {};\r\n if (!instrument.orderRelations) instrument.orderRelations = {};\r\n\r\n instrument.orders[existingOrder.ID] = existingOrder;\r\n if (this.isTradingDataLoaded) {\r\n if (Boolean.parseBoolean(existingOrder.IsOpen)) {\r\n existingOrder.selectedLot = existingOrder.allowedCloseLot = this.getMaxCloseLot(instrument, existingOrder);\r\n } else {\r\n if (existingOrder.OrderRelations && existingOrder.OrderRelations.OrderRelation) {\r\n utils.forceToArray(existingOrder.OrderRelations.OrderRelation).forEach((relation) => {\r\n instrument.orderRelations[relation.ID] = relation;\r\n if (instrument.openPositions) {\r\n let openOrder = instrument.openPositions[relation.OpenOrderID];\r\n if (openOrder) {\r\n openOrder.selectedLot = openOrder.allowedCloseLot = this.getMaxCloseLot(instrument, openOrder);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n if (instrument.workingList) {\r\n Object.values(instrument.workingList).forEach((doneOrder) => {\r\n if (doneOrder.Transaction.AssigningOrderID == existingOrder.ID && (doneOrder.Phase == Phase.Placed || doneOrder.Phase == Phase.Placing)) {\r\n if (doneOrder.TradeOption == TradeOption.Better) {\r\n existingOrder.doneLimitPrice = doneOrder.SetPrice;\r\n } else if (doneOrder.TradeOption == TradeOption.Stop) {\r\n existingOrder.doneStopPrice = doneOrder.SetPrice;\r\n }\r\n }\r\n });\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n let isFromCommand = this.isTradingDataLoaded;\r\n if (isFromCommand || order.Phase == Phase.Placing || order.Phase == Phase.Placed) { // called from command\r\n if (order.Code) { // is submited order, not affected order\r\n if (!instrument.workingList) { instrument.workingList = {}; }\r\n instrument.workingList[existingOrder.ID] = existingOrder;\r\n }\r\n }\r\n let lotBalance = parseFloat(existingOrder.LotBalance);\r\n if (!existingOrder.deliveryLotInProcess) {\r\n existingOrder.deliveryLotInProcess = 0;\r\n }\r\n existingOrder.LotBalance = existingOrder.lotBalanceIncludeDelivery = lotBalance.toFixed(4); //\r\n calculateOrderFloating(this, instrument, existingOrder);\r\n if ((parseInt(existingTran.Phase) === Phase.Executed && parseInt(existingOrder.Phase) === Phase.Executed) || (parseInt(existingTran.Phase) === Phase.Completed && parseInt(existingOrder.Phase) === Phase.Completed)) {\r\n if (parseInt(instrument.Category) === InstrumentCategory.Physical) {\r\n if (!instrument.physicalInventory) instrument.physicalInventory = {};\r\n if (!instrument.physicalShortSell) instrument.physicalShortSell = {};\r\n\r\n if (lotBalance <= 0) {\r\n if (instrument.physicalInventory[existingOrder.ID]) {\r\n if (parseInt(existingOrder.PhysicalTradeSide) === PhysicalTradeSide.ShortSell) {\r\n delete instrument.physicalShortSell[existingOrder.ID];\r\n } else {\r\n delete instrument.physicalInventory[existingOrder.ID];\r\n }\r\n }\r\n } else if (lotBalance > 0) {\r\n if (parseInt(existingOrder.PhysicalTradeSide) === PhysicalTradeSide.ShortSell) {\r\n instrument.physicalShortSell[existingOrder.ID] = existingOrder;\r\n } else {\r\n instrument.physicalInventory[existingOrder.ID] = existingOrder;\r\n }\r\n }\r\n } // else \r\n\r\n if (!instrument.openPositions) { instrument.openPositions = {}; }\r\n // if (instrument.workingList && instrument.workingList[existingOrder.ID]) {\r\n // delete instrument.workingList[existingOrder.ID];\r\n // }\r\n\r\n if (instrument.openPositions[existingOrder.ID] && existingOrder.LotBalance <= 0) {\r\n delete instrument.openPositions[existingOrder.ID];\r\n } else if (existingOrder.LotBalance > 0) {\r\n instrument.openPositions[existingOrder.ID] = existingOrder;\r\n\r\n // if (!existingOrder.isSelected || existingOrder.selectedLot >= parseFloat(existingOrder.LotBalance)) {\r\n // existingOrder.selectedLot = parseFloat(existingOrder.LotBalance);\r\n // }\r\n }\r\n }\r\n\r\n }\r\n }\r\n }); // transaction.Orders.Order.forEach\r\n }\r\n\r\n if (instrument) {\r\n instrument.calculateFloating(this);\r\n }\r\n\r\n });\r\n\r\n\r\n Object.values(this.instruments).forEach((instrument) => {\r\n if (instrument.orders) {\r\n Object.values(instrument.orders).forEach((order) => order.deliveryLotInProcess = 0);\r\n }\r\n\r\n });\r\n\r\n Object.values(this.instruments).forEach((instrument) => {\r\n if (instrument.deliveryInProcess && instrument.orders) {\r\n Object.values(instrument.orders).forEach((order) => order.deliveryLotInProcess = 0);\r\n\r\n Object.values(instrument.deliveryInProcess).forEach((deliveryRequest) => {\r\n let deliveryStatus = parseInt(deliveryRequest.Status);\r\n if (deliveryStatus === DeliveryRequestStatus.Accepted) {\r\n utils.forceToArray(deliveryRequest.DeliveryRequestOrderRelations.DeliveryRequestOrderRelation).forEach((deliveryRequestOrderRelation) => {\r\n let openOrder = instrument.orders[deliveryRequestOrderRelation.OpenOrderId];\r\n if (openOrder) {\r\n openOrder.deliveryLotInProcess += parseFloat(deliveryRequestOrderRelation.DeliveryLot);\r\n openOrder.deliveryLotInProcess = parseFloat(openOrder.deliveryLotInProcess.toFixed(6));\r\n } else {\r\n console.error('invalid deliveryRequestOrderRelation.OpenOrderId', deliveryRequestOrderRelation.OpenOrderId, deliveryRequestOrderRelation);\r\n }\r\n });\r\n\r\n }\r\n });\r\n }\r\n instrument.calculateFloating(this);\r\n });\r\n\r\n\r\n\r\n}\r\n\r\nfunction calculateFloating() {\r\n let model = this;\r\n if (!this.isTradingDataLoaded) return;\r\n //begin calculate account/instrument floating \r\n let accounts = Object.values(model.accounts);\r\n\r\n for (let i = 0; i < accounts.length; i++) {\r\n let tradingData = accounts[i];\r\n tradingData.TradePLFloat = 0;\r\n tradingData.InterestPLFloat = 0;\r\n tradingData.StoragePLFloat = 0;\r\n tradingData.TradePLNotValued = 0;\r\n tradingData.InterestPLNotValued = 0;\r\n tradingData.StoragePLNotValued = 0;\r\n tradingData.MarketValue = 0;\r\n tradingData.UnpaidAmount = 0;\r\n tradingData.PedgeAmount = 0;\r\n tradingData.Necessary = 0;\r\n tradingData.Equity = 0;\r\n tradingData.NetAsset = 0;\r\n tradingData.Usable = 0;\r\n tradingData.PaidPledgeBalance = 0;\r\n tradingData.Ratio = 0;\r\n\r\n\r\n if (tradingData.funds) {\r\n Object.values(tradingData.funds).forEach((fund) => {\r\n\r\n // if (fund.CurrencyID === currencyId) {\r\n fund.TradePLFloat = 0;\r\n fund.InterestPLFloat = 0;\r\n fund.StoragePLFloat = 0;\r\n // fund.TradePLNotValued = 0;\r\n // fund.InterestPLNotValued = 0;\r\n // fund.StoragePLNotValued = 0; \r\n fund.MarketValue = 0;\r\n fund.UnpaidAmount = 0;\r\n fund.PedgeAmount = 0;\r\n fund.PaidPledgeBalance = 0;\r\n //}\r\n });\r\n }\r\n }\r\n\r\n Object.values(model.instruments).forEach((instrument, index) => {\r\n\r\n instrument.calculateFloating(model);\r\n\r\n for (let i = 0; i < accounts.length; i++) {\r\n let tradingData = accounts[i];\r\n let isMultiCurrency = Boolean.parseBoolean(tradingData.IsMultiCurrency);\r\n let currencyId = (isMultiCurrency ? instrument.CurrencyId : tradingData.CurrencyID);\r\n\r\n if (tradingData.funds) {\r\n Object.values(tradingData.funds).forEach((fund) => {\r\n\r\n if (fund.CurrencyID === currencyId) {\r\n if (instrument.orders) {\r\n Object.values(instrument.orders).forEach((order) => {\r\n if (order.Transaction.AccountID === tradingData.ID && parseFloat(order.LotBalance)) {\r\n if (order.TradePLFloat) fund.TradePLFloat += parseFloat(order.TradePLFloat);\r\n if (order.InterestPLFloat) fund.InterestPLFloat += parseFloat(order.InterestPLFloat);\r\n if (order.StoragePLFloat) fund.StoragePLFloat += parseFloat(order.StoragePLFloat);\r\n if (order.MarketValue) fund.MarketValue += parseFloat(order.MarketValue);\r\n\r\n if (Math.abs(order.PaidPledgeBalance) !== Math.abs(order.PhysicalOriginValueBalance)) {\r\n fund.PaidPledgeBalance += (order.PaidPledgeBalance === undefined ? 0 : parseFloat(order.PaidPledgeBalance));\r\n fund.UnpaidAmount += (order.UnpaidAmount === undefined ? 0 : parseFloat(order.UnpaidAmount));\r\n\r\n }\r\n fund.PedgeAmount += (order.PedgeAmount === undefined ? 0 : parseFloat(order.PedgeAmount));\r\n }\r\n });\r\n }\r\n }\r\n\r\n\r\n });\r\n }\r\n\r\n\r\n }\r\n\r\n });\r\n\r\n //end calculate account/instrument floating\r\n let enableNetAsset = Boolean.parseBoolean(model.settingData.SystemParameter.EnableNetAsset);\r\n accounts.forEach((account) => {\r\n if (account.funds) {\r\n Object.values(account.funds).forEach((fund) => {\r\n fund.Necessary = parseFloat(fund.Necessary);\r\n\r\n fund.Equity = parseFloat(fund.TotalPaidAmount) + parseFloat(fund.PedgeAmount) + parseFloat(fund.Balance) + fund.TradePLFloat + fund.InterestPLFloat + fund.StoragePLFloat\r\n + parseFloat(fund.TradePLNotValued) + parseFloat(fund.InterestPLNotValued) + parseFloat(fund.StoragePLNotValued);\r\n fund.Usable = fund.Equity - fund.Necessary;\r\n if (enableNetAsset) {\r\n fund.NetAsset = fund.Equity + (fund.CurrencyID == account.CurrencyID && account.CreditAmount ? parseFloat(account.CreditAmount) : 0);\r\n }\r\n account.TradePLFloat += model.exchangeRate(fund.TradePLFloat, fund.CurrencyID, account.CurrencyID);\r\n account.InterestPLFloat += model.exchangeRate(fund.InterestPLFloat, fund.CurrencyID, account.CurrencyID);\r\n account.StoragePLFloat += model.exchangeRate(fund.StoragePLFloat, fund.CurrencyID, account.CurrencyID);\r\n\r\n account.TradePLNotValued = parseFloat(account.TradePLNotValued) + model.exchangeRate(parseFloat(fund.TradePLNotValued), fund.CurrencyID, account.CurrencyID);\r\n account.InterestPLNotValued = parseFloat(account.InterestPLNotValued) + model.exchangeRate(parseFloat(fund.InterestPLNotValued), fund.CurrencyID, account.CurrencyID);\r\n account.StoragePLNotValued = parseFloat(account.StoragePLNotValued) + model.exchangeRate(parseFloat(fund.StoragePLNotValued), fund.CurrencyID, account.CurrencyID);\r\n\r\n account.MarketValue += model.exchangeRate(fund.MarketValue, fund.CurrencyID, account.CurrencyID);\r\n account.UnpaidAmount += model.exchangeRate(fund.UnpaidAmount, fund.CurrencyID, account.CurrencyID);\r\n account.PedgeAmount += model.exchangeRate(fund.PedgeAmount, fund.CurrencyID, account.CurrencyID);\r\n account.PaidPledgeBalance += -model.exchangeRate(-fund.PaidPledgeBalance, fund.CurrencyID, account.CurrencyID);\r\n\r\n account.Necessary += model.exchangeRate(fund.Necessary, fund.CurrencyID, account.CurrencyID);\r\n account.Equity += model.exchangeRate(fund.Equity, fund.CurrencyID, account.CurrencyID);\r\n account.NetAsset += model.exchangeRate(fund.NetAsset, fund.CurrencyID, account.CurrencyID);\r\n account.Usable += model.exchangeRate(fund.Usable, fund.CurrencyID, account.CurrencyID);\r\n\r\n let equity = Boolean.parseBoolean(model.settingData.SystemParameter.RatioIncludeCredit) ? parseFloat(account.CreditAmount) + account.Equity : account.Equity;\r\n account.Ratio = (account.Necessary == 0 ? 0 : equity / account.Necessary);\r\n\r\n // account.Equity = parseFloat(account.TotalPaidAmount) + parseFloat(account.PedgeAmount) + parseFloat(account.Balance) + account.TradePLFloat + account.InterestPLFloat + account.StoragePLFloat;\r\n\r\n });\r\n }\r\n\r\n });\r\n\r\n}\r\n\r\nfunction exchangeRate(amount, sourceCurrencyId, targetCurrencyId) {\r\n if (sourceCurrencyId == targetCurrencyId) {\r\n return amount;\r\n } else {\r\n let sourceCurrency = this.currencies[sourceCurrencyId];\r\n let targetCurrency = this.currencies[targetCurrencyId];\r\n if (!sourceCurrency || !targetCurrency) debugger;\r\n let currencyRate = this.currencyRates[sourceCurrency.Id + \"_\" + targetCurrency.Id];\r\n\r\n if (!currencyRate) {\r\n antMessage.destroy();\r\n utils.logError(
Currency Rate not found!
{sourceCurrency.Name + \"/\" + targetCurrency.Name}
, 5);\r\n return 0;\r\n } else {\r\n return utils.exchangeRate(amount, currencyRate.RateIn, currencyRate.RateOut, sourceCurrency.Decimals, targetCurrency.Decimals);\r\n }\r\n }\r\n}\r\n\r\n\r\nfunction getPricingPolicyDetail(pricingPolicyId, price) {\r\n if (this.pricingPolicyDict && pricingPolicyId && pricingPolicyId.Value !== utils.uuidEmpty() && price !== 0) {\r\n let details = this.pricingPolicyDict[pricingPolicyId];\r\n if (details) {\r\n\r\n for (let i = 0; i < details.length; i++) {\r\n let detail = details[i];\r\n if (detail.Price >= parseFloat(price)) {\r\n return detail;\r\n }\r\n }\r\n\r\n if (details.length > 0) {\r\n return details[details.length - 1];\r\n }\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\n\r\nfunction getServerTime() {\r\n // return utils.getDateTimeString();\r\n let date = new Date();\r\n // date.setTime(date.getTime() + this.serverTimeDiff); \r\n // return moment(utils.getDateTimeString(date, withMilliseconds));\r\n\r\n return moment(date.getTime() + this.serverTimeDiff);\r\n}\r\n\r\n\r\n\r\nfunction allowTrading(account) {\r\n if (!utils.parseBoolean(account.IsTradingAllowed)) return false;\r\n if (utils.parseBoolean(this.customer.DisallowTrade)) return false;\r\n\r\n if (account.UserRelation == UserRelation.Manager && !utils.parseBoolean(account.AllowManagerTrading)) return false;\r\n if (account.UserRelation == UserRelation.Sales && !utils.parseBoolean(account.AllowSalesTrading)) return false;\r\n\r\n return true;\r\n}\r\n\r\nfunction canPlaceOrder(account, instrument, orderType) {\r\n if (!this.allowTrading(account)) return false;\r\n // if (!utils.parseBoolean(account.IsTradingAllowed)) return false;\r\n // if (utils.parseBoolean(this.customer.DisallowTrade)) return false;\r\n\r\n // if (account.UserRelation == UserRelation.Manager && !utils.parseBoolean(account.AllowManagerTrading)) return false;\r\n // if (account.UserRelation == UserRelation.Sales && !utils.parseBoolean(account.AllowSalesTrading)) return false;\r\n\r\n orderType = parseInt(orderType);\r\n let dealingPolicy = instrument.dealingPolicyDetail;\r\n let maxDqLot = parseFloat(dealingPolicy ? dealingPolicy.MaxDQLot : instrument.MaxDQLot);\r\n let maxOtherLot = parseFloat(dealingPolicy ? dealingPolicy.MaxOtherLot : instrument.MaxOtherLot);\r\n let orderTypes = instrument.getAvailableOrderTypes();\r\n\r\n let canPlacePendingOrderAtAnyTime = Boolean.parseBoolean(instrument.CanPlacePendingOrderAtAnyTime);\r\n if (orderTypes.indexOf(orderType) >= 0) {\r\n if (orderType === OrderType.SpotTrade || orderType === OrderType.Market) {\r\n if ((instrument.status === InstrumentStatus.DayOpen || instrument.status === InstrumentStatus.SessionOpen)\r\n && instrument.quotation !== undefined && !utils.isEmpty(instrument.quotation.Ask) && !utils.isEmpty(instrument.quotation.Bid)) {\r\n\r\n return maxDqLot > 0;\r\n }\r\n } else if (orderType === OrderType.Limit) {\r\n if ((canPlacePendingOrderAtAnyTime || instrument.status === InstrumentStatus.DayOpen || instrument.status === InstrumentStatus.SessionOpen)) {\r\n return maxOtherLot > 0;\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nfunction canPlaceIfDoneOrder(instrument, isSpotTrade) {\r\n let tradePolicyDetail = this.selectedAccount.TradePolicyDetails[instrument.Id];\r\n if (tradePolicyDetail === undefined) {\r\n return false;\r\n }\r\n else {\r\n if (isSpotTrade) {\r\n return parseInt(tradePolicyDetail.AllowIfDone2) === AllowIfDoneType.AllowAll;\r\n }\r\n else {\r\n return parseInt(tradePolicyDetail.AllowIfDone2) !== AllowIfDoneType.None;\r\n }\r\n }\r\n}\r\n\r\nfunction canPlaceOcoOrder(instrument, isOpen) {\r\n let tradePolicyDetail = this.selectedAccount.TradePolicyDetails[instrument.Id];\r\n if (tradePolicyDetail === undefined) {\r\n return false;\r\n }\r\n else {\r\n if (isOpen) {\r\n return Boolean.parseBoolean(tradePolicyDetail.AllowNewOCO);\r\n }\r\n else {\r\n let orderTypes = instrument.getAvailableOrderTypes();\r\n return (orderTypes.indexOf(OrderType.OneCancelOther) >= 0);\r\n }\r\n }\r\n}\r\n\r\nfunction CanChangeToOCO(instrument, order) {\r\n let isOpen = Boolean.parseBoolean(order.IsOpen);\r\n let availableOrderTypes = instrument.getAvailableOrderTypes();\r\n if (!isOpen)\r\n return (order.Transaction.Phase == Phase.Placing || order.Transaction.Phase == Phase.Placed)\r\n && (order.Transaction.OrderType == OrderType.Limit || order.Transaction.OrderType == OrderType.Stop)\r\n && availableOrderTypes.indexOf(order.Transaction.OrderType == OrderType.Limit ? OrderType.Stop : OrderType.Limit) >= 0\r\n && availableOrderTypes.indexOf(OrderType.OneCancelOther) >= 0;\r\n else {\r\n return (order.Transaction.Phase == Phase.Placing || order.Transaction.Phase == Phase.Placed)\r\n && (order.Transaction.OrderType == OrderType.Limit || order.Transaction.OrderType == OrderType.Stop)\r\n && availableOrderTypes.indexOf(order.Transaction.OrderType == OrderType.Limit ? OrderType.Stop : OrderType.Limit) >= 0\r\n && this.canPlaceOcoOrder(instrument, isOpen);\r\n }\r\n}\r\n\r\n\r\nfunction getExpireTypes(instrument) {\r\n let expireTypes = [];\r\n let tradePolicyDetail = this.selectedAccount.TradePolicyDetails[instrument.Id];\r\n if (tradePolicyDetail) {\r\n if (Boolean.parseBoolean(tradePolicyDetail.GoodTillMonthDayOrder)) expireTypes.push(PendingOrderExpireType.GoodTillDay);//GoodTillMonthDay Is DayOrder \r\n if (Boolean.parseBoolean(tradePolicyDetail.GoodTillMonthGTF)) expireTypes.push(PendingOrderExpireType.GoodTillFriday);\r\n if (Boolean.parseBoolean(tradePolicyDetail.GoodTillDate)) expireTypes.push(PendingOrderExpireType.GoodTillDate);\r\n if (Boolean.parseBoolean(tradePolicyDetail.GoodTillMonthSession)) expireTypes.push(PendingOrderExpireType.GoodTillSession);\r\n if (Boolean.parseBoolean(tradePolicyDetail.GoodTillMonthGTM)) expireTypes.push(PendingOrderExpireType.GoodTillMonth);\r\n }\r\n return expireTypes;\r\n}\r\n\r\nfunction buildPlacingData(instrument, selectedOrders, orderType) {\r\n let isBuy = (this.placingData && this.placingData.isBuy !== undefined ? this.placingData.isBuy : true);\r\n if (orderType === undefined) {\r\n let orderTypes = instrument.getAvailableOrderTypes();\r\n if (orderTypes.indexOf(OrderType.Market) >= 0) {\r\n orderType = OrderType.Market;\r\n } else if (orderTypes.indexOf(OrderType.SpotTrade) >= 0) {\r\n orderType = OrderType.SpotTrade;\r\n } else if (orderTypes.indexOf(OrderType.Limit) >= 0) {\r\n orderType = OrderType.Limit;\r\n }\r\n }\r\n\r\n this.placingData = {\r\n selectedInstrument: instrument,\r\n selectedOrders: selectedOrders === undefined ? [] : selectedOrders,\r\n orderType: orderType,\r\n expireTypes: this.getExpireTypes(instrument)\r\n };\r\n if (this.placingData.selectedOrders.length > 0) {\r\n this.placingData.isBuy = !Boolean.parseBoolean(this.placingData.selectedOrders[0].IsBuy);\r\n this.placingData.selectedInventory = this.placingData.selectedOrders[0]\r\n } else {\r\n this.placingData.isBuy = isBuy;\r\n }\r\n\r\n if (instrument.openPositions) {\r\n let openPositions = Object.values(instrument.openPositions);\r\n openPositions.forEach((order, index) => {\r\n order.selectedLot = order.allowedCloseLot = this.getMaxCloseLot(instrument, order);\r\n });\r\n\r\n\r\n }\r\n this.placingData.placePanelType = 0; // None \r\n return this.placingData;\r\n}\r\n\r\nfunction calcPhysicalMarketValue(paymentForm, price) {\r\n let value = 0;\r\n let model = this;\r\n let instrument = model.placingData.selectedInstrument;\r\n\r\n if (price == undefined) {\r\n if (this.placingData.orderType == OrderType.Limit) {\r\n //todo: add ordertype dropdown\r\n price = (model.placingData.physicalOptions && model.placingData.physicalOptions.TradeOption == TradeOption.Stop) ? model.placingData.stopPrice : model.placingData.limitPrice;\r\n // price = !utils.isEmpty(model.placingData.limitPrice) ? model.placingData.limitPrice : model.placingData.stopPrice;\r\n }\r\n else {\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n let buyPrice = (isNormal ? instrument.quotation.Ask : instrument.quotation.Bid);\r\n let sellPrice = (isNormal ? instrument.quotation.Bid : instrument.quotation.Ask);\r\n price = (model.placingData.isBuy ? buyPrice : sellPrice);\r\n }\r\n }\r\n\r\n if (price == 0) {\r\n value = 0;\r\n }\r\n else {\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n //if (lot == undefined) {\r\n let lot = model.placingData.lot;\r\n // }\r\n let lotInteger = parseInt(lot);\r\n let lotRemainder = lot - lotInteger;\r\n value = calculatePhysicalValue(lotInteger, lotRemainder, price, parseFloat(tradePolicyDetail.DiscountOfOdd), parseFloat(instrument.TradePLFormula), tradePolicyDetail.ContractSize);\r\n\r\n if (Boolean.parseBoolean(model.selectedAccount.IsMultiCurrency) || paymentForm == PaymentForm.FullPayment) { // full payment dont need exchange rate\r\n let currency = model.currencies[instrument.CurrencyId];\r\n value = Math.round2(value, parseInt(currency.Decimals));\r\n }\r\n else {\r\n value = model.exchangeRate(value, instrument.CurrencyId, model.selectedAccount.CurrencyId);\r\n }\r\n }\r\n // this.setState({ marketValue: value });\r\n console.log('calcPhysicalMarketValue', value);\r\n return value;\r\n}\r\n\r\nfunction buildPlacingPhysicalOptions(instalmentPolicyDetail, price, recalculateRateType) {\r\n console.log('buildPlacingPhysicalOptions');\r\n if (instalmentPolicyDetail == undefined) { // fullpayment\r\n this.placingData.physicalOptions = {};\r\n this.placingData.physicalOptions.downPayment = this.placingData.physicalOptions.marketValue = this.calcPhysicalMarketValue(PaymentForm.FullPayment);\r\n console.log('placingData.physicalOptions.marketValue', this.placingData.physicalOptions.marketValue);\r\n return;\r\n }\r\n\r\n let instrument = this.placingData.selectedInstrument;\r\n let isMultiCurrency = Boolean.parseBoolean(this.selectedAccount.IsMultiCurrency);\r\n let currency = this.currencies[isMultiCurrency ? instrument.CurrencyId : this.selectedAccount.CurrencyId];\r\n\r\n let instalmentPolicy = this.instalmentPolicies[instalmentPolicyDetail.InstalmentPolicyId];\r\n if (recalculateRateType == undefined) {\r\n recalculateRateType = (instalmentPolicy.RecalculateRateTypes & RecalculateRateType.RecalucateNextMonth) == RecalculateRateType.RecalucateNextMonth ? RecalculateRateType.RecalucateNextMonth : RecalculateRateType.RecalucateNextYear;\r\n }\r\n\r\n let downpaymentSettings = getDownpaymentSettings(instalmentPolicyDetail);\r\n let allowedInstalmentTypes = parseInt(instalmentPolicy.AllowedInstalmentTypes);\r\n let physicalInstalmentType = ((allowedInstalmentTypes & PhysicalInstalmentType.EqualInstalment) === PhysicalInstalmentType.EqualInstalment ? PhysicalInstalmentType.EqualInstalment : PhysicalInstalmentType.EqualPrincipal);\r\n\r\n let marketValue = this.calcPhysicalMarketValue();\r\n let paymentForm = (instalmentPolicyDetail.period == 1 ? PaymentForm.AdvancePayment : PaymentForm.Instalment);\r\n let discount = this.calculatePhysicalPaymentDiscount(this.selectedAccount, instrument, this.placingData.lot, marketValue, paymentForm);\r\n let advanceAmount = 0;\r\n if (parseInt(instalmentPolicyDetail.DownPaymentBasis) === 0) {\r\n advanceAmount = (marketValue * (parseFloat(downpaymentSettings.downPayment)) / 100, 4) + discount;\r\n } else {\r\n advanceAmount = parseFloat(downpaymentSettings.downPayment) * this.placingData.lot + discount;\r\n }\r\n\r\n let administrationFee = 0;\r\n if (parseInt(instalmentPolicyDetail.Period) > 1) {\r\n let downPayment = downpaymentSettings.downPayment;\r\n if (parseInt(instalmentPolicyDetail.DownPaymentBasis) === 0) {\r\n downPayment = downpaymentSettings.downPayment / 100;\r\n }\r\n if (instalmentPolicyDetail.AdministrationFeeBase == AdministrationFeeBaseType.Percentage) {\r\n administrationFee = parseFloat(parseFloat(instalmentPolicyDetail.AdministrationFee / (1 - downPayment) * 100).toFixed(2));\r\n } else {\r\n administrationFee = parseFloat(instalmentPolicyDetail.AdministrationFee);\r\n }\r\n }\r\n\r\n let result = {\r\n // price: price,\r\n marketValue: marketValue, // this.calcPhysicalMarketValue(),\r\n instalmentPolicyDetail: instalmentPolicyDetail,\r\n period: instalmentPolicyDetail.Period,\r\n frequence: instalmentPolicyDetail.Frequence,\r\n interestRate: instalmentPolicyDetail.InterestRate,\r\n currency: currency,\r\n instalmentPolicyId: instalmentPolicyDetail.InstalmentPolicyId,\r\n physicalInstalmentType: physicalInstalmentType,\r\n recalculateRateType: recalculateRateType,\r\n downPayment: instalmentPolicyDetail ? downpaymentSettings.downPayment : 0,\r\n // advanceAmount: parseFloat(advanceAmount.toFixed(4)),\r\n administrationFee: administrationFee\r\n };\r\n\r\n if (advanceAmount) {\r\n result.advanceAmount = parseFloat(advanceAmount.toFixed(4));\r\n }\r\n this.placingData.physicalOptions = result;\r\n return result;\r\n}\r\n\r\n// spottrade: dqPrices = {buyPrice, sellPrice, doneLimitPrice, doneStopPrice}\r\n// LimitStop: limitPrices/stopPrices = {setPrice, doneLimitPrice, doneStopPrice} \r\n\r\nfunction hasDonePrice(prices) {\r\n return !prices ? false : (prices.doneLimitPrice || prices.doneStopPrice);\r\n}\r\n\r\nfunction buildTransactions(instrument, transactionType, orderType, isBuy, lot, openOrders, dqPrices, limitPrices, stopPrices, expireType, expireTime, physicalOptions) {\r\n lot = parseFloat(parseFloat(lot).toFixed(6));\r\n let result = [];\r\n if (physicalOptions === undefined) {\r\n physicalOptions = this.placingData.physicalOptions;\r\n }\r\n\r\n if (expireType === undefined) {\r\n expireType = PendingOrderExpireType.GoodTillDate; // this.placingData.expireTypes[0];\r\n } else if ((orderType === OrderType.SpotTrade || orderType === OrderType.Market) && utils.isEmpty(dqPrices.doneLimitPrice) && utils.isEmpty(dqPrices.doneStopPrice)) {\r\n expireType = PendingOrderExpireType.GoodTillDate;\r\n expireTime = '';\r\n }\r\n\r\n let tran = this.buildDefaultTransaction(instrument, transactionType, orderType, expireType, expireTime, physicalOptions);\r\n if (hasDonePrice(dqPrices) || hasDonePrice(limitPrices) || hasDonePrice(stopPrices)) {\r\n tran.SubType = TransactionSubType.IfDone;\r\n }\r\n\r\n result.push(tran);\r\n let tradePolicyDetail = this.selectedAccount.TradePolicyDetails[instrument.Id];\r\n\r\n\r\n /* let tranXml = '\r\n \r\n \r\n '\r\n */\r\n let buySells = [true, false];\r\n // openoders is empty \r\n if (orderType === OrderType.SpotTrade || orderType === OrderType.Market) {\r\n if (openOrders == undefined || openOrders.length == 0) {\r\n let setPrice = (orderType === OrderType.Market ? '' : (isBuy ? dqPrices.buyPrice : dqPrices.sellPrice));\r\n let order = this.buildDefaultOrder(tradePolicyDetail, isBuy, setPrice, lot, undefined, TradeOption.Invalid, dqPrices.doneLimitPrice, dqPrices.doneStopPrice);\r\n tran.Order.push(order);\r\n } else {\r\n buySells.forEach((buySell, index) => {\r\n let buyOpenOrders = openOrders.filter((c) => Boolean.parseBoolean(c.IsBuy) == !buySell && c.isSelected);\r\n\r\n if (buyOpenOrders.length > 0) {\r\n let setPrice = (orderType === OrderType.Market ? '' : (buySell ? dqPrices.buyPrice : dqPrices.sellPrice));\r\n let sellOrder = this.buildDefaultOrder(tradePolicyDetail, buySell, setPrice, lot, buyOpenOrders);\r\n tran.Order.push(sellOrder);\r\n }\r\n });\r\n }\r\n } else if (orderType === OrderType.OneCancelOther) {\r\n if (limitPrices && limitPrices.setPrice) {\r\n let limitOrder = this.buildDefaultOrder(tradePolicyDetail, isBuy, limitPrices.setPrice, lot, openOrders, TradeOption.Better, limitPrices.doneLimitPrice, limitPrices.doneStopPrice);\r\n tran.Order.push(limitOrder);\r\n }\r\n\r\n if (stopPrices && stopPrices.setPrice) {\r\n let stopOrder = this.buildDefaultOrder(tradePolicyDetail, isBuy, stopPrices.setPrice, lot, openOrders, TradeOption.Stop, stopPrices.doneLimitPrice, stopPrices.doneStopPrice);\r\n tran.Order.push(stopOrder);\r\n }\r\n } else if (orderType === OrderType.Limit) {\r\n if (limitPrices && limitPrices.setPrice) {\r\n let limitOrder = this.buildDefaultOrder(tradePolicyDetail, isBuy, limitPrices.setPrice, lot, openOrders, TradeOption.Better, limitPrices.doneLimitPrice, limitPrices.doneStopPrice);\r\n tran.Order.push(limitOrder);\r\n }\r\n if (limitPrices && limitPrices.setPrice && stopPrices && stopPrices.setPrice) {\r\n tran = this.buildDefaultTransaction(instrument, transactionType, orderType, expireType, expireTime, physicalOptions);\r\n if (hasDonePrice(stopPrices)) {\r\n tran.SubType = TransactionSubType.IfDone;\r\n }\r\n result.push(tran);\r\n\r\n }\r\n if (stopPrices && stopPrices.setPrice) {\r\n let stopOrder = this.buildDefaultOrder(tradePolicyDetail, isBuy, stopPrices.setPrice, lot, openOrders, TradeOption.Stop, stopPrices.doneLimitPrice, stopPrices.doneStopPrice);\r\n tran.Order.push(stopOrder);\r\n }\r\n }\r\n let isPhysical = (parseInt(instrument.Category) === InstrumentCategory.Physical);\r\n // \r\n result.forEach((tran) => {\r\n if (isPhysical) {\r\n this.setTransactionPhysicalOptions(tran, physicalOptions)\r\n }\r\n\r\n let orders = (tran.orders ? Object.values(tran.orders) : tran.Order);\r\n\r\n // orders.forEach((order) => calculateCommission(this, instrument, order, FeeCalculateType.Commission));\r\n });\r\n\r\n return result;\r\n}\r\n\r\nfunction buildDefaultOrder(tradePolicyDetail, isBuy, setPrice, lot, openOrders, tradeOption, doneLimitPrice, doneStopPrice, physicalOptions, contractSize) {\r\n let isOpen = (openOrders == undefined || openOrders.length === 0);\r\n let order = {\r\n ID: utils.uuid(),\r\n TradeOption: (tradeOption === undefined ? 0 : tradeOption),\r\n DQMaxMove: this.placingData && this.placingData.pips ? this.placingData.pips : 0,\r\n IsOpen: isOpen,\r\n IsBuy: isBuy,\r\n PhysicalTradeSide: isBuy ? 1 : 0,\r\n SetPrice: setPrice,\r\n SetPrice2: \"\",\r\n Lot: lot,\r\n OriginalLot: lot,\r\n ContractSize: tradePolicyDetail.ContractSize\r\n }\r\n if (isOpen) {\r\n if (doneLimitPrice || doneStopPrice) {\r\n let doneLimitPriceNode = utils.isEmpty(doneLimitPrice) ? '' : utils.format('LimitPrice=\"{0}\"', doneLimitPrice);\r\n let doneStopPriceNode = utils.isEmpty(doneStopPrice) ? '' : utils.format('StopPrice=\"{0}\"', doneStopPrice);\r\n order.Extension = utils.format('', doneLimitPriceNode, doneStopPriceNode);\r\n order.doneLimitPrice = doneLimitPrice;\r\n order.doneStopPrice = doneStopPrice;\r\n }\r\n\r\n if (physicalOptions && !utils.isEmpty(physicalOptions.period)) {\r\n order.InstrumentCategory = InstrumentCategory.Physical;\r\n order.PhysicalTradeSide = isBuy ? PhysicalTradeSide.Buy : PhysicalTradeSide.Sell;\r\n order.InstalmentFrequence = physicalOptions.frequence;\r\n order.InstalmentPolicyId = physicalOptions.instalmentPolicyId;\r\n order.PhysicalInstalmentType = physicalOptions.physicalInstalmentType;\r\n order.RecalculateRateType = physicalOptions.recalculateRateType;\r\n order.DownPayment = physicalOptions.downPayment;\r\n //todo: order.AdvanceAmount = ;\r\n if (physicalOptions.Period == 1 && physicalOptions.advanceAmount) {\r\n order.AdvanceAmount = physicalOptions.advanceAmount; // order.marketValue * order.DownPayment;\r\n }\r\n order.Period = physicalOptions.period;\r\n }\r\n } else {\r\n order.OrderRelation = [];\r\n\r\n let closedLot = 0;\r\n openOrders.forEach((openOrder, index) => {\r\n closedLot += parseFloat(openOrder.selectedLot);\r\n order.OrderRelation.push({ ClosedLot: openOrder.selectedLot, OpenOrderID: openOrder.ID, CloseOrderID: order.ID, OpenOrderPrice: openOrder.ExecutePrice, OpenOrderTime: openOrder.Transaction.ExecuteTime });\r\n });\r\n\r\n order.LotBalance = order.Lot = order.OriginalLot = Math.round2(closedLot, 4);\r\n }\r\n\r\n return order;\r\n}\r\n\r\nfunction buildDefaultTransaction(instrument, transactionType, orderType, expireType, expireTime, physicalOptions) {\r\n let isPhysical = (parseInt(instrument.Category) === InstrumentCategory.Physical);\r\n let now = this.getServerTime().format(\"YYYY-MM-DD HH:mm:ss\");\r\n let tradePolicyDetail = this.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let endTime = undefined;\r\n if (expireType == PendingOrderExpireType.GoodTillDate) {\r\n endTime = expireTime;\r\n }\r\n else if (expireType == PendingOrderExpireType.GoodTillFriday || expireType == PendingOrderExpireType.GoodTillMonth) {\r\n //expireType = ExpireType.GTD;\r\n } else if (expireType == PendingOrderExpireType.GoodTillDay) {\r\n // expireType = ExpireType.Day;\r\n expireTime = ''; // \r\n endTime = utils.getDateTimeString(this.tradeDay.EndTime);\r\n } else if (expireType == PendingOrderExpireType.GoodTillSession) {\r\n // expireType = ExpireType.Session;\r\n }\r\n\r\n return {\r\n ID: utils.uuid(),\r\n PlacingSettingType: isPhysical ? PlacingSettingType.Physical : PlacingSettingType.Margin,\r\n Type: transactionType,\r\n SubType: TransactionSubType.None,\r\n OrderType: orderType === OrderType.OneCancelOther ? OrderType.Limit : orderType,\r\n ContractSize: tradePolicyDetail.ContractSize,\r\n Order: [],\r\n SubmitorID: this.loginResult.UserId,\r\n AccountID: this.selectedAccount.Id,\r\n InstrumentID: instrument.Id,\r\n // ID: utils.uuid(), \r\n ExpireTime: expireTime === undefined ? now : expireTime,\r\n BeginTime: now,\r\n EndTime: endTime == '' || endTime === undefined ? now : endTime,\r\n SubmitTime: now,\r\n ExpireType: expireType === undefined ? PendingOrderExpireType.GoodTillDay : expireType,\r\n };\r\n}\r\n\r\nfunction setTransactionPhysicalOptions(tran, physicalOptions) {\r\n console.log('setTransactionPhysicalOptions');\r\n tran.Order.forEach((order, index) => {\r\n order.PhysicalTradeSide = order.IsBuy ? PhysicalTradeSide.Buy : PhysicalTradeSide.Sell;\r\n\r\n if (order.IsBuy && physicalOptions) {\r\n order.InstrumentCategory = InstrumentCategory.Physical;\r\n order.marketValue = this.calcPhysicalMarketValue(physicalOptions.period >= 1 ? PaymentForm.Instalment : PaymentForm.FullPayment, order.SetPrice); /// physicalOptions.marketValue;\r\n if (!utils.isEmpty(physicalOptions.period)) {\r\n order.InstalmentFrequence = parseInt(physicalOptions.frequence);\r\n order.InstalmentPolicyId = physicalOptions.instalmentPolicyId;\r\n order.PhysicalInstalmentType = parseInt(physicalOptions.physicalInstalmentType);\r\n order.RecalculateRateType = parseInt(physicalOptions.recalculateRateType);\r\n if (parseInt(physicalOptions.instalmentPolicyDetail.DownPaymentBasis) === 0) {\r\n order.DownPayment = physicalOptions.downPayment / 100;\r\n } else {\r\n order.DownPayment = physicalOptions.downPayment;\r\n }\r\n\r\n if (physicalOptions.period > 1) {\r\n order.AdministrationFee = physicalOptions.administrationFee;\r\n order.AdministrationFeeBase = physicalOptions.instalmentPolicyDetail.AdministrationFeeBase;\r\n }\r\n\r\n if (physicalOptions.advanceAmount) {\r\n order.AdvanceAmount = physicalOptions.advanceAmount; // order.marketValue * order.DownPayment;\r\n }\r\n order.Period = physicalOptions.period;\r\n\r\n\r\n } else {\r\n order.DownPayment = parseInt(physicalOptions.downPayment);\r\n }\r\n }\r\n });\r\n\r\n\r\n}\r\n\r\nfunction getInstalmentPolicyDetail(instalmentPolicyId, period, frequence) {\r\n\r\n let instalmentPolicyDetail = undefined;\r\n let instalmentPolicy = this.instalmentPolicies[instalmentPolicyId];\r\n if (instalmentPolicy && instalmentPolicy.details) {\r\n return instalmentPolicy.details[frequence.toString() + '_' + period.toString()];\r\n // for (const detail of instalmentPolicy.details) {\r\n // if ((detail.Frequence == frequence || frequence == undefined) && detail.Period === period) {\r\n // if (!instalmentPolicyDetail) {\r\n // instalmentPolicyDetail = detail;\r\n // break;\r\n // }\r\n // }\r\n // };\r\n }\r\n\r\n return instalmentPolicyDetail;\r\n}\r\n\r\nfunction isValidWithdrawTime() {\r\n let policy = this.onlineTransferParameters && this.onlineTransferParameters.withdrawApplicationPolicy;\r\n if (policy) {\r\n if (policy.BeginTime || policy.BeginTime2 || policy.BeginTime3 || policy.BeginTime4) {\r\n let now = this.getServerTime().format('yyyy-MM-DD HH:mm:ss');\r\n if (utils.isInTime(now, policy.BeginTime, policy.EndTime)\r\n || utils.isInTime(now, policy.BeginTime2, policy.EndTime2)\r\n || utils.isInTime(now, policy.BeginTime3, policy.EndTime3)\r\n || utils.isInTime(now, policy.BeginTime4, policy.EndTime4)) {\r\n\r\n return true;\r\n }\r\n }\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}\r\n\r\nfunction getPaymentParameter(callback) {\r\n\r\n let organizationIds = [];\r\n Object.values(this.accounts).forEach((account) => {\r\n if (organizationIds.indexOf(account.OrganizationId) === -1)\r\n organizationIds.push(account.OrganizationId);\r\n });\r\n\r\n this.commService.getPaymentParameter(organizationIds.join(\",\"), this.loginResult.loginParam.language, this.loginResult.UserId, (d) => {\r\n let data = JSON.parse(d);\r\n\r\n if (data.Result.content_result) {\r\n let xmlData = xml2json.xml2js(data.Result.content_result, { compact: true, spaces: 4 });\r\n\r\n let parameters = {};\r\n let languages = {};\r\n let currencyRates = {};\r\n\r\n utils.forceToArray(xmlData.PaymentParameter.OnlineTransferParameters.OnlineTransferParameter).forEach((onlineTransferParameter) => {\r\n parameters[onlineTransferParameter._attributes.Id] = onlineTransferParameter._attributes;\r\n });\r\n\r\n utils.forceToArray(xmlData.PaymentParameter.OnlineTransferLanguages.OnlineTransferLanguage).forEach((language) => {\r\n languages[language._attributes.Key] = language._attributes.Value;\r\n });\r\n\r\n utils.forceToArray(xmlData.PaymentParameter.CurrencyRates.CurrencyRate).forEach((currencyRate) => {\r\n currencyRates[currencyRate._attributes.SourceCurrencyId + \"_\" + currencyRate._attributes.TargetCurrencyId] = currencyRate._attributes;\r\n });\r\n\r\n // xmlparser error on parse \r\n // var xml = new XMLParser().parseFromString(data.Result.content_result);\r\n // xml.children.forEach((item) => {\r\n // if (item.name === \"OnlineTransferParameters\") {\r\n // item.children.forEach((onlineTransferParameter) => {\r\n // parameters[onlineTransferParameter.attributes.Id] = onlineTransferParameter.attributes;\r\n // });\r\n // } else if (item.name === \"OnlineTransferLanguages\") {\r\n // item.children.forEach((onlineTransferLanguage) => {\r\n // languages[onlineTransferLanguage.attributes.Key] = onlineTransferLanguage.attributes.Value;\r\n // });\r\n // } else if (item.name === \"CurrencyRates\") {\r\n // item.children.forEach((currencyRate) => {\r\n // currencyRates[currencyRate.attributes.SourceCurrencyId + \"_\" + currencyRate.attributes.TargetCurrencyId] = currencyRate.attributes;\r\n // });\r\n // }\r\n // });\r\n\r\n this.onlineTransferParameters = {\r\n disableDepositExpireTime: xmlData.DisableDepositExpireTime, //xml.attributes.DisableDepositExpireTime,\r\n withdrawApplicationPolicy: !xmlData.PaymentParameter.WithdrawApplicationPolicies ? undefined : xmlData.PaymentParameter.WithdrawApplicationPolicies.WithdrawApplicationPolicy._attributes, //xml.attributes.DisableDepositExpireTime,\r\n parameters: parameters,\r\n languages: languages,\r\n currencyRates: currencyRates\r\n }\r\n\r\n if (callback) {\r\n callback();\r\n }\r\n }\r\n\r\n });\r\n\r\n}\r\n\r\nfunction resetInput() {\r\n Object.values(this.instruments).forEach((instrument) => {\r\n\r\n if (instrument.openPositions) {\r\n let openPositions = Object.values(instrument.openPositions);\r\n if (openPositions.length > 0) {\r\n openPositions.forEach((order, index) => {\r\n order.isSelected = false;\r\n order.selectedLot = order.allowedCloseLot = this.getMaxCloseLot(instrument, order); //parseFloat(order.LotBalance);\r\n });\r\n }\r\n }\r\n });\r\n this.placingData.pips = 0;\r\n this.placingData.lot = undefined;\r\n delete this.placingData.quoteCallback;\r\n delete this.placingData.quoteAnswer;\r\n delete this.placingData.isQuoteTimeout;\r\n window.clearTimeout(this.placingData.quoteTimeoutId);\r\n delete this.placingData.lot;\r\n this.closeLot = 0;\r\n}\r\n\r\nfunction refreshAllowedCloseLot(instrument) {\r\n let selectedCloseLot = 0;\r\n\r\n instrument.allowedCloseLot_Buy_LimitOrStop = 0;\r\n instrument.allowedCloseLot_Buy_LimitAndStop = 0;\r\n instrument.allowedCloseLot_Buy_Limit = 0;\r\n instrument.allowedCloseLot_Buy_Stop = 0;\r\n\r\n instrument.allowedCloseLot_Sell_LimitOrStop = 0;\r\n instrument.allowedCloseLot_Sell_LimitAndStop = 0;\r\n instrument.allowedCloseLot_Sell_Limit = 0;\r\n instrument.allowedCloseLot_Sell_Stop = 0;\r\n\r\n if (instrument.openPositions) {\r\n let openPositions = Object.values(instrument.openPositions);\r\n\r\n openPositions.forEach((order, index) => {\r\n order.allowedCloseLot = this.getMaxCloseLot(instrument, order);\r\n if (Boolean.parseBoolean(order.IsBuy)) {\r\n instrument.allowedCloseLot_Sell_LimitOrStop += order.allowedCloseLot_LimitOrStop;\r\n instrument.allowedCloseLot_Sell_LimitAndStop += order.allowedCloseLot_LimitAndStop;\r\n instrument.allowedCloseLot_Sell_Limit += order.allowedCloseLot_Limit;\r\n instrument.allowedCloseLot_Sell_Stop += order.allowedCloseLot_Stop;\r\n } else {\r\n instrument.allowedCloseLot_Buy_LimitOrStop += order.allowedCloseLot_LimitOrStop;\r\n instrument.allowedCloseLot_Buy_LimitAndStop += order.allowedCloseLot_LimitAndStop;\r\n instrument.allowedCloseLot_Buy_Limit += order.allowedCloseLot_Limit;\r\n instrument.allowedCloseLot_Buy_Stop += order.allowedCloseLot_Stop;\r\n }\r\n\r\n\r\n if (order.selectedLot > order.allowedCloseLot) {\r\n order.selectedLot = order.allowedCloseLot;\r\n } else if (order.selectedLot == 0 && order.allowedCloseLot > 0) {\r\n order.selectedLot = order.allowedCloseLot;\r\n }\r\n\r\n if (order.isSelected) selectedCloseLot += order.selectedLot;\r\n\r\n });\r\n }\r\n this.closeLot = selectedCloseLot;\r\n return selectedCloseLot;\r\n}\r\n\r\nfunction getMaxCloseLot(instrument, openOrder, orderType) {\r\n if (parseInt(instrument.Category) == InstrumentCategory.Physical) {\r\n console.log('getMaxCloseLot physical');\r\n\r\n let account = this.accounts[openOrder.Transaction.AccountID];\r\n let tradePolicyDetail = account.TradePolicyDetails[instrument.Id];\r\n let instalmentPolicy = this.instalmentPolicies[tradePolicyDetail.InstalmentPolicyId];\r\n\r\n let canClose = ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.Sell) == PhysicalTradeSide.Sell);\r\n\r\n if (Math.abs(parseFloat(openOrder.PaidPledgeBalance)) !== parseFloat(openOrder.PhysicalOriginValueBalance) && instalmentPolicy) {\r\n let allowClose = parseInt(instalmentPolicy.AllowClose);\r\n if (openOrder.Period == 1) {\r\n canClose = (allowClose != AllowCloseInstalment.DisAllow);\r\n } else if (openOrder.Period > 1) {\r\n canClose = (allowClose == AllowCloseInstalment.AllowWhenNoOutstandingInstalment || allowClose == AllowCloseInstalment.AllowAll);\r\n }\r\n }\r\n\r\n if (!canClose) {\r\n openOrder.pendingLimitClosedLot = openOrder.pendingStopClosedLot = openOrder.allowedCloseLot_LimitOrStop = openOrder.allowedCloseLot_LimitAndStop = openOrder.allowedCloseLot_Limit = openOrder.allowedCloseLot_Stop = 0;\r\n return 0;\r\n }\r\n\r\n }\r\n\r\n let lotBalance = parseFloat(openOrder.LotBalance) - openOrder.deliveryLotInProcess;\r\n if (!orderType) {\r\n orderType = this.placingData.orderType;\r\n }\r\n if (!Boolean.parseBoolean(openOrder.IsOpen) || !this.placingData || orderType == OrderType.Market || orderType == OrderType.SpotTrade || !instrument.orders) {\r\n return lotBalance;\r\n }\r\n else {\r\n let limitClosedLot = 0, pendingLimitAvgPrice = 0.0;\r\n let stopClosedLot = 0, pendingStopAvgPrice = 0.0;\r\n let ocopendingClosedLot = 0;\r\n let useLimitPrice = this.placingData.useLimitPrice;\r\n let useStopPrice = this.placingData.useStopPrice;\r\n\r\n Object.values(instrument.orders).forEach((closeOrder) => {\r\n if (!Boolean.parseBoolean(closeOrder.IsOpen) && (closeOrder.Phase == Phase.Placed || closeOrder.Phase == Phase.Placing)) {\r\n\r\n if (closeOrder.Transaction.OrderType != OrderType.Market && closeOrder.Transaction.OrderType != OrderType.SpotTrade) {\r\n utils.forceToArray(closeOrder.OrderRelations.OrderRelation).forEach((relation) => {\r\n if (relation.OpenOrderID == openOrder.ID) {\r\n let closeLot = parseFloat(relation.ClosedLot)\r\n // if (closeOrder.Transaction.Type == TransactionType.OneCancelOther) {\r\n // ocopendingClosedLot += closeLot;\r\n // } else \r\n\r\n if (closeOrder.TradeOption == TradeOption.Better) {\r\n pendingLimitAvgPrice = ((parseFloat(closeOrder.SetPrice) * closeLot + (pendingLimitAvgPrice * limitClosedLot)) / (limitClosedLot + closeLot))\r\n limitClosedLot += closeLot;\r\n }\r\n else if (closeOrder.TradeOption == TradeOption.Stop) {\r\n pendingStopAvgPrice = ((parseFloat(closeOrder.SetPrice) * closeLot + (pendingStopAvgPrice * stopClosedLot)) / (stopClosedLot + closeLot))\r\n stopClosedLot += closeLot;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n });\r\n\r\n openOrder.pendingLimitAvgPrice = parseFloat(pendingLimitAvgPrice.toFixed(6));\r\n openOrder.pendingStopAvgPrice = parseFloat(pendingStopAvgPrice.toFixed(6));\r\n\r\n openOrder.pendingLimitClosedLot = limitClosedLot;\r\n openOrder.pendingStopClosedLot = stopClosedLot;\r\n openOrder.allowedCloseLot_LimitOrStop = parseFloat((lotBalance - Math.min(limitClosedLot, stopClosedLot) - ocopendingClosedLot / 2).toFixed(6));\r\n openOrder.allowedCloseLot_LimitAndStop = parseFloat((lotBalance - Math.max(limitClosedLot, stopClosedLot) - ocopendingClosedLot / 2).toFixed(6));\r\n openOrder.allowedCloseLot_Limit = parseFloat((lotBalance - limitClosedLot - ocopendingClosedLot / 2).toFixed(6));\r\n openOrder.allowedCloseLot_Stop = parseFloat((lotBalance - stopClosedLot - ocopendingClosedLot / 2).toFixed(6));\r\n\r\n if (!useLimitPrice && !useStopPrice) {\r\n return openOrder.allowedCloseLot_LimitOrStop; // parseFloat((parseFloat(openOrder.LotBalance) - Math.min(limitClosedLot, stopClosedLot) - ocopendingClosedLot / 2).toFixed(6));\r\n }\r\n else if (useLimitPrice && useStopPrice) {\r\n return openOrder.allowedCloseLot_LimitAndStop; //parseFloat((parseFloat(openOrder.LotBalance) - Math.max(limitClosedLot, stopClosedLot) - ocopendingClosedLot / 2).toFixed(6));\r\n } else if (useLimitPrice) {\r\n return openOrder.allowedCloseLot_Limit; // parseFloat((parseFloat(openOrder.LotBalance) - limitClosedLot - ocopendingClosedLot / 2).toFixed(6));\r\n } else {\r\n return openOrder.allowedCloseLot_Stop; // parseFloat((parseFloat(openOrder.LotBalance) - stopClosedLot - ocopendingClosedLot / 2).toFixed(6));\r\n }\r\n }\r\n}\r\n\r\nfunction switchQuotationMarketInfo() {\r\n if (this.isLogedin()) {\r\n this.config.MarketInfoType = (this.config.MarketInfoType ? parseInt(this.config.MarketInfoType) : 0) + 1;\r\n let enableInterest = utils.parseBoolean(this.config.getValue('enableInterest', \"true\"));\r\n if (this.config.MarketInfoType > (!enableInterest ? MarketInfoType.PreCloseAndChange : MarketInfoType.BuySellRate)) {\r\n this.config.MarketInfoType = MarketInfoType.HightLow;\r\n }\r\n\r\n cookie.save(CooKey.MarketInfoType, this.config.MarketInfoType);\r\n }\r\n}\r\n\r\nfunction hasPhysicalInstruments() {\r\n let result = false;\r\n if (this.instruments) {\r\n Object.values(this.instruments).forEach((instrument) => {\r\n if (utils.parseBoolean(instrument.IsActive) && instrument.isPhysical()) {\r\n result = true;\r\n }\r\n });\r\n }\r\n return result;\r\n}\r\n\r\n\r\nexport function calculatePhysicalPaymentDiscount(account, instrument, lot, marketValue, paymentForm) {\r\n let discount = 0;\r\n let tradePolicyDetail = account.TradePolicyDetails[instrument.Id];\r\n if (!utils.isEmpty(tradePolicyDetail.PhysicalPaymentDiscountId) && this.physicalPaymentDiscounts) {\r\n let paymentDiscountPolicy = this.physicalPaymentDiscounts[tradePolicyDetail.PhysicalPaymentDiscountId];\r\n if (paymentDiscountPolicy.details) {\r\n // ICollection details = this._PhysicalPaymentDiscountPolicyDetails[paymentDiscountId.Value].Values;\r\n let isMultiCurrency = Boolean.parseBoolean(account.IsMultiCurrency);\r\n if (isMultiCurrency) {\r\n discount = calculateDiscount(paymentDiscountPolicy, lot, marketValue, paymentForm);\r\n } else {\r\n let sourceCurrency = this.currencies[instrument.CurrencyId];\r\n let targetCurrency = this.currencies[account.CurrencyId];\r\n let currencyRate = this.currencyRates[sourceCurrency.Id + \"_\" + targetCurrency.Id];\r\n discount = calculateDiscount(paymentDiscountPolicy, lot, marketValue, paymentForm, currencyRate.rateIn, currencyRate.rateOut, sourceCurrency.Decimals, targetCurrency.Decimals);\r\n }\r\n\r\n }\r\n }\r\n\r\n return discount;\r\n}\r\n\r\nfunction hasForexInstruments() {\r\n let result = false;\r\n if (this.instruments) {\r\n Object.values(this.instruments).forEach((instrument) => {\r\n if (!instrument.isPhysical()) {\r\n result = true;\r\n }\r\n });\r\n }\r\n return result;\r\n}\r\n\r\nfunction startDqPriceCountDown(instrument, callback) {\r\n // let instrument = model.placingData.selectedInstrument;\r\n let lifeTime = instrument.dealingPolicyDetail ? instrument.dealingPolicyDetail.PriceValidTime : instrument.PriceValidTime;\r\n let isSptReconfirm = Boolean.parseBoolean(this.customer.IsSptReconfirm);\r\n let sptReconfirmDuration = this.settingData.SystemParameter.SptReconfirmDuration;\r\n if (lifeTime <= 0 && isSptReconfirm) {\r\n lifeTime = (sptReconfirmDuration);\r\n }\r\n\r\n if (lifeTime <= 0) lifeTime = this.settingData.SystemParameter.ExceptionEnquiryOutTime;\r\n\r\n if (lifeTime) {\r\n if (this.dqPriceCountDownTimeoutId) {\r\n window.clearTimeout(this.dqPriceCountDownTimeoutId);\r\n delete this.dqPriceCountDownTimeoutId;\r\n }\r\n this.dqPriceCountDownTimeoutId = window.setTimeout(() => {\r\n // this.setState({ confirmDialogVisible: false })\r\n window.clearTimeout(this.dqPriceCountDownTimeoutId);\r\n delete this.dqPriceCountDownTimeoutId;\r\n callback();\r\n }, lifeTime * 1000);\r\n }\r\n}\r\n\r\nfunction orderingNotify(id, userCode, instrumentCode, isBuy, isOpen, lot, callback) {\r\n let model = this;\r\n let allowOrderingNotify = (model && model.settingData && model.settingData.SystemParameter) ? utils.parseBoolean(model.settingData.SystemParameter.AllowOrderingNotify) : false;\r\n if (lot > 0 && allowOrderingNotify) {\r\n console.log('orderingNotify id', id);\r\n model.commService.orderingNotify(id == undefined ? utils.uuid() : id, model.customer.Code, model.placingData.selectedInstrument.Code, isBuy.toString(), isOpen.toString(), lot.toString(), callback);\r\n }\r\n}\r\n\r\nfunction uploadFile(file, callback) {\r\n this.showLoadingSpin(true);\r\n let now = this.getServerTime().format(\"yyyyMMDDHHmmss\");\r\n let fileId = utils.uuid();\r\n let url = utils.format(\"{0}?method=form&time={1}&fileid={2}&userid={3}&sign=\", this.config.getValue('imageReceiverUrl'), now, fileId, this.loginResult.UserId)\r\n let data = new FormData();\r\n data.append('file', file);\r\n\r\n axios.post(url, data).then(res => {\r\n let errorMessage = '';\r\n try {\r\n errorMessage = JSON.parse(res.data.replace('error:', '\"error\":').replace('msg:', '\"msg\":').replace(/'/g, '\"')).msg;\r\n } catch (e) {\r\n\r\n errorMessage = 'error';\r\n }\r\n this.showLoadingSpin(false);\r\n debugger;\r\n if (errorMessage != 'SUCCESS') {\r\n utils.logError(errorMessage);\r\n } else {\r\n console.log(res.data);\r\n if (callback) callback(fileId);\r\n }\r\n }).catch((error) => {\r\n debugger;\r\n this.showLoadingSpin(false);\r\n console.error(error);\r\n utils.logError(error.toString());\r\n });\r\n\r\n return false;\r\n}\r\n","import React from 'react';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport cookie from 'react-cookies'\r\n\r\nimport * as utils from '../common/utils.js';\r\nimport { CooKey } from \"../common/const.js\";\r\n\r\nclass BaseView extends React.Component {\r\n css = {};\r\n\r\n constructor(props) {\r\n super(props);\r\n let path = window.location.hash.toString().toLowerCase();\r\n if (path != '#/' && path != '#/login') {\r\n console.log(this.constructor.name, \"constructor\");\r\n if ((!props.model || !props.model.isTradingDataLoaded) && !props.isTitle && !props.isPad && this.constructor && this.constructor.name != \"App\" && this.constructor.name != \"LoginView\") {\r\n console.log(this.constructor.name, 'model not loaded', window.location.hash);\r\n window.location.replace('#');\r\n }\r\n }\r\n }\r\n\r\n getTheme() {\r\n let themeName = cookie.load(CooKey.ThemeName);\r\n // if (this.constructor.name == \"App\") debugger;\r\n if (utils.isEmpty(themeName)) {\r\n let { model, commService } = this.props;\r\n if (!model && !commService) {\r\n commService = this.state ? this.state.commService : { state: {} }; // app.js\r\n }\r\n let config = (model && model.config ? model.config : commService.state.config);\r\n if (model && !model.config) {\r\n themeName = model.themeName; // class is not App\r\n } else if (this.state && commService && config) {\r\n themeName = config.getValue('themeName'); // class is App\r\n }\r\n if (!themeName || themeName === \"undefined\") themeName = (!config || !config.getValue('themeName')) ? \"black\" : config.getValue('themeName');\r\n }\r\n return themeName;\r\n }\r\n\r\n getModuleCss(cssFileName, themeName) {\r\n let baseCss = this.css[cssFileName];\r\n if (baseCss && this.props.model && this.props.model.config.getValue('themeName') !== undefined && this.themeName !== this.props.model.config.getValue('themeName')) {\r\n baseCss = undefined;\r\n }\r\n\r\n if (!baseCss) {\r\n if (!themeName) themeName = this.getTheme();// \r\n // if (!themeName) themeName = cookie.load(CooKey.ThemeName);\r\n // if (!themeName || themeName === \"undefined\") themeName = (!this.props.model || !this.props.model.config.themeName) ? \"black\" : this.props.model.config.themeName;\r\n\r\n cssFileName = (cssFileName ? cssFileName.toLowerCase() : this.constructor.name.toLowerCase());\r\n\r\n baseCss = require(\"../style/\" + themeName.toLowerCase() + \"/\" + cssFileName + '.module.css');\r\n this.themeName = themeName;\r\n }\r\n return baseCss;\r\n }\r\n\r\n goto(url) {\r\n console.log('goto', url);\r\n if (url === window.location.hash || ('#' + url) === window.location.hash) {\r\n return;\r\n }\r\n\r\n window.globalData.prevLocation = window.location.hash.toLowerCase();\r\n if (this.props.isPad) {\r\n if (this.props.onRoutePathChange) this.props.onRoutePathChange(url.replace(\"/\", \"\"));\r\n } else {\r\n let model = this.props.model;\r\n\r\n let isLogedin = (model && model.isLogedin());\r\n if (!isLogedin && url != '/' && url != '/login' && url != '/placeview' && url != '/framewindow') {\r\n this.props.history.push('/login');\r\n } else {\r\n if (!this.props.isPad && url !== window.location.hash && ('#' + url) !== window.location.hash) {\r\n this.props.history.push(url);\r\n }\r\n }\r\n }\r\n\r\n\r\n }\r\n\r\n goBack(step) {\r\n if (this.props.isPad && this.props.onClose) {\r\n this.props.onClose();\r\n } else if (step === undefined) {\r\n this.props.history.goBack();\r\n } else {\r\n this.props.history.go(step);\r\n }\r\n }\r\n\r\n}\r\n\r\nexport default BaseView;\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { CaretLeftFilled, MoreOutlined, MenuOutlined } from '@ant-design/icons';\r\nimport { message as antMessage } from 'antd';\r\n\r\nimport BaseView from \"./baseview.js\";\r\n\r\nclass TitleBarView extends BaseView {\r\n\r\n componentDidMount() {\r\n console.log('TitleBarView.componentDidMount');\r\n }\r\n\r\n fullScreen() {\r\n antMessage.info('not implement yet.');\r\n }\r\n\r\n render() {\r\n let { model, isPad } = this.props;\r\n let backButtonVisible = true;\r\n let appCss = this.getModuleCss('app');\r\n let moduleCss = this.getModuleCss('titlebar', 'common');\r\n\r\n if (this.props.backButtonVisible != undefined) backButtonVisible = Boolean.parseBoolean(this.props.backButtonVisible);\r\n let logoUrl = model && model.config ? model.config.getValue('logoUrl') : undefined;\r\n let logo = (logoUrl ? \"\" : '');\r\n let titleStyle = (model && model.config ? { backgroundColor: model.config.getValue('titleBackgroundColor'), color: model.config.getValue('titleColor'), zIndex: '9999' } : { zIndex: '9999' });\r\n let uiConfig = (model && model.config ? model.config.getUIConfig() : { titleBar: {} });\r\n\r\n if (isPad) {\r\n titleStyle.position = 'relative';\r\n }\r\n if (!uiConfig.titleBar.showBorderBottom) {\r\n titleStyle.borderBottomColor = 'inherit';\r\n titleStyle.borderBottomWidth = '0';\r\n }\r\n\r\n return
\r\n
\r\n
{backButtonVisible ? (
DialogWindow.Back
) : ('')}
\r\n
{logo} {!uiConfig.titleBar.showCompanyName ? '' : this.props.title} {!uiConfig.titleBar.showCompanyName ? '' : this.props.titlekey}
\r\n \r\n
\r\n {isPad ? '' :
}\r\n {this.props.children}\r\n {/* { this.bottomBarComponent = ref;}} /> */}\r\n\r\n
\r\n }\r\n\r\n handleGoBack(e) {\r\n if (this.props.onGobackClick) {\r\n this.props.onGobackClick(e);\r\n } else {\r\n this.goBack();\r\n }\r\n }\r\n\r\n\r\n}\r\n\r\nexport default withRouter(TitleBarView);\r\n","import React from 'react';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Trans } from 'react-i18next';\r\nimport { CaretDownOutlined } from '@ant-design/icons';\r\n\r\nimport BaseView from \"./baseview.js\";\r\nimport TitleBarView from './titlebarview';\r\n\r\nimport * as utils from '../common/utils.js';\r\nimport { PriceTrend, InstrumentStatus, OrderType, MarketInfoType } from '../common/const';\r\n\r\nclass QuotationItem extends BaseView {\r\n componentDidMount() {\r\n console.info(\"QuotationItem.componentDidMount\");\r\n }\r\n\r\n onPaneClick(instrument) {\r\n console.log(instrument.Description, ' clicked')\r\n let { model, isPad } = this.props;\r\n if (instrument.quotation === undefined || utils.isEmpty(instrument.quotation.Ask) || utils.isEmpty(instrument.quotation.Bid)) {\r\n model.showModalDialog(DialogWindow.InstrumentIsNotAccepting);\r\n if (!isPad) return;\r\n }\r\n\r\n let tradePolicy = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n if (tradePolicy && (!isPad || !model.placingData || model.placingData.selectedInstrument.Id != instrument.Id)) {\r\n console.log('buildPlacingData');\r\n model.buildPlacingData(instrument, undefined, undefined);\r\n let account = model.selectedAccount;\r\n let accountQuotePolicyId = (account.UseQuotePolicyId ? account.UseQuotePolicyId : account.PublicQuotePolicyId);\r\n\r\n let quotation = (instrument.quotations ? instrument.quotations[accountQuotePolicyId] : undefined);\r\n if (!quotation) {\r\n quotation = instrument.quotation ? instrument.quotation : {};\r\n }\r\n model.placingData.clickedQuotation = {};\r\n Object.assign(model.placingData.clickedQuotation, quotation);\r\n if (this.props.onClick) {\r\n this.props.onClick();\r\n }\r\n }\r\n\r\n }\r\n\r\n onMarketInfoClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n if (this.props.onMarketInfoClick) {\r\n this.props.onMarketInfoClick();\r\n }\r\n }\r\n\r\n render() {\r\n let moduleCss = this.getModuleCss('quotationview');\r\n let defaultCss = this.getModuleCss('default');\r\n const { isPad, model, instrument } = this.props;\r\n // let { t ,i18n} = useTranslation();\r\n if (!model || !model.selectedAccount) return '';\r\n\r\n let quotationRiseColor = model.config.getValue('quotationRiseColor', '#32cd32');\r\n let quotationRiseForeColor = model.config.getValue('quotationRiseForeColor', this.getTheme() == 'white' ? '#000000' : '#ffffff');\r\n let quotationFallColor = model.config.getValue('quotationFallColor', \"#ff0000\");\r\n let quotationFallForeColor = model.config.getValue('quotationFallForeColor', this.getTheme() == 'white' ? '#000000' : '#ffffff');\r\n\r\n let account = model.selectedAccount;\r\n let accountQuotePolicyId = (account.UseQuotePolicyId ? account.UseQuotePolicyId : account.PublicQuotePolicyId);\r\n let isNormal = utils.parseBoolean(instrument.IsNormal);\r\n let quotation = (instrument.quotations ? instrument.quotations[accountQuotePolicyId] : undefined);\r\n if (!quotation) {\r\n quotation = instrument.quotation ? instrument.quotation : {};\r\n }\r\n\r\n let colorStyle = undefined;\r\n if (instrument.priceTrend === PriceTrend.Rise) {\r\n colorStyle = { backgroundColor: quotationRiseColor, color: quotationRiseForeColor };\r\n } else if (instrument.priceTrend === PriceTrend.Fall) {\r\n colorStyle = { backgroundColor: quotationFallColor, color: quotationFallForeColor };\r\n } else {\r\n colorStyle = { borderWidth: '0px', margin: '1px' }\r\n }\r\n\r\n let priceStyle = { fontSize: '1.5em' };\r\n let tradePolicy = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n\r\n let marketInfoType = (model.config.MarketInfoType ? parseInt(model.config.MarketInfoType) : MarketInfoType.HightLow);\r\n let footTitle1 = '', footTitle2 = '';\r\n let footText1 = '', footText2 = '';\r\n let isMarketClose = (instrument.status != InstrumentStatus.DayOpen && instrument.status != InstrumentStatus.SessionOpen);\r\n let closeElement = isMarketClose ? (MainView.MarketClose) : '';\r\n switch (marketInfoType) {\r\n case MarketInfoType.PreCloseAndChange:\r\n footTitle1 = \"MainView.PrevClose\";\r\n footTitle2 = \"MainView.PriceChangeNet\";\r\n footText1 = instrument.formatRearPrice(quotation.PrevBid, quotation.PrevAsk);\r\n footText2 = instrument.priceChangeNet;\r\n break;\r\n case MarketInfoType.BuySellRate:\r\n footTitle1 = \"MainView.InterestRateSell\";\r\n footTitle2 = \"MainView.InterestRateBuy\";\r\n if (tradePolicy) {\r\n let interestRate = model.interestRates[tradePolicy.InterestRateId];\r\n footText1 = interestRate.Sell;\r\n footText2 = interestRate.Buy;\r\n }\r\n\r\n break;\r\n default:\r\n footTitle1 = \"MainView.High\";\r\n footTitle2 = \"MainView.Low\";\r\n footText1 = instrument.formatRearPrice(quotation.High, quotation.AskHigh);\r\n footText2 = instrument.formatRearPrice(quotation.Low, quotation.AskLow);\r\n }\r\n\r\n let rows = [ this.onPaneClick(instrument)} >\r\n {instrument.Description} {closeElement}\r\n {!quotation.Timestamp ? '' : utils.getTimeString(quotation.Timestamp)}\r\n \r\n ,\r\n\r\n this.onPaneClick(instrument)}>\r\n {isNormal ? \"MainView.Sell\" : \"MainView.Buy\"} \r\n
{quotation.Bid}
\r\n \r\n {isNormal ? \"MainView.Buy\" : \"MainView.Sell\"}\r\n
{quotation.Ask}
\r\n \r\n ,\r\n\r\n this.onPaneClick(instrument)}>\r\n {footTitle1}\r\n {footText1} \r\n \r\n {footTitle2} \r\n {footText2} \r\n \r\n ,\r\n \r\n ];\r\n\r\n\r\n return rows;\r\n\r\n }\r\n}\r\n\r\n\r\nclass QuotationView extends BaseView {\r\n\r\n componentDidMount() {\r\n console.log('QuotationView.componentDidMount');\r\n if (this.props.onSubComponentLoad) {\r\n this.props.onSubComponentLoad(\"quotationView\", this);\r\n }\r\n }\r\n\r\n onQuotationClick() {\r\n if (this.props.onQuotationClick) {\r\n this.props.onQuotationClick();\r\n }\r\n this.goto('/placeview');\r\n }\r\n\r\n render() {\r\n let items = [];\r\n let { model, commService, isPad } = this.props;\r\n if (!model || !model.orderedInstruments) return '';\r\n\r\n let moduleCss = this.getModuleCss('quotationview');\r\n let defaultCss = this.getModuleCss('default');\r\n let subCompanyLocale = model.config.getValue('subCompanyLocale', \"PageWindow.SubCompanyName\");\r\n\r\n model.orderedInstruments.forEach((instrument) => {\r\n let key = (this.props.isPad ? 'padQuotationview_' : 'quotationview_') + instrument.Id;\r\n // console.log(key);\r\n items.push( )\r\n });\r\n\r\n let topBlankStyle = { height: '2px' };\r\n let uiConfig = (model && model.config ? model.config.getUIConfig() : { quotationView: {} });\r\n let titleStyle = (model && model.config ? { backgroundColor: model.config.getValue('titleBackgroundColor'), color: model.config.getValue('titleColor') } : {});\r\n let containerStyle= uiConfig.quotationView.showSubCompanyName ? {height: 'calc(100% - 3em - 4px)'} : {};\r\n return
\r\n {!isPad ? () : ('')}\r\n {!uiConfig.quotationView.showSubCompanyName ? '' :
{subCompanyLocale}
}\r\n
 
\r\n
\r\n \r\n {items}\r\n
\r\n
 
\r\n
\r\n {this.props.children}\r\n
\r\n }\r\n\r\n}\r\n\r\nlet quotationView = withRouter(QuotationView);\r\n\r\nexport { quotationView as QuotationView };\r\n","import React from 'react';\r\n// import ReactDOM from 'react-dom';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport moment from 'moment';\r\nimport { Modal, Select, Calendar } from 'antd';\r\n// import Calendar from 'react-calendar';\r\nimport { Trans } from 'react-i18next';\r\n\r\nimport * as utils from '../../common/utils.js';\r\nimport { ExpireType, PendingOrderExpireType } from '../../common/const';\r\n\r\nimport BaseView from \"../baseview.js\";\r\n\r\nconst { Option } = Select;\r\nclass ExpireSelectView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n date: props.currentDate,\r\n modalVisible: false,\r\n expireType: props.expireTypes && props.expireTypes.length > 0 ? props.expireTypes[0] : undefined,\r\n expireTypes: props.expireTypes ? props.expireTypes : []\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n console.log('ExpireSelectView.componentDidMount');\r\n }\r\n\r\n onChange(e) {\r\n this.setState({ expireType: e });\r\n if (this.props.onChange) {\r\n this.props.onChange({ expireType: e, date: e === PendingOrderExpireType.GoodTillDate ? this.state.date : undefined });\r\n }\r\n }\r\n\r\n onDateInputClicked(e) {\r\n this.setState({ modalVisible: true });\r\n }\r\n\r\n onCalendarChange(d) {\r\n this.setState({ date: d.format('YYYY-MM-DD') });\r\n }\r\n\r\n onModalOk(e) {\r\n if (this.props.onChange) {\r\n this.props.onChange({ expireType: PendingOrderExpireType.GoodTillDate, date: this.state.date });\r\n }\r\n this.setState({ modalVisible: false });\r\n }\r\n\r\n onModalCancel(e) {\r\n this.setState({ modalVisible: false, date: this.props.currentDate });\r\n }\r\n\r\n render() {\r\n let moduleCss = this.getModuleCss('placeview', 'common');\r\n\r\n let expireTypeOptions = [];\r\n this.state.expireTypes.forEach((expireType, index) => {\r\n if (expireType === PendingOrderExpireType.GoodTillDate) {\r\n expireTypeOptions.push();\r\n } else {\r\n expireTypeOptions.push();\r\n }\r\n });\r\n\r\n return
\r\n \r\n\r\n\r\n document.body.style.overflow = \"auto\"}\r\n visible={this.state.modalVisible} onCancel={this.onModalCancel.bind(this)} onOk={this.onModalOk.bind(this)}>\r\n\r\n\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n }\r\n\r\n}\r\n\r\nexport default withRouter(ExpireSelectView);\r\n","import {format2, isNumeric} from \"./utils\";\r\n\r\nexport const TransactionError = {\r\n NoLinkedServer : -1,\r\n OK : 0,\r\n RuntimeError : 1,\r\n\r\n DbOperationFailed : 2,\r\n\r\n TransactionAlreadyExists : 3,\r\n HasNoOrders : 4,\r\n InvalidRelation : 5,\r\n InvalidLotBalance : 6,\r\n ExceedOpenLotBalance : 7,\r\n InvalidPrice : 8,\r\n\r\n AccountIsNotTrading : 9,\r\n AccountResetFailed : 10,\r\n InstrumentIsNotAccepting : 11,\r\n TimingIsNotAcceptable : 12,\r\n OrderTypeIsNotAcceptable : 13,\r\n HasUnassignedOvernightOrders : 14,\r\n HasNoAccountsLocked : 15,\r\n IsLockedByAgent : 16,\r\n IsNotLockedByAgent : 17,\r\n ExceedAssigningLotBalance : 18,\r\n\r\n LossExecutedOrderInOco : 19,\r\n OrderLotExceedMaxLot : 20,\r\n OpenOrderNotExists : 21,\r\n AssigningOrderNotExists : 22,\r\n TransactionNotExists : 23,\r\n TransactionCannotBeCanceled : 24,\r\n TransactionCannotBeExecuted : 25,\r\n OrderCannotBeDeleted : 26,\r\n NecessaryIsNotWithinThreshold : 27,\r\n MarginIsNotEnough : 28,\r\n IsNotAccountOwner : 29,\r\n InvalidOrderRelation : 30,\r\n TradePolicyIsNotActive : 31,\r\n SetPriceTooCloseToMarket : 32,\r\n HasNoQuotationExists : 33,\r\n AccountIsInAlerting : 34,\r\n DailyQuotationIsNotIntegrated : 35,\r\n LimitStopAddPositionNotAllowed : 36,\r\n MooMocNewPositionNotAllowed : 37,\r\n TransactionCannotBeBooked : 38,\r\n OnlySptMktIsAllowedForPreCheck : 39,\r\n InvalidTransactionPhase : 40,\r\n ExecuteTimeMustBeInTradingTime : 41,\r\n\r\n DatabaseDataIntegralityViolated : 50,\r\n\r\n PriceIsOutOfDate : 60,\r\n ShortSellNotAllowed : 61,\r\n InvalidInstalmentTrade : 62,\r\n PrepaymentIsNotAllowed : 63,\r\n HitIsReseted : 64,\r\n ExistPendingLimitCloseOrder : 65,\r\n TimeSpanBetweenOrders : 68,\r\n\r\n //More accuracy error\r\n TransactionExpired : 100,\r\n FillOnMarketCloseNotAllowed : 101,\r\n InstrumentNotInTradePolicy : 102,\r\n AmendedOrderNotFound : 103,\r\n InitialOrderCanNotBeAmended : 104,\r\n InvalidResetStatusWhenAssign : 105, //Check [P_AssignTran] \r\n AlreadyValued : 106,\r\n OutOfAcceptDQVariation : 107,\r\n PriceIsDisabled : 108,\r\n TransactionStateViolated : 109,\r\n PriceChangedSincePlace : 110,\r\n ExceedMaxOpenLot : 111,\r\n ReplacedWithMaxLot : 112,\r\n ExceedMaxPhysicalValue : 113,\r\n BalanceOrEquityIsShort : 114,\r\n SplittedForHasShortSell : 115,\r\n AdjustedToFullPaidOrderForHasShortSell : 116,\r\n NotPaidoffInstalmentOrderCanNotBeClosed : 117,\r\n\r\n MultipleCloseOrderNotFound : 200,\r\n MultipleCloseOnlyExecutedOrderAllowed : 201,\r\n MultipleCloseOnlyOpenOrderAllowed : 202,\r\n MultipleCloseHasNoLotBalance : 203,\r\n MultipleCloseOnlySameContractSizeAllowed : 204,\r\n MultipleCloseOnlySameAccountAllowed : 205,\r\n MultipleCloseOnlySameInstrumentAllowed : 206,\r\n MultipleCloseOppositeNotFound : 207,\r\n MultipleCloseNotSortByCode : 208,\r\n MultipleCloseNotAllowed : 209,\r\n\r\n IsCuttingByRemoteSystem : 300,\r\n\r\n //Used to extend function. it is not conform to the code specification\r\n Action_ShouldAutoFill : 10000,\r\n Action_NeedDealerConfirmCanceling : 10001,\r\n\r\n RiskMonitorDelete : 20000,\r\n DealerCanceled : 20001,\r\n RejectDQByDealer : 20002,\r\n OneCancelOther : 20003,\r\n CustomerCanceled : 20004,\r\n ExceedHighLowPrice : 20007,\r\n OpenContractsWithDifferentSizes : 20009\r\n}\r\n\r\nexport const CancelReason = {\r\n CustomerCanceled : 0,\r\n DealerCanceled : 1,\r\n RiskMonitorCanceled : 2,\r\n MooMocNewPositionNotAllowed : 3,\r\n InitialOrderCanNotBeAmended : 4,\r\n OrderExpired : 5,\r\n InvalidPrice : 6,\r\n\r\n RiskMonitorDelete : 7,\r\n AccountResetFailed : 8,\r\n //DealerCanceled,\r\n NecessaryIsNotWithinThreshold : 9,\r\n MarginIsNotEnough : 10,\r\n AccountIsNotTrading : 11,\r\n InstrumentIsNotAccepting : 12,\r\n TimingIsNotAcceptable : 13,\r\n OrderTypeIsNotAcceptable : 14,\r\n HasNoAccountsLocked : 15,\r\n IsLockedByAgent : 16,\r\n //InvalidPrice,\r\n LossExecutedOrderInOco : 17,\r\n ExceedOpenLotBalance : 18,\r\n OneCancelOther : 19,\r\n //CustomerCanceled,\r\n AccountIsInAlerting : 20,\r\n //RiskMonitorCanceled,\r\n //OrderExpired,\r\n LimitStopAddPositionNotAllowed : 21,\r\n //MooMocNewPositionNotAllowed,\r\n TransactionCannotBeBooked : 22,\r\n OnlySptMktIsAllowedForPreCheck : 23,\r\n InvalidTransactionPhase : 24,\r\n TransactionExpired : 25,\r\n //InitialOrderCanNotBeAmended,\r\n OtherReason : 26,\r\n PriceChanged : 27,\r\n OpenOrderIsClosed : 28,\r\n ReplacedWithMaxLot : 29,\r\n SplittedForHasShortSell : 30,\r\n AdjustedToFullPaidOrderForHasShortSell : 31,\r\n TimeSpanBetweenOrders : 32,\r\n ExceedHighLowPrice : 33,\r\n ExceedDQVariation : 34,\r\n NotPaidoffInstalmentOrderCanNotBeClosed : 35,\r\n\r\n ShortSellNotAllowed : 300,\r\n ExceedMaxPhysicalValue : 301,\r\n BalanceOrEquityIsShort : 302,\r\n PriceIsOutOfDate : 303,\r\n HitIsReseted : 304,\r\n InvalidInstalmentTrade : 305,\r\n PrepaymentIsNotAllowed : 306,\r\n ExistPendingLimitCloseOrder : 307,\r\n\r\n // Reasons Added for CME\r\n MarketPausedOrClosed : 1003,\r\n PriceMustBeGreaterThanZero : 1012,\r\n MarketPriceOrdersNotSupportedByOppositeLimit : 2013,\r\n SellOrderStopPriceMustBeBelowLastTradePrice : 2060,\r\n BuyOrderStopPriceMustBeAboveLastTradePrice : 2061,\r\n OrderTypeNotPermittedInPreOpen : 2130,\r\n OrderPriceOutsideTheLimits : 2137,\r\n OrderPriceOutsideBands : 2179,\r\n OrderTypeNotPermittedForGroup : 2311,\r\n OrderCannotBeModifiedInNoCancel : 7024,\r\n}\r\n\r\nexport function getCancelMessage(cancelReason)\r\n{\r\n cancelReason = parseInt(cancelReason);\r\n let message='';\r\n if (cancelReason === CancelReason.ExceedOpenLotBalance)\r\n {\r\n message = \"TransactionError_ExceedOpenLotBalance\";\r\n }\r\n else if (cancelReason === CancelReason.InvalidPrice)\r\n {\r\n message = \"TransactionError_InvalidPrice\";\r\n }\r\n else if (cancelReason === CancelReason.AccountIsNotTrading)\r\n {\r\n message = \"TransactionError_AccountIsNotTrading\";\r\n }\r\n else if (cancelReason === CancelReason.AccountResetFailed)\r\n {\r\n message = \"TransactionError_AccountResetFailed\";\r\n }\r\n else if (cancelReason === CancelReason.InstrumentIsNotAccepting)\r\n {\r\n message = \"TransactionError_InstrumentIsNotAccepting\";\r\n }\r\n else if (cancelReason === CancelReason.TimingIsNotAcceptable)\r\n {\r\n message = \"TransactionError_TimingIsNotAcceptable\";\r\n }\r\n else if (cancelReason === CancelReason.OrderTypeIsNotAcceptable)\r\n {\r\n message = \"TransactionError_OrderTypeIsNotAcceptable\";\r\n }\r\n else if (cancelReason === CancelReason.HasNoAccountsLocked)\r\n {\r\n message = \"TransactionError_HasNoAccountsLocked\";\r\n }\r\n else if (cancelReason === CancelReason.IsLockedByAgent)\r\n {\r\n message = \"TransactionError_IsLockedByAgent\";\r\n }\r\n else if (cancelReason === CancelReason.LossExecutedOrderInOco)\r\n {\r\n message = \"TransactionError_LossExecutedOrderInOco\";\r\n }\r\n else if (cancelReason === CancelReason.NecessaryIsNotWithinThreshold)\r\n {\r\n message = \"TransactionError_NecessaryIsNotWithinThreshold\";\r\n }\r\n else if (cancelReason === CancelReason.MarginIsNotEnough)\r\n {\r\n message = \"TransactionError_MarginIsNotEnough\";\r\n }\r\n \r\n else if (cancelReason === CancelReason.AccountIsInAlerting)\r\n {\r\n message = \"TransactionError_AccountIsInAlerting\";\r\n }\r\n else if (cancelReason === CancelReason.LimitStopAddPositionNotAllowed)\r\n {\r\n message = \"TransactionError_StopAddPositionNotAllowed\";\r\n }\r\n else if (cancelReason === CancelReason.MooMocNewPositionNotAllowed)\r\n {\r\n message = \"TransactionError_LmtMooMocNewPositionNotAllowed\";\r\n }\r\n else if (cancelReason === CancelReason.TransactionCannotBeBooked)\r\n {\r\n message = \"TransactionError_TransactionCannotBeBooked\";\r\n }\r\n else if (cancelReason === CancelReason.OnlySptMktIsAllowedForPreCheck)\r\n {\r\n message = \"TransactionError_OnlySptMktIsAllowedForPreCheck\";\r\n }\r\n else if (cancelReason === CancelReason.InvalidTransactionPhase)\r\n {\r\n message = \"TransactionError_InvalidTransactionPhase\";\r\n } \r\n else if (cancelReason === CancelReason.TransactionExpired)\r\n {\r\n message = \"TransactionError_TransactionExpired\";\r\n } \r\n else if (cancelReason === CancelReason.RiskMonitorDelete)\r\n {\r\n message = \"TransactionError_RiskMonitorDelete\";\r\n }\r\n else if (cancelReason === CancelReason.DealerCanceled)\r\n {\r\n message = \"TransactionError_DealerCanceled\";\r\n }\r\n else if (cancelReason === CancelReason.OneCancelOther)\r\n {\r\n message = \"TransactionError_OneCancelOtherPrompt\";\r\n }\r\n else if (cancelReason === CancelReason.CustomerCanceled)\r\n {\r\n message = \"TransactionError_CustomerCanceled\";\r\n }\r\n else if (cancelReason === CancelReason.PriceChanged)\r\n {\r\n message = \"CancelReason_PriceChanged\";\r\n }\r\n else if (cancelReason === CancelReason.MarketPausedOrClosed)\r\n {\r\n message = \"CancelReason_MarketPausedOrClosed\";\r\n }\r\n else if (cancelReason === CancelReason.PriceMustBeGreaterThanZero)\r\n {\r\n message = \"CancelReason_PriceMustBeGreaterThanZero\";\r\n }\r\n else if (cancelReason === CancelReason.MarketPriceOrdersNotSupportedByOppositeLimit)\r\n {\r\n message = \"CancelReason_MarketPriceOrdersNotSupportedByOppositeLimit\";\r\n }\r\n else if (cancelReason === CancelReason.SellOrderStopPriceMustBeBelowLastTradePrice)\r\n {\r\n message = \"CancelReason_SellOrderStopPriceMustBeBelowLastTradePrice\";\r\n }\r\n else if (cancelReason === CancelReason.BuyOrderStopPriceMustBeAboveLastTradePrice)\r\n {\r\n message = \"CancelReason_BuyOrderStopPriceMustBeAboveLastTradePrice\";\r\n }\r\n else if (cancelReason === CancelReason.OrderTypeNotPermittedInPreOpen)\r\n {\r\n message = \"CancelReason_OrderTypeNotPermittedInPreOpen\";\r\n }\r\n else if (cancelReason === CancelReason.OrderPriceOutsideTheLimits)\r\n {\r\n message = \"CancelReason_OrderPriceOutsideTheLimits\";\r\n }\r\n else if (cancelReason === CancelReason.OrderPriceOutsideBands)\r\n {\r\n message = \"CancelReason_OrderPriceOutsideBands\";\r\n }\r\n else if (cancelReason === CancelReason.OrderTypeNotPermittedForGroup)\r\n {\r\n message = \"CancelReason_OrderTypeNotPermittedForGroup\";\r\n }\r\n else if (cancelReason === CancelReason.OrderCannotBeModifiedInNoCancel)\r\n {\r\n message = \"CancelReason_OrderCannotBeModifiedInNoCancel\";\r\n }\r\n else if (cancelReason === CancelReason.OpenOrderIsClosed)\r\n {\r\n message = \"CancelReason_OpenOrderIsClosed\";\r\n }\r\n else if (cancelReason === CancelReason.ReplacedWithMaxLot)\r\n {\r\n message = \"TransactionError_ReplacedWithMaxLot\";\r\n }\r\n else if (cancelReason === CancelReason.ShortSellNotAllowed)\r\n {\r\n message = \"TransactionError_ShortSellNotAllowed\";\r\n }\r\n else if (cancelReason === CancelReason.ExceedMaxPhysicalValue)\r\n {\r\n message = \"TransactionError_ExceedMaxPhysicalValue\";\r\n }\r\n else if (cancelReason === CancelReason.BalanceOrEquityIsShort)\r\n {\r\n message = \"TransactionError_BalanceOrEquityIsShort\";\r\n }\r\n else if (cancelReason === CancelReason.ExistPendingLimitCloseOrder)\r\n {\r\n message = \"TransactionError_ExistPendingLimitCloseOrder\";\r\n }\r\n else if (cancelReason === CancelReason.InvalidInstalmentTrade)\r\n {\r\n message = \"TransactionError_InvalidInstalmentTrade\";\r\n }\r\n else if (cancelReason === CancelReason.HitIsReseted)\r\n {\r\n message = \"TransactionError_HitIsReseted\";\r\n }\r\n else if (cancelReason === CancelReason.SplittedForHasShortSell)\r\n {\r\n message = \"TransactionError_SplittedForHasShortSell\";\r\n }\r\n else if (cancelReason === CancelReason.ExceedHighLowPrice)\r\n {\r\n message = \"TransactionError_ExceedHighLowPrice\";\r\n }\r\n else if (cancelReason === CancelReason.ExceedDQVariation)\r\n {\r\n message = \"TransactionError_ExceedDQVariation\";\r\n }\r\n else if (cancelReason === CancelReason.NotPaidoffInstalmentOrderCanNotBeClosed)\r\n {\r\n message = \"TransactionError_NotPaidoffInstalmentOrderCanNotBeClosed\";\r\n } \r\n else\r\n {\r\n message = cancelReason.toString();\r\n }\r\n\r\n // debugger;\r\n // return format2(message, cancelReason);\r\n return \"DialogWindow.\" + message;\r\n}\r\n\r\n\r\nexport function getTransactionErrorMessage(error)\r\n{\r\n let message = \"\";\r\n if(!isNumeric(error)){ \r\n return \"DialogWindow.TransactionError_\" + error;\r\n }\r\n error = parseInt(error);\r\n if (error === TransactionError.DbOperationFailed)\r\n {\r\n message = \"TransactionError_DbOperationFailed\";\r\n }\r\n else if (error === TransactionError.TransactionAlreadyExists)\r\n {\r\n message = \"TransactionError_TransactionAlreadyExists\";\r\n }\r\n else if (error === TransactionError.HasNoOrders)\r\n {\r\n message = \"TransactionError_HasNoOrders\";\r\n }\r\n else if (error === TransactionError.InvalidRelation)\r\n {\r\n message = \"TransactionError_InvalidRelation\";\r\n }\r\n else if (error === TransactionError.InvalidLotBalance)\r\n {\r\n message = \"TransactionError_InvalidLotBalance\";\r\n }\r\n else if (error === TransactionError.ExceedOpenLotBalance)\r\n {\r\n message = \"TransactionError_ExceedOpenLotBalance\";\r\n }\r\n else if (error === TransactionError.InvalidPrice)\r\n {\r\n message = \"TransactionError_InvalidPrice\";\r\n }\r\n else if (error === TransactionError.AccountIsNotTrading)\r\n {\r\n message = \"TransactionError_AccountIsNotTrading\";\r\n }\r\n else if (error === TransactionError.AccountResetFailed)\r\n {\r\n message = \"TransactionError_AccountResetFailed\";\r\n }\r\n else if (error === TransactionError.InstrumentIsNotAccepting)\r\n {\r\n message = \"TransactionError_InstrumentIsNotAccepting\";\r\n }\r\n else if (error === TransactionError.TimingIsNotAcceptable)\r\n {\r\n message = \"TransactionError_TimingIsNotAcceptable\";\r\n }\r\n else if (error === TransactionError.OrderTypeIsNotAcceptable)\r\n {\r\n message = \"TransactionError_OrderTypeIsNotAcceptable\";\r\n }\r\n else if (error === TransactionError.HasUnassignedOvernightOrders)\r\n {\r\n message = \"TransactionError_HasUnassignedOvernightOrders\";\r\n }\r\n else if (error === TransactionError.HasNoAccountsLocked)\r\n {\r\n message = \"TransactionError_HasNoAccountsLocked\";\r\n }\r\n else if (error === TransactionError.IsLockedByAgent)\r\n {\r\n message = \"TransactionError_IsLockedByAgent\";\r\n }\r\n else if (error === TransactionError.IsNotLockedByAgent)\r\n {\r\n message = \"TransactionError_IsNotLockedByAgent\";\r\n }\r\n else if (error === TransactionError.ExceedAssigningLotBalance)\r\n {\r\n message = \"TransactionError_ExceedAssigningLotBalance\";\r\n }\r\n else if (error === TransactionError.LossExecutedOrderInOco)\r\n {\r\n message = \"TransactionError_LossExecutedOrderInOco\";\r\n }\r\n else if (error === TransactionError.OrderLotExceedMaxLot)\r\n {\r\n message = \"TransactionError_OrderLotExceedMaxLot\";\r\n }\r\n else if (error === TransactionError.OpenOrderNotExists)\r\n {\r\n message = \"TransactionError_OpenOrderNotExists\";\r\n }\r\n else if (error === TransactionError.AssigningOrderNotExists)\r\n {\r\n message = \"TransactionError_AssigningOrderNotExists\";\r\n }\r\n else if (error === TransactionError.TransactionNotExists)\r\n {\r\n message = \"TransactionError_TransactionNotExists\";\r\n }\r\n else if (error === TransactionError.TransactionCannotBeCanceled)\r\n {\r\n message = \"TransactionError_TransactionCannotBeCanceled\";\r\n }\r\n else if (error === TransactionError.TransactionCannotBeExecuted)\r\n {\r\n message = \"TransactionError_TransactionCannotBeExecuted\";\r\n }\r\n else if (error === TransactionError.OrderCannotBeDeleted)\r\n {\r\n message = \"TransactionError_OrderCannotBeDeleted\";\r\n }\r\n else if (error === TransactionError.NecessaryIsNotWithinThreshold)\r\n {\r\n message = \"TransactionError_NecessaryIsNotWithinThreshold\";\r\n }\r\n else if (error === TransactionError.MarginIsNotEnough)\r\n {\r\n message = \"TransactionError_MarginIsNotEnough\";\r\n }\r\n else if (error === TransactionError.IsNotAccountOwner)\r\n {\r\n message = \"TransactionError_IsNotAccountOwner\";\r\n }\r\n else if (error === TransactionError.InvalidOrderRelation)\r\n {\r\n message = \"TransactionError_InvalidOrderRelation\";\r\n }\r\n else if (error === TransactionError.TradePolicyIsNotActive)\r\n {\r\n message = \"TransactionError_TradePolicyIsNotActive\";\r\n }\r\n else if (error === TransactionError.SetPriceTooCloseToMarket)\r\n {\r\n message = \"TransactionError_SetPriceTooCloseToMarket\";\r\n }\r\n else if (error === TransactionError.HasNoQuotationExists)\r\n {\r\n message = \"TransactionError_HasNoQuotationExists\";\r\n }\r\n else if (error === TransactionError.AccountIsInAlerting)\r\n {\r\n message = \"TransactionError_AccountIsInAlerting\";\r\n }\r\n else if (error === TransactionError.LimitStopAddPositionNotAllowed)\r\n {\r\n message = \"TransactionError_StopAddPositionNotAllowed\";\r\n }\r\n else if (error === TransactionError.MooMocNewPositionNotAllowed)\r\n {\r\n message = \"TransactionError_LmtMooMocNewPositionNotAllowed\";\r\n }\r\n else if (error === TransactionError.TransactionCannotBeBooked)\r\n {\r\n message = \"TransactionError_TransactionCannotBeBooked\";\r\n }\r\n else if (error === TransactionError.OnlySptMktIsAllowedForPreCheck)\r\n {\r\n message = \"TransactionError_OnlySptMktIsAllowedForPreCheck\";\r\n }\r\n else if (error === TransactionError.InvalidTransactionPhase)\r\n {\r\n message = \"TransactionError_InvalidTransactionPhase\";\r\n }\r\n else if (error === TransactionError.ExecuteTimeMustBeInTradingTime)\r\n {\r\n message = \"TransactionError_ExecuteTimeMustBeInTradingTime\";\r\n }\r\n else if (error === TransactionError.DatabaseDataIntegralityViolated)\r\n {\r\n message = \"TransactionError_DatabaseDataIntegralityViolated\";\r\n }\r\n else if (error === TransactionError.TransactionExpired)\r\n {\r\n message = \"TransactionError_TransactionExpired\";\r\n }\r\n else if (error === TransactionError.FillOnMarketCloseNotAllowed)\r\n {\r\n message = \"TransactionError_FillOnMarketCloseNotAllowed\";\r\n }\r\n else if (error === TransactionError.RiskMonitorDelete)\r\n {\r\n message = \"TransactionError_RiskMonitorDelete\";\r\n }\r\n else if (error === TransactionError.DealerCanceled)\r\n {\r\n message = \"TransactionError_DealerCanceled\";\r\n }\r\n else if (error === TransactionError.RejectDQByDealer)\r\n {\r\n message = \"TransactionError_RejectDQByDealer\";\r\n }\r\n else if (error === TransactionError.OneCancelOther)\r\n {\r\n message = \"TransactionError_OneCancelOtherPrompt\";\r\n }\r\n else if (error === TransactionError.CustomerCanceled)\r\n {\r\n message = \"TransactionError_CustomerCanceled\";\r\n }\r\n else if (error === TransactionError.OutOfAcceptDQVariation)\r\n {\r\n message = \"TransactionError_OutOfAcceptDQVariation\";\r\n }\r\n else if (error === TransactionError.PriceIsDisabled)\r\n {\r\n message = \"TransactionError_PriceIsDisabled\";\r\n }\r\n else if (error === TransactionError.PriceChangedSincePlace)\r\n {\r\n message = \"TransactionError_PriceChangedSincePlace\";\r\n }\r\n else if (error === TransactionError.PriceIsOutOfDate)\r\n {\r\n message = \"TransactionError_PriceIsOutOfDate\";\r\n }\r\n else if (error === TransactionError.ExceedMaxOpenLot)\r\n {\r\n message = \"TransactionError_ExceedMaxOpenLot\";\r\n }\r\n else if (error === TransactionError.ReplacedWithMaxLot)\r\n {\r\n message = \"TransactionError_ReplacedWithMaxLot\";\r\n }\r\n else if (error === TransactionError.ShortSellNotAllowed)\r\n {\r\n message = \"TransactionError_ShortSellNotAllowed\";\r\n }\r\n else if (error === TransactionError.ShortSellNotAllowed)\r\n {\r\n message = \"TransactionError_ShortSellNotAllowed\";\r\n }\r\n else if (error === TransactionError.ExceedMaxPhysicalValue)\r\n {\r\n message = \"TransactionError_ExceedMaxPhysicalValue\";\r\n }\r\n else if (error === TransactionError.BalanceOrEquityIsShort)\r\n {\r\n message = \"TransactionError_BalanceOrEquityIsShort\";\r\n }\r\n else if (error === TransactionError.ExistPendingLimitCloseOrder)\r\n {\r\n message = \"TransactionError_ExistPendingLimitCloseOrder\";\r\n }\r\n else if (error === TransactionError.InvalidInstalmentTrade)\r\n {\r\n message = \"TransactionError_InvalidInstalmentTrade\";\r\n }\r\n else if (error === TransactionError.HitIsReseted)\r\n {\r\n message = \"TransactionError_HitIsReseted\";\r\n }\r\n else if (error === TransactionError.SplittedForHasShortSell)\r\n {\r\n message = \"TransactionError_SplittedForHasShortSell\";\r\n }\r\n else if (error === TransactionError.TimeSpanBetweenOrders)\r\n {\r\n message = \"TransactionError_TimeSpanBetweenOrders\";\r\n }\r\n else if (error === TransactionError.ExceedHighLowPrice)\r\n {\r\n message = \"TransactionError_ExceedHighLowPrice\";\r\n }\r\n else if (error === TransactionError.NotPaidoffInstalmentOrderCanNotBeClosed)\r\n {\r\n message = \"TransactionError_NotPaidoffInstalmentOrderCanNotBeClosed\";\r\n }\r\n else if (error === TransactionError.OpenContractsWithDifferentSizes)\r\n {\r\n message = \"TransactionError_OpenContractsWithDifferentSizes\";\r\n }\r\n else\r\n {\r\n message = error.toString();\r\n }\r\n\r\n // debugger;\r\n return \"DialogWindow.\" + message;\r\n}","import { OrderType } from '../common/const'\r\nimport { getDecimals, isEmpty } from '../common/utils';\r\n\r\nexport function getLotSettings(account, instrument, isSpotTrade, isOpen) {\r\n let tradePolicy = account.TradePolicyDetails[instrument.Id];\r\n if (!tradePolicy) {\r\n return { default: 0, max: 0, min: 0, step: 0, decimals: 0 };\r\n }\r\n let dealingPolicy = instrument.dealingPolicyDetail;\r\n\r\n let target = {};\r\n let spinStep = parseFloat((isOpen ? tradePolicy.OpenMultiplier : tradePolicy.CloseMultiplier) * account.RateLotMultiplier);\r\n //bool isDQ = isSpotTrade && instrument.OrderTypeMask.Contains(Server.OrderTypeMask.SpotTrade);\r\n let maxLot = parseFloat(isEmpty(dealingPolicy) ?\r\n (isSpotTrade ? instrument.MaxDQLot : instrument.MaxOtherLot)\r\n : (isSpotTrade ? dealingPolicy.MaxDQLot : dealingPolicy.MaxOtherLot));\r\n\r\n let calculatedMaxLot = parseInt((maxLot / spinStep) * spinStep);\r\n maxLot = parseFloat(calculatedMaxLot > maxLot ? (calculatedMaxLot - spinStep) : calculatedMaxLot);\r\n\r\n let minLot = parseFloat((isOpen ? tradePolicy.MinOpen : tradePolicy.MinClose) * account.RateLotMin);\r\n // decimal calculatedMinLot = Convert.ToInt32(minLot / spinStep) * spinStep;\r\n // minLot = (calculatedMinLot < minLot ? minLot : calculatedMinLot);\r\n // minLot = (minLot < spinStep ? spinStep : minLot);\r\n\r\n let defaultLot = parseFloat(tradePolicy.DefaultLot * account.RateDefaultLot);\r\n defaultLot = defaultLot > maxLot ? maxLot : defaultLot;\r\n defaultLot = defaultLot < minLot ? minLot : defaultLot;\r\n\r\n let decimals = 0;\r\n decimals = Math.max(decimals, getDecimals(defaultLot));\r\n decimals = Math.max(decimals, getDecimals(spinStep));\r\n decimals = Math.max(decimals, getDecimals(minLot));\r\n decimals = Math.max(decimals, getDecimals(maxLot));\r\n if (instrument.isPhysical()) {\r\n decimals = Math.max(decimals, parseFloat(instrument.PhysicalLotDecimal));\r\n }\r\n maxLot = parseFloat(maxLot.toFixed(decimals));\r\n minLot = parseFloat(minLot.toFixed(decimals));\r\n\r\n target.default = parseFloat(parseFloat(defaultLot < minLot ? minLot : defaultLot).toFixed(6));\r\n target.max = maxLot;\r\n target.min = minLot;\r\n target.step = spinStep;\r\n target.decimals = decimals;\r\n\r\n return target;\r\n}\r\n\r\n\r\n\r\nexport function getMovePipsSettings(account, instrument) {\r\n let tradePolicyDetail = account.TradePolicyDetails[instrument.Id];\r\n\r\n if (!isEmpty(tradePolicyDetail)) {\r\n let dqMaxMove = parseInt(tradePolicyDetail.DQMaxMove);\r\n let numeratorUnit = parseInt(instrument.NumeratorUnit);\r\n if (dqMaxMove > 0 && dqMaxMove > numeratorUnit) {\r\n return { default: 0, min: 0, max: dqMaxMove, step: numeratorUnit, decimals: 0 };\r\n }\r\n }\r\n\r\n return undefined;\r\n}\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\n\r\nimport { Button, Modal } from 'antd';\r\nimport css from \"../../style/placeconfirmview.module.css\";\r\n\r\nimport { TransactionType, OrderType, TradeOption, Phase, CancelReason, InstrumentCategory, PhysicalTradeSide, PhysicalInstalmentType, AdministrationFeeBaseType } from '../../common/const';\r\nimport * as utils from '../../common/utils';\r\nimport { getCancelMessage, getTransactionErrorMessage } from '../../common/transactionerror';\r\nimport { calcAdministrativeCharge } from '../../model/physicalHelper.js';\r\nimport { getLotSettings } from '../../model/placinglotsetting';\r\n\r\nexport default class PlaceConfirmView extends React.Component {\r\n\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = { isModalVisible: props.isVisible };\r\n console.log('PlaceConfirmView.ctor');\r\n }\r\n\r\n componentDidMount() {\r\n console.log('PlaceConfirmView.componentDidMount');\r\n }\r\n\r\n onOkClicked(e) {\r\n console.log('PlaceConfirmView.onOkClicked');\r\n document.body.style.overflow = \"auto\";\r\n if (this.props.onOk) {\r\n let { model, transactions } = this.props;\r\n model.placingData.transactions = transactions;\r\n\r\n this.props.onOk(e);\r\n }\r\n }\r\n\r\n handleCancel(e) {\r\n console.log('PlaceConfirmView.handleCancel');\r\n let { model } = this.props;\r\n document.body.style.overflow = \"auto\";\r\n let transactions = this.props.model.placingData.transactions;\r\n let isConfirmed = (transactions != undefined && transactions.length > 0 ? (transactions[0].transactionError === undefined || transactions[0].transactionError === \"OK\") : false);\r\n\r\n if (model.placingData && model.placingData.quoteCallback) {\r\n delete model.placingData.quoteCallback;\r\n delete model.placingData.quoteAnswer;\r\n delete model.placingData.isQuoteTimeout;\r\n window.clearTimeout(model.placingData.quoteTimeoutId);\r\n }\r\n this.props.model.placingData.transactions = undefined;\r\n this.props.onCancel(this, isConfirmed);\r\n }\r\n\r\n formatOrderCodes(codes) {\r\n let result = '';\r\n for (let i = 0; i < codes.length; i++) {\r\n let code = codes[i];\r\n if (code) {\r\n result += (i === 0 ? code : '/' + code.substring(code.length - 2));\r\n }\r\n };\r\n return result;\r\n }\r\n\r\n render() {\r\n document.body.style.overflow = \"auto\";\r\n let { model, transactions } = this.props;\r\n //let tran = this.props.transaction;\r\n if (model.placingData.quoteCallback) {\r\n\r\n let buttonFooter =
DialogWindow.Close
;\r\n return document.body.style.overflow = \"auto\"}\r\n title={
DialogWindow.OrderDetail
}\r\n visible={this.props.visible} footer={buttonFooter}\r\n >\r\n {model.placingData.isQuoteTimeout ? \"DialogWindow.PlacingConfirmation_QuoteRequestTimeout\" : \"DialogWindow.PlacingConfirmation_InQuoting\"}\r\n
;\r\n }\r\n else if (transactions === undefined) {\r\n return null;\r\n } else {\r\n let instrument = model.instruments[transactions[0].InstrumentID];\r\n let account = model.accounts[transactions[0].AccountID];\r\n let instrumentCurrency = model.currencies[instrument.CurrencyId];\r\n let currency = Boolean.parseBoolean(account.IsMultiCurrency) ? instrumentCurrency : model.currencies[account.CurrencyId];\r\n let orderDiv = [];\r\n\r\n let firstOrder = transactions[0].Order[0];\r\n let isBuy = Boolean.parseBoolean(firstOrder.IsBuy);\r\n let isOpen = Boolean.parseBoolean(firstOrder.IsOpen);\r\n let openCloseKey = isOpen ? \"DialogWindow.NewType\" : \"DialogWindow.CloseType\";\r\n let orderType = parseInt(transactions[0].OrderType);\r\n let transactionType = parseInt(transactions[0].Type);\r\n let orderPhase = parseInt(transactions[0].Order[0].Phase);\r\n let timeTitle = \"DialogWindow.SubmitAt\";\r\n let timeValue = transactions[0].SubmitTime;\r\n let orderCodes = [];\r\n let lotSettings = getLotSettings(account, instrument, (orderType != OrderType.Limit), model.closeLot == 0);\r\n \r\n if (orderPhase === Phase.Cancel) {\r\n timeTitle = \"DialogWindow.CanceledAt\";\r\n // timeValue = transactions[0].SubmitTime;\r\n } else if (orderPhase === Phase.Executed || orderPhase === Phase.Completed) {\r\n timeTitle = \"DialogWindow.ConfirmedAt\";\r\n timeValue = transactions[0].ExecuteTime;\r\n }\r\n\r\n let orderTypeKey = DialogWindow.Spot;\r\n if (transactionType === TransactionType.OneCancelOther) {\r\n orderTypeKey = [DialogWindow.Pending, \"(\", DialogWindow.OCO, \")\"];\r\n } else if (orderType === OrderType.Limit) {\r\n orderTypeKey = DialogWindow.Pending;\r\n } else if (orderType === OrderType.Market) {\r\n orderTypeKey = DialogWindow.Market\r\n }\r\n\r\n if (orderType === OrderType.Limit) {\r\n orderDiv.push(
\r\n
{isBuy ? \"DialogWindow.BuyQuantity\" : \"DialogWindow.SellQuantity\"}:
\r\n
{utils.formatNumber(firstOrder.Lot, lotSettings.decimals)}  DialogWindow.PlacingConfirmation_Lot
\r\n
);\r\n }\r\n\r\n transactions.forEach((tran1) => {\r\n let tran = model.selectedAccount.transactions[tran1.ID];\r\n if (!tran) tran = tran1;\r\n let orders = (tran.orders ? Object.values(tran.orders) : tran.Order);\r\n\r\n orders.forEach((order) => {\r\n let marketValue = order.marketValue;\r\n if (marketValue == undefined && order.Transaction) {\r\n marketValue = parseFloat(order.Lot) * parseFloat(order.Transaction.ContractSize) * parseFloat(utils.isEmpty(order.ExecutePrice) ? order.SetPrice : order.ExecutePrice);\r\n }\r\n if (orderType === OrderType.Limit) {\r\n\r\n } else {\r\n isBuy = Boolean.parseBoolean(order.IsBuy);\r\n orderDiv.push(
\r\n
{isBuy ? \"DialogWindow.BuyQuantity\" : \"DialogWindow.SellQuantity\"}:
\r\n
{utils.formatNumber(order.Lot, lotSettings.decimals)}  DialogWindow.PlacingConfirmation_Lot
\r\n
);\r\n }\r\n\r\n let priceTitleKey = \"DialogWindow.UnitPrice\";\r\n let price = order.SetPrice;\r\n if (orderPhase === Phase.Placed) {\r\n orderCodes.push(order.Code);\r\n }\r\n\r\n if (parseInt(order.TradeOption) === TradeOption.Stop) {\r\n priceTitleKey = \"DialogWindow.StopPending\";\r\n } else if (parseInt(order.TradeOption) === TradeOption.Better) {\r\n priceTitleKey = \"DialogWindow.LimitPending\";\r\n } else if (orderPhase === Phase.Executed || orderPhase === Phase.Completed) {\r\n priceTitleKey = \"DialogWindow.ConfirmedPrice\";\r\n orderCodes.push(order.Code);\r\n price = order.ExecutePrice;\r\n }\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : undefined);\r\n let priceUnit = '';\r\n if (instrumentUnit) {\r\n priceUnit = ' / ' + instrumentUnit.Weight + instrument.Unit;\r\n }\r\n orderDiv.push(
\r\n
\r\n
{priceTitleKey}:
\r\n
{orderType === OrderType.Market && orderPhase !== Phase.Executed && orderPhase !== Phase.Completed ? DialogWindow.Market : price}{priceUnit}
\r\n
);\r\n\r\n let doneLimitPrice = order.doneLimitPrice, doneStopPrice = order.doneStopPrice;\r\n\r\n if (!doneLimitPrice && !doneStopPrice && instrument.workingList) {\r\n Object.values(instrument.workingList).forEach((doneOrder) => {\r\n if (doneOrder.Transaction.AssigningOrderID == order.ID) {\r\n if (doneOrder.TradeOption == TradeOption.Better) {\r\n doneLimitPrice = doneOrder.SetPrice;\r\n } else if (doneOrder.TradeOption == TradeOption.Stop) {\r\n doneStopPrice = doneOrder.SetPrice;\r\n }\r\n }\r\n });\r\n }\r\n\r\n if (doneLimitPrice || doneStopPrice) {\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.IfDone:
\r\n
\r\n {doneLimitPrice ? \"DialogWindow.TakeProfitDone\" : \"\"} {doneLimitPrice ? \"=\" + doneLimitPrice : \"\"}\r\n  \r\n {doneStopPrice ? \"DialogWindow.StopLossDone\" : \"\"} {doneStopPrice ? \"=\" + doneStopPrice : \"\"}\r\n
\r\n
);\r\n }\r\n\r\n\r\n\r\n if (order.DQMaxMove != 0 && !utils.isEmpty(order.DQMaxMove)) {\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.MovePips:
\r\n
{order.DQMaxMove}
\r\n
);\r\n }\r\n\r\n if (instrument.Category == InstrumentCategory.Physical && parseInt(order.PhysicalTradeSide) == PhysicalTradeSide.Buy) {\r\n let administrativeCharge = calcAdministrativeCharge(model, account, instrument, order);\r\n let instalmentPolicyDetail = model.placingData.physicalOptions.instalmentPolicyDetail;\r\n if (utils.isEmpty(order.Period)) { // full paid\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.FullAmount:
\r\n
{instrumentCurrency.Name} {utils.formatNumber(marketValue, currency.Decimals)}
\r\n
);\r\n if (utils.parseBoolean(order.IsOpen)) {\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.PaidAmount:
\r\n
DialogWindow.Physical_FullPayment{instrumentCurrency.Name} {utils.formatNumber(marketValue, currency.Decimals)}
\r\n
);\r\n }\r\n } else if (parseInt(order.Period) == 1) { // pre paid\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.FullAmount:
\r\n
{instrumentCurrency.Name}{utils.formatNumber(marketValue, currency.Decimals)}
\r\n
);\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.Physical_PaymentType:
\r\n
DialogWindow.Physical_AdvancePayment
\r\n
);\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.Physical_AdvanceAmount:
\r\n
{utils.formatNumber(order.AdvanceAmount, currency.Decimals)}
\r\n
);\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.PaidAmount:
\r\n
DialogWindow.AdvancePayment_DownPayment {instrumentCurrency.Name} {utils.formatNumber(order.AdvanceAmount, currency.Decimals)}
\r\n
);\r\n } else if (parseInt(order.Period) > 1) { // instalment\r\n let downPayment = (instalmentPolicyDetail && parseInt(instalmentPolicyDetail.DownPaymentBasis) === 0) ? order.DownPayment * 100 : order.DownPayment;\r\n let downPaymentPercent = (instalmentPolicyDetail && parseInt(instalmentPolicyDetail.DownPaymentBasis) === 0) ? '%' : '';\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.FullAmount:
\r\n
{instrumentCurrency.Name} {utils.formatNumber(marketValue, currency.Decimals)}
\r\n
);\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.Physical_PaymentType:
\r\n
DialogWindow.Physical_Instalment
\r\n
);\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.Physical_InstalmentType:
\r\n
{order.PhysicalInstalmentType == PhysicalInstalmentType.EqualInstalment ? \"DialogWindow.Physical_EqualInstalment\" : \"DialogWindow.Physical_EqualPrincipal\"}
\r\n
);\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.Physical_Period:
\r\n
{order.Period}
\r\n
);\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.Physical_DownPayment:
\r\n
{downPayment} {downPaymentPercent}
\r\n
);\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.PaidAmount:
\r\n
DialogWindow.Instalment_DownPayment {instrumentCurrency.Name} {utils.formatNumber(order.AdvanceAmount, currency.Decimals)}
\r\n
);\r\n if (model.placingData.physicalOptions.instalmentPolicyDetail && model.placingData.physicalOptions.instalmentPolicyDetail.InterestRate != 0) {\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.InterestRateBuy:
\r\n
{model.placingData.physicalOptions.instalmentPolicyDetail.InterestRate * 100}%
\r\n
);\r\n }\r\n if (order.AdministrationFee) {\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.Physical_HandlingFee:
\r\n
{order.AdministrationFee} {order.AdministrationFeeBase == AdministrationFeeBaseType.Percentage ? '%' : ''}
\r\n
);\r\n }\r\n }\r\n if (administrativeCharge != 0) {\r\n orderDiv.push(
\r\n
\r\n
DialogWindow.Physical_AdministrativeCharge:
\r\n
{currency.Name} {utils.formatNumber(administrativeCharge, 2)}
\r\n
);\r\n }\r\n }\r\n }); //tran.Order.forEach\r\n\r\n }); // transactions.forEach\r\n\r\n\r\n\r\n let phaseString = \"DialogWindow.SubmittedAwaitingConfirmation\";\r\n let cancelReason = undefined;\r\n let cancelReasonRow = \"\";\r\n if (transactions[0].transactionError === undefined || transactions[0].transactionError === \"OK\") {\r\n\r\n if (orderPhase === Phase.Placed) phaseString = \"DialogWindow.PlacedWaitToBeFilled\";\r\n else if (orderPhase === Phase.Canceled) {\r\n phaseString = \"DialogWindow.Canceled\";\r\n if (transactions[0].Order[0].CancelReason == CancelReason.OtherReason) {\r\n cancelReason = \"DialogWindow.TransactionError_OutOfAcceptDQVariation\";\r\n } else {\r\n cancelReason = getCancelMessage(transactions[0].Order[0].CancelReason);\r\n }\r\n }\r\n else if (orderPhase === Phase.Executed || orderPhase === Phase.Completed) phaseString = \"DialogWindow.Confirmed\";\r\n else phaseString = \"DialogWindow.SubmittedAwaitingConfirmation\";\r\n } else {\r\n phaseString = \"DialogWindow.Close\";\r\n cancelReason = getTransactionErrorMessage(transactions[0].transactionError);\r\n }\r\n\r\n if (cancelReason) {\r\n cancelReasonRow =
\r\n
DialogWindow.Reason:
\r\n
{cancelReason}
\r\n
;\r\n }\r\n\r\n let buttonFooter = [\r\n
\r\n
DialogWindow.Submit
\r\n
{ document.body.style.overflow = \"auto\"; this.props.onCancel.bind(this)() }} >DialogWindow.Close
\r\n
\r\n ];\r\n\r\n if (this.props.model.placingData && this.props.model.placingData.transactions) {\r\n buttonFooter =
{phaseString}
;\r\n }\r\n\r\n return document.body.style.overflow = \"auto\"}\r\n title={
DialogWindow.OrderDetail
}\r\n visible={this.props.visible} footer={buttonFooter}\r\n >\r\n\r\n\r\n
\r\n {(orderPhase === Phase.Executed || orderPhase === Phase.Completed || orderPhase === Phase.Placed) ?\r\n
\r\n
DialogWindow.TransactionNumber:
\r\n
{this.formatOrderCodes(orderCodes)}
\r\n
: ''}\r\n\r\n
\r\n
{timeTitle}:
\r\n
{timeValue.substring(10)}
\r\n
\r\n\r\n
\r\n
DialogWindow.Item:
\r\n
{instrument.Description}
\r\n
\r\n\r\n
\r\n
DialogWindow.Type:
\r\n
{openCloseKey} {orderTypeKey}
\r\n
\r\n\r\n\r\n\r\n {orderDiv}\r\n\r\n {cancelReasonRow}\r\n\r\n
\r\n\r\n\r\n\r\n
\r\n }\r\n }\r\n\r\n\r\n\r\n}\r\n","import { timers } from 'jquery';\r\nimport React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { Button, Modal } from 'antd';\r\nimport Slider, { Range } from 'rc-slider';\r\nimport 'rc-slider/assets/index.css';\r\n\r\nimport { isNumeric, isEmpty } from '../common/utils';\r\n\r\nimport BaseView from \"./baseview.js\";\r\n\r\nlet buttonStyle = {\r\n display: 'inline-block',\r\n width: '10%',\r\n textAlign: 'center'\r\n}\r\n\r\nlet fullWidthStyle = {\r\n width: '100%'\r\n}\r\n\r\nexport default class InputNumberComponent extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n // console.log('InputNumberComponent ctor');\r\n this.inputBox = React.createRef();\r\n this.state = {\r\n modalVisible: false,\r\n // settings: props.settings,\r\n isChanged: false,\r\n value: props.value === undefined ? '' : props.value\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.onSubComponentLoad) {\r\n this.props.onSubComponentLoad(this.props.name ? this.props.name : \"InputNumberComponent\", this);\r\n }\r\n }\r\n\r\n resetInput(value) {\r\n console.log(this.props.name, 'resetInput', value);\r\n this.setState({ value: value ? value : '' });\r\n }\r\n\r\n onModalCancel() {\r\n this.setState({ modalVisible: false });\r\n }\r\n\r\n onDecrease(event, setModalValueOnly) {\r\n if (this.props.disabled) return;\r\n\r\n this.setState({ isChanged: true });\r\n let value = (setModalValueOnly ? this.state.modalValue : this.state.value);\r\n this.notifyChange(parseFloat(value) - this.props.settings.step, setModalValueOnly);\r\n }\r\n\r\n onIncrease(event, setModalValueOnly) {\r\n if (this.props.disabled) return;\r\n\r\n this.setState({ isChanged: true });\r\n let value = (setModalValueOnly ? this.state.modalValue : this.state.value);\r\n this.notifyChange(parseFloat(value) + this.props.settings.step, setModalValueOnly);\r\n }\r\n\r\n onTextClick(event) {\r\n if (this.props.disabled) return;\r\n this.setState({ modalValue: isEmpty(this.state.value) ? this.props.settings.default : this.state.value, modalVisible: true });\r\n\r\n if (this.inputBox.current) {\r\n this.inputBox.current.focus();\r\n }\r\n }\r\n\r\n onChange(event, setModalValueOnly) {\r\n if (this.props.disabled) return;\r\n\r\n let value = event.target.value;\r\n if (value.length <= 28) {\r\n //let n = parseFloat(value);\r\n if (isNumeric(value)) {\r\n this.onValueChange(value, setModalValueOnly);\r\n }\r\n }\r\n\r\n }\r\n onSliderValueChange(value) {\r\n if (document.activeElement != this.inputBox.current) {\r\n this.onValueChange(value, true);\r\n }\r\n }\r\n\r\n onValueChange(value, setModalValueOnly) {\r\n if (this.props.disabled) return;\r\n if (setModalValueOnly) {\r\n this.setState({ isChanged: true, modalValue: value });\r\n } else {\r\n this.setState({ isChanged: true, value: value });\r\n }\r\n console.log('onValueChange');\r\n }\r\n\r\n onBlur(event, setModalValueOnly) {\r\n if (this.props.disabled) return;\r\n this.notifyChange(parseFloat(event.target.value), setModalValueOnly);\r\n }\r\n\r\n\r\n notifyChange(value, setModalValueOnly) {\r\n // if(!this.state.isChanged) return false;\r\n if (value !== '') {\r\n if (!isNumeric(value)) { value = this.props.settings.min; }\r\n\r\n if (value !== this.props.settings.min && value !== this.props.settings.max) {\r\n value = parseInt((value / this.props.settings.step).toFixed(6)) * this.props.settings.step;\r\n value = parseFloat(value.toFixed(6)); // Math.round2(value*100, 8)/100; \r\n value = this.validate(value);\r\n }\r\n }\r\n\r\n if (this.state.value != value) {\r\n if (setModalValueOnly) {\r\n this.setState({ modalValue: value });\r\n // return true;\r\n } else if (this.props.onChange && this.props.onChange(value, this.props.attachment)) {\r\n this.setState({ value: value });\r\n // return true;\r\n }\r\n }\r\n //return false;\r\n }\r\n\r\n validate(value) {\r\n if (value < this.props.settings.min) {\r\n value = this.props.settings.min;\r\n }\r\n else if (value > this.props.settings.max) {\r\n value = this.props.settings.max;\r\n }\r\n return value.toFixed(this.props.settings.decimals);\r\n }\r\n\r\n onModalOk() {\r\n this.setState({ isChanged: true, modalVisible: false });\r\n this.notifyChange(parseFloat(this.state.modalValue));\r\n }\r\n\r\n onModalClear() {\r\n this.setState({ isChanged: true, modalVisible: false });\r\n this.notifyChange('');\r\n }\r\n\r\n render() {\r\n document.body.style.overflow = \"auto\";\r\n let moduleCss = this.getModuleCss('inputnumber', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n let { settings, isPad } = this.props;\r\n\r\n if (!settings) return '';\r\n\r\n let footer = [\r\n
\r\n this.onChange.bind(this)(e, true)} onBlur={(e) => this.onBlur.bind(this)(e, true)} onFocus={(e) => e.target.select()} />\r\n {this.props.disallowClear ? '' : ()}\r\n \r\n
\r\n ];\r\n\r\n\r\n let mainClass = `${isPad ? moduleCss.mainPanePad : moduleCss.mainPane} ${this.props.disabled ? defaultCss.disabledColor : ''}`;\r\n // let mainClass = `${isPad ? moduleCss.mainPanePad : moduleCss.mainPane}`;\r\n return
\r\n\r\n
\r\n {this.props.hideSpinButton ? '' : (
-
)}\r\n
{isEmpty(this.state.value) ? (this.props.placeHolder ? this.props.placeHolder : '\\u00A0') : parseFloat(this.state.value).toFixed(settings.decimals)}
\r\n {this.props.hideSpinButton ? '' : (
+
)}\r\n
\r\n\r\n document.body.style.overflow = \"auto\"}>\r\n\r\n\r\n
{settings.min === undefined ? '' : settings.min.toFixed(settings.decimals)}
\r\n
{settings.max === undefined ? '' : settings.max.toFixed(settings.decimals)}
\r\n\r\n
this.onDecrease.bind(this)(e, true)}>-
\r\n
this.onSliderValueChange.bind(this)(v)} />
\r\n
this.onIncrease.bind(this)(e, true)}>+
\r\n\r\n
\r\n\r\n
\r\n\r\n
\r\n\r\n
\r\n }\r\n}\r\n\r\n","import React from 'react';\r\n// import ReactDOM from 'react-dom';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Button, Checkbox, Select, Radio } from 'antd';\r\nimport { Trans } from 'react-i18next';\r\n\r\nimport * as utils from '../../common/utils.js';\r\nimport { PhysicalInstalmentType, InstalmentFrequence, PaymentForm } from '../../common/const';\r\nimport { exchangeRate, calculateInstalmentDetails } from '../../model/physicalHelper';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\nimport InputNumberComponent from '../inputnumbercomponent';\r\n\r\n\r\nconst { Option } = Select;\r\nclass PlacingInstalmentDetailView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.onSubComponentLoad) {\r\n this.props.onSubComponentLoad(\"PlacingInstalmentView\", this);\r\n }\r\n console.log('PlacingInstalmentView.componentDidMount');\r\n }\r\n\r\n\r\n\r\n\r\n getRows(instalments) {\r\n let { model } = this.props;\r\n let account = model.selectedAccount;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let currency = undefined;\r\n if (Boolean.parseBoolean(account.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n }\r\n else {\r\n currency = model.currencies[account.CurrencyId];\r\n }\r\n let result = [];\r\n result.push(this.getRow(DialogWindow.Physical_Period, DialogWindow.Currency, DialogWindow.Physical_PrincipalInstalment, DialogWindow.Physical_InterestInstalment, DialogWindow.Physical_InstalmentAmount));\r\n instalments.forEach((item, index) => {\r\n result.push(this.getRow(item.period, currency.Name, utils.formatNumber(item.principal, currency.Decimals), utils.formatNumber(item.interest, currency.Decimals), utils.formatNumber(item.instalmentAmount, currency.Decimals)));\r\n });\r\n return result;\r\n }\r\n\r\n getRow(period, currency, principal, interest, amount) {\r\n let moduleCss = this.getModuleCss('placeview', 'common');\r\n return
\r\n
{period}
\r\n
{currency}
\r\n
{principal}
\r\n
{interest}
\r\n
{amount}
\r\n
\r\n }\r\n\r\n\r\n onSubmitButtonClick(e) {\r\n // this.setPlacingData();\r\n let { model, isPad, onSubmitClick } = this.props;\r\n if (onSubmitClick) {\r\n onSubmitClick(true);\r\n }\r\n }\r\n\r\n render() {\r\n console.log('PlacingInstalmentView.render');\r\n let moduleCss = this.getModuleCss('placeview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n let { model, isPad } = this.props;\r\n let account = model.selectedAccount;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let currency = undefined;\r\n if (Boolean.parseBoolean(account.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n }\r\n else {\r\n currency = model.currencies[account.CurrencyId];\r\n }\r\n let physicalOptions = model.placingData.physicalOptions;\r\n let prePaymentAmount = 0;\r\n let marketValue = model.calcPhysicalMarketValue();\r\n let paymentForm = (model.placingData.physicalOptions.period == 1 ? PaymentForm.AdvancePayment : PaymentForm.Instalment);\r\n let discount = model.calculatePhysicalPaymentDiscount(account, instrument, model.placingData.lot, marketValue, paymentForm);\r\n\r\n if (parseInt(physicalOptions.instalmentPolicyDetail.DownPaymentBasis) === 0) {\r\n prePaymentAmount = Math.round2(marketValue * (parseFloat(physicalOptions.downPayment)) / 100, 4) + discount;\r\n } else {\r\n prePaymentAmount = parseFloat(physicalOptions.downPayment) * model.placingData.lot + discount;\r\n }\r\n\r\n let period = physicalOptions.period;\r\n let instalmentPolicy = model.instalmentPolicies[physicalOptions.instalmentPolicyId];\r\n if (utils.parseBoolean(instalmentPolicy && instalmentPolicy.IsDownPayAsFirstPay)) {\r\n period = physicalOptions.period - 1;\r\n }\r\n let data = calculateInstalmentDetails(physicalOptions.physicalInstalmentType, marketValue - prePaymentAmount, period, physicalOptions.frequence, physicalOptions.interestRate, parseInt(physicalOptions.currency.Decimals), physicalOptions.currency.Name);\r\n\r\n return
\r\n {isPad ? '' : DialogWindow.Physical_Instalment} onGobackClick={this.props.onTitleGobackClick} />}\r\n {this.getRows(data.instalments)}\r\n {this.getRow(DialogWindow.Physical_Collect, '', utils.formatNumber(data.totalPrincipal, currency.Decimals), utils.formatNumber(data.totalInterest, currency.Decimals), utils.formatNumber(data.totalInstalmentAmount, currency.Decimals))}\r\n
\r\n {isPad ? '' :
\r\n DialogWindow.Physical_InstalmentTips\r\n
}\r\n \r\n
\r\n
\r\n }\r\n\r\n}\r\nlet placingInstalmentDetailView = withRouter(PlacingInstalmentDetailView);\r\nexport { placingInstalmentDetailView as PlacingInstalmentDetailView };\r\n","import React from 'react';\r\n// import ReactDOM from 'react-dom';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Button, Checkbox, Select, Radio } from 'antd';\r\nimport { Trans } from 'react-i18next';\r\n\r\nimport * as utils from '../../common/utils.js';\r\nimport { PhysicalInstalmentType, InstalmentFrequence, RecalculateRateType, getEnumLangaugeKey, OrderType, TradeOption, PaymentForm, AdministrationFeeBaseType } from '../../common/const';\r\nimport { getDownpaymentSettings, calculateDiscount } from '../../model/physicalHelper';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\nimport InputNumberComponent from '../inputnumbercomponent';\r\nimport { PlacingInstalmentDetailView } from './placinginstalmentdetailview';\r\n\r\nconst { Option } = Select;\r\nclass PlacingInstalmentView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n this.state = this.initSelectOptions(true);\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.onSubComponentLoad) {\r\n this.props.onSubComponentLoad(\"PlacingInstalmentView\", this);\r\n }\r\n\r\n\r\n console.log('PlacingInstalmentView.componentDidMount');\r\n }\r\n\r\n initSelectOptions(isInit) {\r\n let { model } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n let tradePolicy = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let instalmentPolicy = model.instalmentPolicies[tradePolicy.InstalmentPolicyId];\r\n let allowedInstalmentTypes = parseInt(instalmentPolicy.AllowedInstalmentTypes);\r\n let physicalInstalmentTypeSelectOptions = [];\r\n let physicalInstalmentType = undefined;\r\n\r\n let recalculateRateType = undefined;\r\n let recalculateRateTypes = [];\r\n\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n let marketValue = model.calcPhysicalMarketValue();\r\n\r\n let frequences = {};\r\n let frequencesOptions = [];\r\n\r\n\r\n if ((PhysicalInstalmentType.EqualInstalment & allowedInstalmentTypes) == PhysicalInstalmentType.EqualInstalment) {\r\n if (physicalInstalmentType === undefined) physicalInstalmentType = PhysicalInstalmentType.EqualInstalment;\r\n physicalInstalmentTypeSelectOptions.push();\r\n }\r\n if ((PhysicalInstalmentType.EqualPrincipal & allowedInstalmentTypes) === PhysicalInstalmentType.EqualPrincipal) {\r\n if (physicalInstalmentType === undefined) physicalInstalmentType = PhysicalInstalmentType.EqualPrincipal;\r\n physicalInstalmentTypeSelectOptions.push();\r\n }\r\n\r\n if (parseInt(instalmentPolicy.RecalculateRateTypes) & RecalculateRateType.RecalucateNextMonth) {\r\n recalculateRateType = RecalculateRateType.RecalucateNextMonth;\r\n recalculateRateTypes.push();\r\n }\r\n\r\n if (parseInt(instalmentPolicy.RecalculateRateTypes) & RecalculateRateType.RecalucateNextYear) {\r\n if (recalculateRateType === undefined) recalculateRateType = RecalculateRateType.RecalucateNextYear;\r\n recalculateRateTypes.push();\r\n }\r\n\r\n let instalmentPolicyDetails = Object.values(instalmentPolicy.details).sort((a, b) => a.Frequence.localeCompare(b.Frequence));\r\n instalmentPolicyDetails.forEach((detail, index) => {\r\n let frequence = parseInt(detail.Frequence);\r\n if (frequence !== InstalmentFrequence.Occasional && frequences[frequence] === undefined) {\r\n frequences[frequence] = frequence;\r\n\r\n let languageKey = getEnumLangaugeKey(\"InstalmentFrequence\", frequence);\r\n frequencesOptions.push();\r\n }\r\n });\r\n\r\n let result = {\r\n period: model.placingData.physicalOptions.period,\r\n downPayment: model.placingData.physicalOptions.downPayment,\r\n marketValue: marketValue,\r\n physicalInstalmentTypeSelectOptions: physicalInstalmentTypeSelectOptions,\r\n physicalInstalmentType: model.placingData.physicalOptions.physicalInstalmentType,\r\n frequences: frequences,\r\n frequencesOptions: frequencesOptions,\r\n frequence: parseInt(model.placingData.physicalOptions.frequence), //frequences[0],\r\n recalculateRateTypes: recalculateRateTypes,\r\n recalculateRateType: model.placingData.physicalOptions.recalculateRateType\r\n };\r\n\r\n if (model.placingData.orderType == OrderType.Limit) {\r\n result.tradeOption = (model.placingData.useLimitPrice ? TradeOption.Better : TradeOption.Stop);\r\n }\r\n Object.assign(result, this.setPeriods(model.placingData.physicalOptions.frequence, isInit));\r\n if (!isInit) {\r\n this.setState(result);\r\n }\r\n return result;\r\n }\r\n\r\n setPeriods(frequence, isInit) {\r\n let { model } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n let tradePolicy = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let instalmentPolicy = model.instalmentPolicies[tradePolicy.InstalmentPolicyId];\r\n\r\n let periods = [];\r\n let periodOptions = [];\r\n let instalmentPolicyDetail = undefined;\r\n let instalmentPolicyDetails = Object.values(instalmentPolicy.details).sort((a, b) => a.Frequence.localeCompare(b.Frequence));\r\n for (const detail of instalmentPolicyDetails) {\r\n if (utils.parseBoolean(detail.IsActive) && parseInt(detail.Frequence) === parseInt(frequence)) { // && (parseInt(detail.Period) === parseInt(model.placingData.physicalOptions.period) || model.placingData.physicalOptions.period == undefined)) {\r\n if (instalmentPolicyDetail == undefined) {\r\n if (parseInt(model.placingData.physicalOptions.frequence) !== parseInt(frequence) || parseInt(detail.Period) === parseInt(model.placingData.physicalOptions.period)) {\r\n instalmentPolicyDetail = detail;\r\n }\r\n }\r\n periods.push(parseInt(detail.Period));\r\n periodOptions.push();\r\n //break;\r\n }\r\n };\r\n\r\n let downPayment = (parseInt(instalmentPolicyDetail.DownPaymentBasis) === 0 ? model.placingData.physicalOptions.downPayment / 100 : model.placingData.physicalOptions.downPayment);\r\n let downpaymentSettings = getDownpaymentSettings(instalmentPolicyDetail, isInit ? downPayment : undefined);\r\n let result = Object.assign(downpaymentSettings, { periodOptions: periodOptions, periods: periods });\r\n if (parseInt(model.placingData.physicalOptions.frequence) !== parseInt(frequence)) {\r\n // model.placingData.physicalOptions.downPayment = instalmentPolicyDetail.downPayment;\r\n // model.placingData.physicalOptions.frequence = frequence;\r\n model.buildPlacingPhysicalOptions(instalmentPolicyDetail);\r\n }\r\n result.period = model.placingData.physicalOptions.period = instalmentPolicyDetail.Period;\r\n result.unit = downpaymentSettings.downPaymentSettings.unit;\r\n // if (parseInt(instalmentPolicyDetail.DownPaymentBasis) === 0) {\r\n // result.downPayment /= 100;\r\n // }\r\n if (!isInit) {\r\n this.setState(result);\r\n }\r\n\r\n // let downPayment = downpaymentSettings.downPayment;\r\n // if (parseInt(instalmentPolicyDetail.DownPaymentBasis) === 0) {\r\n // downPayment = downpaymentSettings.downPayment / 100;\r\n // }\r\n this.refreshAdministrationFee(instalmentPolicyDetail, downPayment);\r\n this.forceUpdate();\r\n return result;\r\n }\r\n\r\n resetInput(props, isConstructor) { this.setSelectOptions(); }\r\n\r\n setStateProp(propName, propValue) {\r\n let { model } = this.props;\r\n let prop = {};\r\n prop[propName] = propValue;\r\n this.setState(prop);\r\n\r\n // if (parseInt(this.state.instalmentPolicyDetail.DownPaymentBasis) === 0) {\r\n // propValue = propValue / 100;\r\n // }\r\n\r\n model.placingData.physicalOptions[propName] = propValue;\r\n if (propName == 'downPayment') {\r\n let downPayment = (parseInt(this.state.instalmentPolicyDetail.DownPaymentBasis) === 0 ? propValue / 100 : propValue);\r\n this.refreshAdministrationFee(this.state.instalmentPolicyDetail, downPayment);\r\n }\r\n this.forceUpdate();\r\n console.log('setStateProp', propName, propValue);\r\n return true;\r\n }\r\n\r\n getStateValue(propName, defaultValue) {\r\n return this.state[propName] !== undefined ? this.state[propName] : defaultValue;\r\n }\r\n\r\n onInstalmentOptionChange(value, option) {\r\n console.log('PlacingInstalmentView.onInstalmentOptionChange');\r\n this.setStateProp('physicalInstalmentType', value);\r\n }\r\n\r\n onFrequenceChange(value, option) {\r\n console.log('PlacingInstalmentView.onFrequenceChange');\r\n\r\n let { model } = this.props;\r\n // this.setState({ frequence: value });\r\n delete model.placingData.physicalOptions.period;\r\n this.setPeriods(value);\r\n this.setStateProp('frequence', parseInt(value));\r\n\r\n }\r\n\r\n onRecalculateRateTypeChange(value, option) {\r\n console.log('PlacingInstalmentView.onRecalculateRateTypeChange');\r\n // this.setState({ recalculateRateType: value });\r\n this.setStateProp('recalculateRateType', value);\r\n }\r\n\r\n onPeriodChange(value, option) {\r\n console.log('PlacingInstalmentView.onPeriodChange');\r\n let { model } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n let tradePolicy = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let instalmentPolicy = model.instalmentPolicies[tradePolicy.InstalmentPolicyId];\r\n\r\n let instalmentPolicyDetail = undefined;\r\n let instalmentPolicyDetails = Object.values(instalmentPolicy.details).sort((a, b) => a.Frequence.localeCompare(b.Frequence));\r\n instalmentPolicyDetails.forEach((detail, index) => {\r\n if (parseInt(detail.Frequence) === this.state.frequence && parseInt(detail.Period) === value) {\r\n instalmentPolicyDetail = detail;\r\n }\r\n });\r\n\r\n // let downPayment = (parseInt(instalmentPolicyDetail.DownPaymentBasis) === 0 ? model.placingData.physicalOptions.downPayment / 100 : model.placingData.physicalOptions.downPayment);\r\n let downpaymentSettings = getDownpaymentSettings(instalmentPolicyDetail);\r\n // this.setState(downpaymentSettings);\r\n this.state.downPaymentSettings.decimals = downpaymentSettings.downPaymentSettings.decimals;\r\n this.state.downPaymentSettings.default = downpaymentSettings.downPaymentSettings.default;\r\n this.state.downPaymentSettings.max = downpaymentSettings.downPaymentSettings.max;\r\n this.state.downPaymentSettings.min = downpaymentSettings.downPaymentSettings.min;\r\n this.state.downPaymentSettings.step = downpaymentSettings.downPaymentSettings.step;\r\n this.state.downPaymentSettings.unit = downpaymentSettings.downPaymentSettings.unit;\r\n this.setStateProp('downPayment', downpaymentSettings.downPayment);\r\n this.setStateProp('period', value);\r\n this.setStateProp('instalmentPolicyDetail', instalmentPolicyDetail);\r\n let downPayment = (parseInt(instalmentPolicyDetail.DownPaymentBasis) === 0 ? model.placingData.physicalOptions.downPayment / 100 : model.placingData.physicalOptions.downPayment);\r\n this.refreshAdministrationFee(instalmentPolicyDetail, downPayment);\r\n model.placingData.physicalOptions.marketValue = model.calcPhysicalMarketValue(PaymentForm.Instalment);\r\n model.placingData.physicalOptions.interestRate = instalmentPolicyDetail.InterestRate;\r\n this.forceUpdate();\r\n }\r\n\r\n refreshAdministrationFee(instalmentPolicyDetail, downPayment) {\r\n\r\n let administrationFee = 0;\r\n if (parseInt(instalmentPolicyDetail.Period) > 1) {\r\n if (instalmentPolicyDetail.AdministrationFeeBase == AdministrationFeeBaseType.Percentage) {\r\n administrationFee = parseFloat(parseFloat(instalmentPolicyDetail.AdministrationFee / (1 - downPayment) * 100).toFixed(2));\r\n } else {\r\n administrationFee = parseFloat(instalmentPolicyDetail.AdministrationFee);\r\n }\r\n this.setStateProp('administrationFee', administrationFee);\r\n }\r\n }\r\n\r\n setPlacingData() {\r\n let { model } = this.props;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n\r\n let isMultiCurrency = Boolean.parseBoolean(model.selectedAccount.IsMultiCurrency);\r\n let currency = model.currencies[isMultiCurrency ? instrument.CurrencyId : model.selectedAccount.CurrencyId];\r\n let tradePolicy = this.props.model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n\r\n model.placingData.physicalOptions.period = this.state.period;\r\n model.placingData.physicalOptions.marketValue = this.state.marketValue = model.calcPhysicalMarketValue();\r\n model.placingData.physicalOptions.frequence = this.state.frequence;\r\n model.placingData.physicalOptions.physicalInstalmentType = this.state.physicalInstalmentType;\r\n model.placingData.physicalOptions.recalculateRateType = this.state.recalculateRateType;\r\n model.placingData.physicalOptions.downPayment = this.state.downPayment;\r\n }\r\n\r\n onSubmitButtonClick(e) {\r\n this.setPlacingData();\r\n let { model, isPad, onSubmitClick } = this.props;\r\n if (onSubmitClick) {\r\n onSubmitClick(true);\r\n }\r\n }\r\n\r\n onNextButtonClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n if (this.props.onInstalmentDetailButtonClick) {\r\n this.props.onInstalmentDetailButtonClick();\r\n }\r\n // this.setPlacingData();\r\n // this.goto('/placinginstalmentdetail');\r\n }\r\n\r\n\r\n onCloseButtonClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n if (this.props.onClose) {\r\n this.props.onClose();\r\n }\r\n }\r\n\r\n\r\n onBackgroundPaneClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n\r\n render() {\r\n console.log('PlacingInstalmentView.render');\r\n let moduleCss = this.getModuleCss('placeview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n let { model, isPad } = this.props;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let isMultiCurrency = Boolean.parseBoolean(model.selectedAccount.IsMultiCurrency);\r\n let currency = model.currencies[isMultiCurrency ? instrument.CurrencyId : model.selectedAccount.CurrencyId];\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n let isBuy = model.placingData.isBuy;\r\n\r\n let buyPrice = (isNormal ? instrument.quotation.Ask : instrument.quotation.Bid);\r\n let sellPrice = (isNormal ? instrument.quotation.Bid : instrument.quotation.Ask);\r\n let price = (model.placingData.isBuy ? buyPrice : sellPrice);\r\n if (model.placingData.orderType == OrderType.Limit) {\r\n price = (model.placingData.physicalOptions.tradeOption == TradeOption.Better ? model.placingData.limitPrice : model.placingData.stopPrice);\r\n }\r\n\r\n let prePaymentAmount = 0;\r\n let marketValue = model.calcPhysicalMarketValue();\r\n let paymentForm = (model.placingData.physicalOptions.period == 1 ? PaymentForm.AdvancePayment : PaymentForm.Instalment);\r\n let discount = model.calculatePhysicalPaymentDiscount(model.selectedAccount, instrument, model.placingData.lot, marketValue, paymentForm);\r\n\r\n if (parseInt(this.state.instalmentPolicyDetail.DownPaymentBasis) === 0) {\r\n prePaymentAmount = Math.round2(marketValue * (parseFloat(this.state.downPayment)) / 100, 4) + discount;\r\n } else {\r\n prePaymentAmount = parseFloat(this.state.downPayment) * model.placingData.lot + discount;\r\n }\r\n model.placingData.physicalOptions.advanceAmount = prePaymentAmount;\r\n\r\n return
\r\n {isPad ? '' : {this.state.period > 1 ? \"DialogWindow.Physical_Instalment\" : \"DialogWindow.Physical_AdvancePayment\"}} onGobackClick={this.props.onTitleGobackClick} />}\r\n
1 ? '45%' : '100%', display: 'inline-block', height: '100%', overflow: 'auto', borderTop: '1px solid #ccc', marginTop: isPad ? '' : '2.5em' }}>\r\n\r\n {model.placingData.useLimitPrice && model.placingData.useStopPrice ?\r\n
\r\n
DialogWindow.Physical_InstalmentType
\r\n
\r\n \r\n
\r\n
\r\n : ''}\r\n\r\n\r\n
\r\n
DialogWindow.Lot
\r\n
{model.placingData.lot}
\r\n
\r\n\r\n
\r\n
DialogWindow.Physical_UnitPrice
\r\n
{price}
\r\n
\r\n {this.state.period <= 1 ? '' :\r\n [
\r\n
DialogWindow.Physical_InstalmentType
\r\n
\r\n \r\n
\r\n
,\r\n
\r\n
DialogWindow.Physical_Frequency
\r\n
\r\n\r\n \r\n\r\n
\r\n
,\r\n
\r\n
DialogWindow.Physical_Period
\r\n
\r\n \r\n
\r\n
,\r\n
\r\n
DialogWindow.Physical_InterestRecalculationRateType
\r\n
\r\n \r\n
\r\n
]}\r\n
\r\n
DialogWindow.Physical_DownPayment
\r\n
\r\n
this.setStateProp('downPayment', value)}>
\r\n {this.state.downPaymentSettings.unit}\r\n
\r\n
\r\n
\r\n
DialogWindow.Physical_TotalMarketValue
\r\n
{utils.formatNumber(marketValue, currency.Decimals)}
\r\n
\r\n {this.state.period != 1 ?
\r\n
DialogWindow.Physical_InterestRate
\r\n
{parseFloat(this.state.instalmentPolicyDetail.InterestRate) * 100}%
\r\n
:\r\n
\r\n
DialogWindow.Physical_AdvanceAmount
\r\n
{utils.formatNumber(prePaymentAmount, currency.Decimals)}
\r\n
\r\n }\r\n\r\n {this.state.period == 1 ? '' :\r\n
\r\n
DialogWindow.Physical_HandlingFee
\r\n
{utils.formatNumber(model.placingData.physicalOptions.administrationFee, currency.Decimals)} {this.state.instalmentPolicyDetail.AdministrationFeeBase == AdministrationFeeBaseType.Percentage ? '%' : ''}
\r\n
}\r\n\r\n
\r\n
{this.state.period > 1 ? \"DialogWindow.Physical_RepaymentAmount\" : \"DialogWindow.Physical_RemainAmount\"}
\r\n
{utils.formatNumber(parseFloat(marketValue - prePaymentAmount), currency.Decimals)}
\r\n
\r\n\r\n {!discount ? '' :\r\n
\r\n
DialogWindow.Physical_PaymentDiscount
\r\n
{utils.formatNumber(discount, currency.Decimals)}
\r\n
}\r\n\r\n\r\n
\r\n DialogWindow.Physical_InstalmentTips\r\n
\r\n\r\n
\r\n {!isPad ? '' : }\r\n \r\n {isPad || this.state.period <= 1 ? '' : }\r\n
\r\n\r\n
\r\n {isPad && this.state.period > 1 ?
\r\n \r\n
: ''}\r\n\r\n
\r\n\r\n }\r\n\r\n}\r\nlet placingInstalmentView = withRouter(PlacingInstalmentView);\r\nexport { placingInstalmentView as PlacingInstalmentView };\r\n","import {Price} from './price2.js';\r\nimport {BuySell, LimitOrStop} from '../common/const';\r\nimport {isEmpty }from '../common/utils';\r\n\r\nexport function getPendingPriceSetting(model, instrument, basePrice, pips, limitOrStop, buySell, isDone)\r\n{\r\n if(isEmpty(basePrice)) return {};\r\n basePrice = parseFloat(basePrice);\r\n let result ={};\r\n let pendingPrice = null;\r\n\r\n let numerator = parseInt(instrument.NumeratorUnit);\r\n let denominator = parseInt(instrument.Denominator);\r\n let dealingPolicyDetail = instrument.dealingPolicyDetail;\r\n let acceptLmtVariation = (parseFloat(isEmpty(dealingPolicyDetail) ? instrument.AcceptLmtVariation : dealingPolicyDetail.AcceptLmtVariation) + parseInt(pips)) / denominator;\r\n if(isDone){\r\n acceptLmtVariation = (parseFloat(isEmpty(dealingPolicyDetail) ? instrument.AcceptIfDoneVariation : dealingPolicyDetail.AcceptIfDoneVariation) + parseInt(pips)) / denominator;\r\n }\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n let isBuy = isNormal === (buySell === BuySell.Buy);\r\n \r\n // let quotation = instrument.quotation; \r\n // let ask = parseFloat(quotation.Ask);\r\n // let bid = parseFloat(quotation.Bid); \r\n // let basePrice = isBuy ? ask : bid;\r\n\r\n if (limitOrStop === LimitOrStop.Limit){\r\n pendingPrice = isBuy ? basePrice - acceptLmtVariation : basePrice + acceptLmtVariation; \r\n }\r\n else{\r\n pendingPrice = isBuy ? basePrice + acceptLmtVariation : basePrice - acceptLmtVariation;\r\n }\r\n\r\n let pricingPolicyDetail = model.getPricingPolicyDetail(instrument.PricingPolicyId, pendingPrice);\r\n if (pricingPolicyDetail != null) {\r\n numerator = parseInt(pricingPolicyDetail.Numerator);\r\n acceptLmtVariation = acceptLmtVariation * (pricingPolicyDetail.OrderVariationFactor - 1);\r\n \r\n if (limitOrStop === LimitOrStop.Limit){\r\n pendingPrice = (isBuy ? pendingPrice - acceptLmtVariation : pendingPrice + acceptLmtVariation ); \r\n }\r\n else {\r\n pendingPrice = (isBuy ? pendingPrice + acceptLmtVariation : pendingPrice - acceptLmtVariation );\r\n } \r\n\r\n \r\n }\r\n pendingPrice = Price.GetPrice(pendingPrice.toString(), numerator, denominator).ToDouble();\r\n result.default = pendingPrice;\r\n result.step = Math.round2(numerator/ instrument.Denominator, 6);\r\n if(limitOrStop === LimitOrStop.Limit){\r\n if(isBuy){\r\n result.max= pendingPrice;\r\n result.min = Price.GetPrice(((isDone ? pendingPrice : basePrice) * 0.8).toString(), numerator, denominator).ToDouble(); \r\n }else{\r\n result.min = pendingPrice;\r\n result.max = Price.GetPrice(((isDone ? pendingPrice : basePrice) * 1.2).toString(), numerator, denominator).ToDouble();\r\n }\r\n }else{\r\n if(isBuy){\r\n result.min = pendingPrice;\r\n result.max = Price.GetPrice(((isDone ? pendingPrice : basePrice) * 1.2).toString(), numerator, denominator).ToDouble();\r\n }else{\r\n result.max= pendingPrice;\r\n result.min = Price.GetPrice(((isDone ? pendingPrice : basePrice) * 0.8).toString(), numerator, denominator).ToDouble(); \r\n \r\n }\r\n }\r\n\r\n result.decimals = denominator.toString().length - 1;\r\n\r\n return result;\r\n}\r\n\r\nexport function getDqIfDonePriceSetting(instrument, movePips, isBuy, isLimit)\r\n{\r\n let dealingPolicyDetail = instrument.dealingPolicyDetail;\r\n let acceptIfDoneVariation = parseFloat(dealingPolicyDetail == null ? instrument.AcceptIfDoneVariation : dealingPolicyDetail.AcceptIfDoneVariation); \r\n if(movePips){\r\n acceptIfDoneVariation += movePips;\r\n }\r\n\r\n let quotation = instrument.quotation;\r\n let numerator = parseInt(instrument.NumeratorUnit);\r\n let denominator = parseInt(instrument.Denominator);\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n let basePrice = (isBuy === isNormal && isLimit ? quotation.Ask : quotation.Bid);\r\n acceptIfDoneVariation = (isBuy == isNormal ? acceptIfDoneVariation : -acceptIfDoneVariation);\r\n if(!isLimit){\r\n acceptIfDoneVariation = -acceptIfDoneVariation;\r\n }\r\n \r\n let minPrice = Price.GetPrice(basePrice, numerator, denominator).Add(acceptIfDoneVariation).ToDouble();\r\n let maxPrice = minPrice * 1.2;\r\n let defaulPrice = minPrice;\r\n if(acceptIfDoneVariation <0){\r\n maxPrice = minPrice;\r\n minPrice = Price.GetPrice((parseFloat(basePrice) + acceptIfDoneVariation / instrument.Denominator) * 0.8, numerator, denominator).ToDouble();\r\n defaulPrice = maxPrice; \r\n }\r\n\r\n // let minPrice = Price.GetPrice(min, numerator, denominator);\r\n // let maxPrice = Price.GetPrice(max, numerator, denominator);\r\n\r\n return { default: defaulPrice, min: minPrice, max:maxPrice, step: numerator/denominator, decimals: denominator.toString().length-1 };\r\n\r\n}\r\n\r\n\r\n\r\n/*\r\nexport function getPriceForDone(instrument, pricingPolicyDetail, spread, basePrice, isLimit, isBuyOfIfOrder)\r\n{\r\n\r\n let isBuy = !isBuyOfIfOrder;\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n let numerator = parseInt(instrument.NumeratorUnit);\r\n let denominator = parseInt(instrument.Denominator);\r\n let result = null;\r\n\r\n let dealingPolicyDetail = instrument.dealingPolicyDetail;\r\n let acceptIfDoneVariation = parseFloat(dealingPolicyDetail == null ? instrument.AcceptIfDoneVariation : dealingPolicyDetail.AcceptIfDoneVariation)/denominator; \r\n spread = spread / denominator;\r\n \r\n if (isBuy === isNormal)\r\n {\r\n result = isLimit ? basePrice - acceptIfDoneVariation : basePrice + acceptIfDoneVariation;\r\n }\r\n else\r\n {\r\n result = isLimit ? basePrice + acceptIfDoneVariation : basePrice - acceptIfDoneVariation;\r\n }\r\n\r\n if (pricingPolicyDetail != null)\r\n {\r\n if (!isLimit && spread > acceptIfDoneVariation * pricingPolicyDetail.OrderVariationFactor)\r\n {\r\n acceptIfDoneVariation = spread - acceptIfDoneVariation;\r\n }\r\n else\r\n {\r\n acceptIfDoneVariation = parseInt(acceptIfDoneVariation * (pricingPolicyDetail.OrderVariationFactor - 1));\r\n }\r\n\r\n if (isBuy === isNormal)\r\n {\r\n result = isLimit ? result - acceptIfDoneVariation : result + acceptIfDoneVariation;\r\n }\r\n else\r\n {\r\n result = isLimit ? result + acceptIfDoneVariation : result - acceptIfDoneVariation;\r\n }\r\n\r\n result = result.toFixed(instrument.Denominator.length -1);\r\n }\r\n\r\n let defaulPrice = result; \r\n \r\n acceptIfDoneVariation = (isBuy === isNormal ? acceptIfDoneVariation : -acceptIfDoneVariation);\r\n if(!isLimit){\r\n acceptIfDoneVariation = -acceptIfDoneVariation;\r\n }\r\n if(acceptIfDoneVariation <0){\r\n let maxPrice = defaulPrice;\r\n let minPrice = Price.GetPrice(parseFloat(basePrice) + acceptIfDoneVariation / denominator * 0.8, numerator, denominator).ToDouble();\r\n }\r\n\r\n return result;\r\n}\r\n*/","import React from 'react';\r\n// import ReactDOM from 'react-dom';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Trans } from 'react-i18next';\r\n\r\nimport { Button, Checkbox, Select, Radio, message as antMessage } from 'antd';\r\nimport { EllipsisOutlined, CloseOutlined } from '@ant-design/icons';\r\n\r\n\r\nimport * as utils from '../../common/utils.js';\r\nimport { TransactionType, OrderType, BuySell, LimitOrStop, InstrumentCategory, PaymentForm, BSStatus, PhysicalInstalmentType, PhysicalTradeSide } from '../../common/const';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport ExpireSelectView from './expireselectview';\r\nimport PlaceConfirmView from './placeconfirmview';\r\nimport { PlacingInstalmentView } from './placinginstalmentview';\r\nimport { PlacingInstalmentDetailView } from './placinginstalmentdetailview';\r\nimport InputNumberComponent from '../inputnumbercomponent';\r\nimport { getLotSettings, getMovePipsSettings } from '../../model/placinglotsetting';\r\nimport { getPendingPriceSetting } from '../../model/placingpricesetting';\r\n\r\n\r\nconst { Option } = Select;\r\nconst SubViewType = { None: 0, Instalment: 1, InstalmentDetail: 2 };\r\nconst SaveLotCookey = 'SpotTradeLot';\r\nconst SavePipsCookey = 'SpotTradePips';\r\n\r\nclass PlacingDqView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n\r\n let { model, isPad } = props;\r\n if (!isPad) model.resetInput();\r\n\r\n if (model && model.placingData && model.selectedAccount) {\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let lotSettings = getLotSettings(model.selectedAccount, instrument, true, true);\r\n let savedLot = parseFloat(utils.loadCookie(model.customer.Id + instrument.Id + SaveLotCookey));\r\n if (savedLot > lotSettings.max || savedLot < lotSettings.min) {\r\n savedLot = undefined;\r\n }\r\n let savedPips = parseFloat(utils.loadCookie(model.customer.Id + instrument.Id + SavePipsCookey));\r\n\r\n if (model.placingData.lot === undefined) model.placingData.lot = lotSettings.default;\r\n let expireTypes = model.getExpireTypes(instrument);\r\n this.state = {\r\n lotSettings: lotSettings,\r\n lot: savedLot ? savedLot : model.placingData.lot,\r\n subViewType: SubViewType.None,\r\n instalmentDetailButtonVisible: false,\r\n saveLot: savedLot ? true : false,\r\n savePips: savedPips ? true : false,\r\n paymentForms: [],\r\n expireTypes: expireTypes,\r\n expireType: expireTypes && expireTypes.length > 0 ? expireTypes[0] : 0\r\n }\r\n }\r\n\r\n this.subComponents = {};\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.onSubComponentLoad) {\r\n this.props.onSubComponentLoad(this.props.name ? this.props.name : \"placingDqView\", this);\r\n }\r\n\r\n let { model } = this.props;\r\n if (model.placingData && model.placingData.quoteCallback) {\r\n delete model.placingData.quoteCallback;\r\n delete model.placingData.quoteAnswer;\r\n delete model.placingData.isQuoteTimeout;\r\n window.clearTimeout(model.placingData.quoteTimeoutId);\r\n }\r\n\r\n if (model.placingData && model.placingData.selectedInstrument) {\r\n let orderTypes = model.placingData.selectedInstrument.getAvailableOrderTypes();\r\n let isMarket = orderTypes.indexOf(OrderType.Market) >= 0;\r\n let orderType = isMarket ? OrderType.Market : OrderType.SpotTrade;\r\n\r\n model.placingData.orderType = orderType;\r\n }\r\n this.setPaymentOptions();\r\n }\r\n\r\n onSubComponentLoad(name, comp) {\r\n this.subComponents[name] = comp;\r\n }\r\n\r\n resetInput(props, isConstructor) {\r\n console.log(\"PlacingDqView.resetInput\");\r\n let { model } = (props === undefined ? this.props : props);\r\n model.resetInput();\r\n this.setState({ orderingNotifyId: undefined });\r\n if (model && model.placingData && model.selectedAccount) {\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let lotSettings = getLotSettings(model.selectedAccount, instrument, true, model.closeLot == 0);\r\n\r\n let dealingPolicy = instrument.dealingPolicyDetail;\r\n let maxDqLot = parseFloat(utils.isEmpty(dealingPolicy) ? instrument.MaxDQLot : dealingPolicy.MaxDQLot);\r\n let maxOtherLot = parseFloat(utils.isEmpty(dealingPolicy) ? instrument.MaxOtherLot : dealingPolicy.MaxOtherLot);\r\n let savedLot = parseFloat(utils.loadCookie(model.customer.Id + instrument.Id + SaveLotCookey));\r\n if (savedLot > lotSettings.max || savedLot < lotSettings.min) {\r\n savedLot = undefined;\r\n }\r\n\r\n let savedPips = parseFloat(utils.loadCookie(model.customer.Id + instrument.Id + SavePipsCookey));\r\n let state = { lotSettings: lotSettings, lot: savedLot ? savedLot : lotSettings.default, maxDqLot: maxDqLot, saveLot: savedLot ? true : false, savePips: savedPips ? true : false, pips: 0, doneLimitPrice: undefined, doneStopPrice: undefined };\r\n\r\n if (isConstructor) {\r\n this.state = state;\r\n } else {\r\n this.setState(state);\r\n }\r\n model.placingData.lot = state.lot;\r\n\r\n if (this.subComponents.lotInput) this.subComponents.lotInput.resetInput(savedLot ? savedLot : lotSettings.default);\r\n if (this.subComponents.pipsInput) this.subComponents.pipsInput.resetInput(savedPips ? savedPips : '0');\r\n if (this.subComponents.doneLimitPriceInput) this.subComponents.doneLimitPriceInput.resetInput();\r\n if (this.subComponents.doneStopPriceInput) this.subComponents.doneStopPriceInput.resetInput();\r\n\r\n // if (this.subComponents.pipsInput) this.subComponents.pipsInput.resetInput(this.getStateValue('pips'));\r\n }\r\n\r\n this.setPaymentOptions();\r\n }\r\n\r\n onCloseOrderClick() {\r\n if (this.props.onCloseOrderClick) {\r\n this.props.onCloseOrderClick();\r\n }\r\n }\r\n\r\n onBackgroundPaneClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n\r\n setStateProp(propName, propValue) {\r\n let prop = {};\r\n prop[propName] = propValue;\r\n this.setState(prop);\r\n\r\n let { model } = this.props;\r\n if (propName === \"lot\") {\r\n model.placingData.lot = parseFloat(propValue);\r\n\r\n if (model.placingData.orderingNotifyId === undefined) {\r\n model.placingData.orderingNotifyId = utils.uuid();\r\n }\r\n model.orderingNotify(model.placingData.orderingNotifyId, model.customer.Code, model.placingData.selectedInstrument.Code, this.props.isBuy.toString(), 'true', propValue.toString(), (d) => { debugger; });\r\n\r\n } else if (propName === \"pips\") {\r\n model.placingData.pips = propValue;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n getStateValue(propName, defaultValue) {\r\n if (propName === \"lot\" && this.props.model.closeLot) {\r\n return this.props.model.closeLot;\r\n } else {\r\n return this.state[propName] !== undefined ? this.state[propName] : defaultValue;\r\n }\r\n }\r\n\r\n beforeSubmitClick(isBuy) {\r\n let { model, t } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n let account = model.selectedAccount;\r\n\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n\r\n let canShortSell = ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.ShortSell) == PhysicalTradeSide.ShortSell);\r\n if (instrument.Category == InstrumentCategory.Physical) {\r\n if (!isBuy && !model.closeLot) {\r\n if (canShortSell) {\r\n let text = utils.format2(t('DialogWindow.PlacingConfirmation_ShortSellingMayOccurred'), account.Name);\r\n model.showModalDialog(text, () => this.onSubmitClick(isBuy));\r\n } else {\r\n model.showModalDialog(DialogWindow.PlaceOrder_ShortSellNotAllowed);\r\n }\r\n return;\r\n }\r\n }\r\n\r\n this.onSubmitClick(isBuy);\r\n }\r\n\r\n onSubmitClick(isBuy) {\r\n let { model } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n let account = model.selectedAccount;\r\n\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n if (instrument.Category == InstrumentCategory.Physical) {\r\n let canBuy = ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.Buy) == PhysicalTradeSide.Buy);\r\n let canShortSell = ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.ShortSell) == PhysicalTradeSide.ShortSell);\r\n if (!isBuy && !model.closeLot && !canShortSell) {\r\n model.showModalDialog(DialogWindow.PlaceOrder_ShortSellNotAllowed);\r\n return;\r\n }\r\n }\r\n\r\n let allowedNewTradeSides = instrument.dealingPolicyDetail ? instrument.dealingPolicyDetail.AllowedNewTradeSides : instrument.AllowedNewTradeSides;\r\n if (!Boolean.parseBoolean(account.AllowAddNewPosition) || allowedNewTradeSides == 0) {\r\n model.showModalDialog(DialogWindow.PlacingOrder_NewPositionIsNotAllowed);\r\n return;\r\n }\r\n\r\n this.setState({ subViewType: SubViewType.None });\r\n if (this.props.onSwitchFullScreen) {\r\n this.props.onSwitchFullScreen(false);\r\n }\r\n\r\n if (instrument.needQuote(this.state.lot)) {\r\n if (model.placingData && model.placingData.quoteCallback) {\r\n delete model.placingData.quoteCallback;\r\n delete model.placingData.quoteAnswer;\r\n delete model.placingData.isQuoteTimeout;\r\n window.clearTimeout(model.placingData.quoteTimeoutId);\r\n }\r\n\r\n model.placingData.quoteCallback = (answer) => {\r\n console.log('answer callback', answer);\r\n if (answer.InstrumentId == instrument.Id && parseFloat(answer.QuoteLot) == parseFloat(this.state.lot)) {\r\n delete model.placingData.quoteCallback;\r\n this.submit(isBuy);\r\n }\r\n };\r\n this.setState({ transactions: undefined, confirmDialogVisible: true });\r\n let orderTypes = instrument.getAvailableOrderTypes();\r\n let isMarket = orderTypes.indexOf(OrderType.Market) >= 0;\r\n let orderType = isMarket ? OrderType.Market : OrderType.SpotTrade;\r\n this.startSpotTradedPromptUIKeepSeconds(orderType);\r\n model.placingData.quoteTimeoutId = setTimeout(() => model.placingData.isQuoteTimeout = true,\r\n parseFloat(model.settingData.SystemParameter.EnquiryOutTime) * 1000);\r\n\r\n model.commService.quote(instrument.Id, this.state.lot, BSStatus.Both, model.placingData.pips, (e) => console.log(e));\r\n } else {\r\n this.submit(isBuy);\r\n }\r\n }\r\n\r\n startSpotTradedPromptUIKeepSeconds(orderType) {\r\n let model = this.props.model;\r\n if (orderType === OrderType.SpotTrade) {\r\n let spotTradedPromptUIKeepSeconds = parseInt(model.settingData.SystemParameter.SpotTradedPromptUIKeepSeconds);\r\n if (spotTradedPromptUIKeepSeconds > 0) {\r\n setTimeout(() => this.setState({ confirmDialogVisible: false }), spotTradedPromptUIKeepSeconds * 1000);\r\n }\r\n }\r\n }\r\n\r\n submit(isBuy) {\r\n console.log('placingDqView.submit');\r\n let { model, isPad } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n\r\n let quotation = model.placingData.quoteAnswer && model.placingData.quoteAnswer.Ask ? model.placingData.quoteAnswer : instrument.quotation;\r\n let buyPrice = (isNormal ? quotation.Ask : quotation.Bid);\r\n let sellPrice = (isNormal ? quotation.Bid : quotation.Ask);\r\n\r\n let dqPrices = { buyPrice: buyPrice, sellPrice: sellPrice, doneLimitPrice: this.state.doneLimitPrice, doneStopPrice: this.state.doneStopPrice };\r\n let orderTypes = instrument.getAvailableOrderTypes();\r\n let isMarket = orderTypes.indexOf(OrderType.Market) >= 0;\r\n let orderType = isMarket ? OrderType.Market : OrderType.SpotTrade;\r\n let lot = model.placingData.quoteAnswer && model.placingData.quoteAnswer.AnswerLot <= this.state.lot ? model.placingData.quoteAnswer.AnswerLot : this.state.lot;\r\n if (!model.placingData.lot) {\r\n model.placingData.lot = lot;\r\n }\r\n let trans = model.buildTransactions(instrument, TransactionType.Single, orderType, isBuy, lot, undefined, dqPrices, undefined, undefined, this.state.expireType, this.state.expireTime);\r\n\r\n // trans.forEach((tran, item) => {\r\n // let xmlDoc =utils.convertToXml(tran, 'Transaction');\r\n // model.commService.place(xmlDoc.toString());\r\n // }); \r\n model.placingData.transactions = undefined;\r\n model.placingData.transactionsBeforSubmit = trans;\r\n if (model.closeLot) {\r\n model.placingData.orderType = orderType;\r\n if (this.props.onSubmit) {\r\n this.props.onSubmit();\r\n }\r\n } else {\r\n model.placingData.transactions = undefined;\r\n if (instrument.fastTradeChecked) {\r\n model.placingData.transactions = trans;\r\n this.setState({ transactions: trans, confirmDialogVisible: true });\r\n this.startSpotTradedPromptUIKeepSeconds(orderType);\r\n this.placeTransaction();\r\n } else {\r\n // this.startCountDownForPrice();\r\n if (isPad) model.startDqPriceCountDown(instrument, () => { if (!this.state.isConfirmOkClicked) this.setState({ confirmDialogVisible: false }) });\r\n this.setState({ isConfirmOkClicked: false, transactions: trans, confirmDialogVisible: true });\r\n this.startSpotTradedPromptUIKeepSeconds(orderType);\r\n }\r\n\r\n }\r\n\r\n if (!model.closeLot) {\r\n if (this.state.saveLot) {\r\n utils.saveCookie(model.customer.Id + instrument.Id + SaveLotCookey, this.state.lot);\r\n } else {\r\n utils.removeCookie(model.customer.Id + instrument.Id + SaveLotCookey);\r\n }\r\n }\r\n\r\n if (this.state.savePips) {\r\n utils.saveCookie(model.customer.Id + instrument.Id + SavePipsCookey, this.state.pips);\r\n } else {\r\n utils.removeCookie(model.customer.Id + instrument.Id + SavePipsCookey);\r\n }\r\n }\r\n\r\n placeTransaction() {\r\n let { model, commService } = this.props;\r\n\r\n this.props.model.placingData.transactions.forEach((tran, index) => {\r\n let xmlDoc = utils.convertToXml(tran, 'Transaction');\r\n commService.place(tran);\r\n // this.refreshOpenOrderLot(this.props, true);\r\n });\r\n }\r\n\r\n\r\n onConfirmCancel(e, isConfirmed) {\r\n let { model, onConfirmClosed } = this.props;\r\n model.closeLot = 0;\r\n\r\n if (model.placingData && model.placingData.quoteCallback) {\r\n delete model.placingData.quoteCallback;\r\n delete model.placingData.quoteAnswer;\r\n delete model.placingData.isQuoteTimeout;\r\n window.clearTimeout(model.placingData.quoteTimeoutId);\r\n }\r\n\r\n this.setState({ confirmDialogVisible: false });\r\n\r\n if (onConfirmClosed) {\r\n onConfirmClosed(isConfirmed);\r\n }\r\n }\r\n\r\n onConfirmOk(e) {\r\n let { model, commService, isPad } = this.props;\r\n this.setState({ isConfirmOkClicked: true });\r\n\r\n this.state.transactions.forEach((tran, index) => {\r\n commService.place(tran);\r\n model.closeLot = 0;\r\n });\r\n // model.resetInput();\r\n this.resetInput();\r\n }\r\n\r\n onExpireSelectViewChange(e) {\r\n this.setState({ expireType: e.expireType, expireTime: e.date });\r\n }\r\n\r\n setPaymentOptions(selectedPaymentForm) {\r\n console.log(\"PlacingDqView.setPaymentOptions\");\r\n let { model } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n let tradePolicy = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let result = [];\r\n let paymentForms = [];\r\n let allowedPaymentForm = parseInt(tradePolicy.PaymentForm);\r\n if (allowedPaymentForm && (allowedPaymentForm & PaymentForm.FullPayment) === PaymentForm.FullPayment) {\r\n paymentForms.push(PaymentForm.FullPayment);\r\n result.push();\r\n }\r\n if (allowedPaymentForm && (allowedPaymentForm & PaymentForm.AdvancePayment) === PaymentForm.AdvancePayment) {\r\n paymentForms.push(PaymentForm.AdvancePayment);\r\n result.push();\r\n }\r\n if (allowedPaymentForm && (allowedPaymentForm & PaymentForm.Instalment) === PaymentForm.Instalment) {\r\n paymentForms.push(PaymentForm.Instalment);\r\n result.push();\r\n }\r\n\r\n if (selectedPaymentForm == undefined) {\r\n selectedPaymentForm = paymentForms.length > 0 ? paymentForms[0] : undefined;\r\n }\r\n\r\n this.setState({ paymentSelectOptions: result, paymentForms: paymentForms, selectedPaymentForm: selectedPaymentForm, instalmentDetailButtonVisible: selectedPaymentForm !== PaymentForm.FullPayment });\r\n\r\n let isPhysical = (parseInt(instrument.Category) === InstrumentCategory.Physical);\r\n let instalmentPolicyDetail = undefined;\r\n if (isPhysical) {\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let instalmentPolicy = model.instalmentPolicies[tradePolicyDetail.InstalmentPolicyId];\r\n\r\n if (instalmentPolicy != undefined && instalmentPolicy.details != undefined) {\r\n let instalmentPolicyDetails = Object.values(instalmentPolicy.details).sort((a, b) => a.Frequence.localeCompare(b.Frequence));\r\n for (const detail of instalmentPolicyDetails) {\r\n if (selectedPaymentForm == PaymentForm.AdvancePayment && parseInt(detail.Period) == 1) {\r\n instalmentPolicyDetail = detail;\r\n break;\r\n\r\n } else if (selectedPaymentForm == PaymentForm.Instalment && parseInt(detail.Period) > 1) {\r\n instalmentPolicyDetail = detail;\r\n break;\r\n }\r\n };\r\n }\r\n model.buildPlacingPhysicalOptions(instalmentPolicyDetail);\r\n }\r\n }\r\n\r\n onPaymentOptionChange(value, option) {\r\n this.setPaymentOptions(value);\r\n }\r\n\r\n onInstalmentButtonClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n //this.onSubmitClick(this.props.isBuy);\r\n let { model, isPad } = this.props;\r\n if (isPad) {\r\n this.goto(\"/placinginstalment\");\r\n } else {\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let lotSettings = getLotSettings(model.selectedAccount, instrument, true, model.closeLot == 0);\r\n\r\n let savedLot = parseFloat(utils.loadCookie(model.customer.Id + instrument.Id + SaveLotCookey));\r\n if (savedLot > lotSettings.max || savedLot < lotSettings.min) {\r\n savedLot = undefined;\r\n }\r\n model.placingData.lot = parseFloat(parseFloat(this.getStateValue('lot', savedLot ? savedLot : lotSettings.default)).toFixed(6));\r\n\r\n this.setState({ subViewType: SubViewType.Instalment });\r\n if (this.props.onSwitchFullScreen) {\r\n this.props.onSwitchFullScreen(true);\r\n }\r\n }\r\n }\r\n\r\n onInstalmentDetailButtonClick() {\r\n this.setState({ subViewType: SubViewType.InstalmentDetail });\r\n }\r\n\r\n\r\n onTitleGobackClick() {\r\n this.setState({ subViewType: SubViewType.None });\r\n if (this.props.onSwitchFullScreen) {\r\n this.props.onSwitchFullScreen(false);\r\n }\r\n }\r\n\r\n onClosePaneClick() {\r\n this.props.onClosePaneClick();\r\n }\r\n\r\n onOrderTypeChange(orderType) {\r\n let { model } = this.props;\r\n // model.placingData.lot = this.state.lot;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let lotSettings = getLotSettings(model.selectedAccount, instrument, true, model.closeLot == 0);\r\n let savedLot = parseFloat(utils.loadCookie(model.customer.Id + instrument.Id + SaveLotCookey));\r\n if (savedLot > lotSettings.max || savedLot < lotSettings.min) {\r\n savedLot = undefined;\r\n }\r\n model.placingData.lot = parseFloat(parseFloat(this.getStateValue('lot', savedLot ? savedLot : lotSettings.default)).toFixed(6));\r\n\r\n this.props.onOrderTypeChange(orderType);\r\n }\r\n\r\n render() {\r\n let moduleCss = this.getModuleCss('placeview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n let { isBuy, model, isPad } = this.props;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let pipsSettings = getMovePipsSettings(model.selectedAccount, instrument);\r\n\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n let basePrice = (isNormal === isBuy ? instrument.quotation.Ask : instrument.quotation.Bid);\r\n let limtPriceSetting = getPendingPriceSetting(model, instrument, basePrice, 0, LimitOrStop.Limit, !isBuy ? BuySell.Buy : BuySell.Sell, true);\r\n let stopPriceSetting = getPendingPriceSetting(model, instrument, basePrice, 0, LimitOrStop.Stop, !isBuy ? BuySell.Buy : BuySell.Sell, true);\r\n let orderTypes = instrument.getAvailableOrderTypes();\r\n let isMarket = orderTypes.indexOf(OrderType.Market) >= 0;\r\n let canPlaceIfDoneOrder = model.canPlaceIfDoneOrder(instrument, true);\r\n\r\n // let expireTypes = model.getExpireTypes(instrument);\r\n\r\n let isPhysical = (parseInt(instrument.Category) === InstrumentCategory.Physical);\r\n\r\n let isLogedin = (model && model.isLogedin());\r\n let canPlaceOrder = isLogedin && (model.canPlaceOrder(model.selectedAccount, instrument, OrderType.SpotTrade) || model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Market));\r\n let canPlacePendingOrder = model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Limit);\r\n let submitButtonClass = isBuy ? moduleCss.buyColor : moduleCss.sellColor; // defaultCss.defaultButtonColor; // \r\n if (!canPlaceOrder) {\r\n submitButtonClass = defaultCss.disabledColor;\r\n }\r\n\r\n let bottomButtonRow =
\r\n
{ if (canPlaceOrder) this.beforeSubmitClick.bind(this)(isBuy) }} > DialogWindow.ClickTo {isBuy ? \"MainView.Buy\" : \"MainView.Sell\"}
\r\n {!canPlacePendingOrder ? '' :
this.onOrderTypeChange(OrderType.Limit)}> DialogWindow.PendingOrder
}\r\n
;\r\n let allowOrderingNotify = (model && model.settingData && model.settingData.SystemParameter) ? utils.parseBoolean(model.settingData.SystemParameter.AllowOrderingNotify) : false;\r\n if (allowOrderingNotify) {\r\n\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n\r\n let quotation = instrument.quotation; // model.placingData.clickedQuotation;\r\n if (!quotation) quotation = {};\r\n let buyPrice = (isNormal ? quotation.Ask : quotation.Bid);\r\n let sellPrice = (isNormal ? quotation.Bid : quotation.Ask);\r\n let clickedPrice = isBuy ? buyPrice : sellPrice;\r\n bottomButtonRow =
\r\n
{ if (canPlaceOrder) this.beforeSubmitClick.bind(this)(isBuy) }} >
DialogWindow.ClickTo {isBuy ? \"MainView.Buy\" : \"MainView.Sell\"}
{clickedPrice}
\r\n {!canPlacePendingOrder ? '' :
this.onOrderTypeChange(OrderType.Limit)}>
 
DialogWindow.PendingOrder
}\r\n
;\r\n }\r\n\r\n let submitText = isBuy ? MainView.Buy : MainView.Sell;\r\n if (this.props.isPad) {\r\n if (model.placingData.closeBuyLot && model.placingData.closeSellLot) { // close buy and sell order\r\n // submitButtonClass = \"\";\r\n submitText = [MainView.Buy, \"/\", MainView.Sell];\r\n }\r\n else if (model.placingData.closeBuyLot || model.placingData.closeSellLot) { // close buy or sell order\r\n // submitButtonClass = (model.placingData.closeSellLot ? moduleCss.buyColor : moduleCss.sellColor);\r\n submitText = model.placingData.closeSellLot ? MainView.Buy : MainView.Sell;\r\n }\r\n\r\n let submitButtonStyle = { textAlign: \"center\", fontSize: '1.4em', marginLeft: '0.4em', width: 'calc(100% - 0.8em)', borderRadius: '4px', border: 'darkgray solid 1px' };\r\n // let submitButtonClass = `${!canSubmit ? defaultCss.disabledColor : ()} ${moduleCss.row}`;\r\n bottomButtonRow =
{ if (canPlaceOrder) this.beforeSubmitClick.bind(this)(isBuy) }} > {submitText} MainView.Submit
\r\n }\r\n\r\n let closePaneButtonStyle = { display: \"inline-block\", width: \"2em\", marginRight: '0.5em', textAlign: \"center\", float: 'right', borderWidth: isPad ? '1px' : '0', borderStyle: 'solid', color: 'inherit' };\r\n let closePaneButtonClass = defaultCss.defaultBorderColor; // isPad ? (isBuy ? moduleCss.buyColor : moduleCss.sellColor) : \"\";\r\n let closePaneButton =
{ console.log('dq onClosePaneClick'); this.props.onClosePaneClick() }} >
;\r\n let titleBar = isPad ?\r\n
MainView.OrderType\r\n { this.onOrderTypeChange(e.target.value); }}>\r\n {isMarket ? \"DialogWindow.MarketOrder\" : \"DialogWindow.SpotOrder\"}\r\n {!canPlacePendingOrder ? '' : DialogWindow.PendingOrder}\r\n \r\n {/* closePaneButton */}\r\n
\r\n :
{isMarket ? \"DialogWindow.MarketOrder\" : \"DialogWindow.SpotOrder\"}
;\r\n let lotSettings = getLotSettings(model.selectedAccount, instrument, true, model.closeLot == 0);\r\n let savedLot = parseFloat(utils.loadCookie(model.customer.Id + instrument.Id + SaveLotCookey));\r\n if (savedLot > lotSettings.max || savedLot < lotSettings.min) {\r\n savedLot = undefined;\r\n }\r\n let lot = parseFloat(parseFloat(this.getStateValue('lot', savedLot ? savedLot : lotSettings.default)).toFixed(6));\r\n let lotComponent = this.setStateProp('lot', value)}> ;\r\n\r\n let pips = parseFloat(utils.loadCookie(model.customer.Id + instrument.Id + SavePipsCookey));\r\n pips = pips ? pips : this.getStateValue('pips', pipsSettings ? pipsSettings.default : 0);\r\n\r\n let enableFastTrade = utils.parseBoolean(model.customer.EnableFastTrade);\r\n if (this.state.subViewType === SubViewType.Instalment)\r\n return \r\n else if (this.state.subViewType === SubViewType.InstalmentDetail)\r\n return \r\n else\r\n return
\r\n\r\n
\r\n {titleBar} {isPad ? '' : closePaneButton}\r\n
\r\n
\r\n {isPad ? \"\" :\r\n
\r\n
DialogWindow.CloseLot
\r\n \r\n
\r\n }\r\n
\r\n
{model.closeLot ? \"DialogWindow.CloseLot\" : \"DialogWindow.OpenLot\"}
\r\n
{lotComponent}
\r\n
{model.closeLot ? '' : this.setStateProp('saveLot', e.target.checked)}> DialogWindow.Save }
\r\n
\r\n\r\n {!isMarket && pipsSettings ?\r\n (
\r\n
DialogWindow.MovePips
\r\n
\r\n this.setStateProp('pips', value)}> \r\n
\r\n
this.setStateProp('savePips', e.target.checked)}> DialogWindow.Save
\r\n
\r\n ) : ''}\r\n\r\n {!model.closeLot && canPlaceIfDoneOrder ?
\r\n
\r\n
DialogWindow.CloseLimit
\r\n
\r\n this.setStateProp('doneLimitPrice', value)} placeHolder={DialogWindow.Price}> \r\n
\r\n
\r\n\r\n
\r\n
DialogWindow.CloseStop
\r\n
\r\n this.setStateProp('doneStopPrice', value)} placeHolder={DialogWindow.Price}>> \r\n
\r\n
\r\n\r\n
\r\n
DialogWindow.TimeExpired
\r\n
\r\n \r\n
\r\n
: ''}\r\n\r\n\r\n\r\n {(model.closeLot <= 0 || model.closeLot == undefined) && isPhysical && isBuy && !(this.state.paymentForms.length == 1 && this.state.paymentForms[0] == PaymentForm.FullPayment) ?\r\n (
\r\n
DialogWindow.Physical_PaymentType
\r\n
\r\n \r\n
\r\n {this.state.instalmentDetailButtonVisible ?
: ''}\r\n
\r\n ) : ''}\r\n\r\n\r\n
\r\n\r\n
\r\n
\r\n {!enableFastTrade ? '' : { instrument.fastTradeChecked = e.target.checked; this.forceUpdate() }}> DialogWindow.FastTradeNoConfirm }\r\n
\r\n\r\n {bottomButtonRow}\r\n
\r\n\r\n \r\n
\r\n\r\n }\r\n\r\n}\r\n\r\n// let placingDqView = withRouter(PlacingDqView);\r\nexport default withRouter(PlacingDqView);\r\n","import React from 'react';\r\n// import ReactDOM from 'react-dom';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Trans } from 'react-i18next';\r\n\r\nimport { message as antMessage, Button, Select, Checkbox, Radio } from 'antd';\r\nimport { EllipsisOutlined, CloseOutlined } from '@ant-design/icons';\r\n\r\n\r\nimport * as utils from '../../common/utils.js';\r\nimport { TransactionType, OrderType, LimitOrStop, BuySell, InstrumentCategory, PaymentForm, TradeOption, PhysicalTradeSide } from '../../common/const';\r\nimport { calculatePhysicalValue } from '../../model/physicalHelper';\r\nimport { isAcceptedNewLimitPosition, isAcceptedNewStopPosition } from '../../model/orderHelper';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport ExpireSelectView from './expireselectview';\r\nimport PlaceConfirmView from './placeconfirmview';\r\nimport { PlacingInstalmentView } from './placinginstalmentview';\r\nimport { PlacingInstalmentDetailView } from './placinginstalmentdetailview';\r\nimport InputNumberComponent from '../inputnumbercomponent';\r\nimport { getLotSettings } from '../../model/placinglotsetting';\r\nimport { getPendingPriceSetting } from '../../model/placingpricesetting';\r\n\r\nconst { Option } = Select;\r\nconst SubViewType = { None: 0, Instalment: 1, InstalmentDetail: 2 };\r\nconst SaveLotCookey = 'SpotTradeLot'; // LimitLot\r\nclass PlacingPendingView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n let { model, isPad } = props;\r\n //if (!isPad) model.resetInput();\r\n // this.resetInput(props, true); \r\n if (!isPad) model.resetInput();\r\n\r\n if (model && model.placingData && model.selectedAccount) {\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let lotSettings = getLotSettings(model.selectedAccount, instrument, true, true);\r\n let savedLot = parseFloat(utils.loadCookie(model.customer.Id + instrument.Id + SaveLotCookey));\r\n if (savedLot > lotSettings.max || savedLot < lotSettings.min) {\r\n savedLot = undefined;\r\n }\r\n\r\n if (model.placingData.lot === undefined) model.placingData.lot = lotSettings.default;\r\n let expireTypes = model.getExpireTypes(instrument);\r\n this.state = {\r\n lotSettings: lotSettings,\r\n lot: savedLot ? savedLot : model.placingData.lot,\r\n saveLot: savedLot ? true : false,\r\n expireTypes: expireTypes,\r\n expireType: expireTypes && expireTypes.length > 0 ? expireTypes[0] : 0\r\n }\r\n }\r\n this.subComponents = {};\r\n }\r\n\r\n componentDidMount() {\r\n console.log(\"PlacingPendingView.componentDidMount\");\r\n if (this.props.onSubComponentLoad) {\r\n this.props.onSubComponentLoad(this.props.name ? this.props.name : \"placingPendingView\", this);\r\n }\r\n\r\n let { model } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n model.placingData.orderType = OrderType.Limit;\r\n model.placingData.expireType = this.state.expireType;\r\n\r\n model.refreshAllowedCloseLot(instrument);\r\n let allowedCloseLot = model.placingData.isBuy ? instrument.allowedCloseLot_Buy_LimitOrStop : instrument.allowedCloseLot_Sell_LimitOrStop;\r\n this.setState({ hasOpenOrder: allowedCloseLot > 0 });\r\n\r\n this.setPaymentOptions(); \r\n }\r\n\r\n onSubComponentLoad(name, comp) {\r\n this.subComponents[name] = comp;\r\n }\r\n\r\n resetInput(props, isConstructor) {\r\n console.log(\"PlacingPendingView.resetInput\");\r\n let { model } = (props === undefined ? this.props : props);\r\n model.resetInput();\r\n if (model && model.placingData && model.selectedAccount) {\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let lotSettings = getLotSettings(model.selectedAccount, instrument, false, model.closeLot == 0);\r\n\r\n let dealingPolicy = instrument.dealingPolicyDetail;\r\n let maxDqLot = parseFloat(utils.isEmpty(dealingPolicy) ? instrument.MaxDQLot : dealingPolicy.MaxDQLot);\r\n let maxOtherLot = parseFloat(utils.isEmpty(dealingPolicy) ? instrument.MaxOtherLot : dealingPolicy.MaxOtherLot);\r\n let expireTypes = model.getExpireTypes(instrument);\r\n let savedLot = parseFloat(utils.loadCookie(model.customer.Id + instrument.Id + SaveLotCookey));\r\n if (savedLot > lotSettings.max || savedLot < lotSettings.min) {\r\n savedLot = undefined;\r\n }\r\n let state = {\r\n lotSettings: lotSettings,\r\n lot: savedLot ? savedLot : lotSettings.default,\r\n limitPrice: '',\r\n limitPriceDoneLimit: undefined,\r\n limitPriceDoneStop: undefined,\r\n\r\n stopPrice: '',\r\n stopPriceDoneLimit: undefined,\r\n stopPriceDoneStop: undefined,\r\n\r\n maxOtherLot: maxOtherLot,\r\n saveLot: savedLot ? true : false,\r\n expireTypes: expireTypes,\r\n expireType: expireTypes && expireTypes.length > 0 ? expireTypes[0] : 0\r\n };\r\n\r\n let paymentOptions = this.setPaymentOptions(isConstructor);\r\n Object.assign(state, paymentOptions);\r\n if (isConstructor) {\r\n this.state = state;\r\n } else {\r\n this.setState(state);\r\n }\r\n }\r\n model.placingData.useLimitPrice = false;\r\n model.placingData.useStopPrice = false;\r\n\r\n if (this.subComponents) {\r\n Object.values(this.subComponents).forEach((comp) => {\r\n if (comp.resetInput) comp.resetInput();\r\n });\r\n }\r\n\r\n }\r\n\r\n\r\n setStateProp(propName, propValue) {\r\n let { model } = this.props;\r\n\r\n let prop = {};\r\n prop[propName] = propValue;\r\n this.setState(prop);\r\n\r\n if (propName === 'isOcoChecked') {\r\n model.placingData.isOcoChecked = propValue;\r\n }\r\n\r\n if (propName === \"lot\") {\r\n model.placingData.lot = parseFloat(propValue);\r\n }\r\n if (propName === \"limitPrice\") {\r\n model.placingData.limitPrice = propValue;\r\n model.placingData.useLimitPrice = !utils.isEmpty(propValue);\r\n if (model.placingData.physicalOptions) {\r\n model.placingData.physicalOptions.downPayment = model.placingData.physicalOptions.marketValue = model.calcPhysicalMarketValue(PaymentForm.FullPayment);\r\n }\r\n model.refreshAllowedCloseLot(model.placingData.selectedInstrument);\r\n\r\n // this.onCloseOrderClick();\r\n if (this.props.forceUpdate) this.props.forceUpdate();\r\n } else if (propName === \"stopPrice\") {\r\n model.placingData.stopPrice = propValue;\r\n model.placingData.useStopPrice = !utils.isEmpty(propValue);\r\n if (model.placingData.physicalOptions) {\r\n model.placingData.physicalOptions.downPayment = model.placingData.physicalOptions.marketValue = model.calcPhysicalMarketValue(PaymentForm.FullPayment);\r\n }\r\n model.refreshAllowedCloseLot(model.placingData.selectedInstrument);\r\n\r\n //this.onCloseOrderClick();\r\n if (this.props.forceUpdate) this.props.forceUpdate();\r\n }\r\n }\r\n\r\n getStateValue(propName, defaultValue) {\r\n if (propName === \"lot\" && this.props.model.closeLot) {\r\n return this.props.model.closeLot;\r\n } else {\r\n return this.state[propName] !== undefined ? this.state[propName] : defaultValue;\r\n }\r\n }\r\n\r\n isOcoEnabled() {\r\n\r\n let { model } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n let isOpen = (model.closeLot ? false : true);\r\n\r\n return !utils.isEmpty(this.state.limitPrice) && !utils.isEmpty(this.state.stopPrice) && model.canPlaceOcoOrder(instrument, isOpen);\r\n }\r\n\r\n isSubmitEnabled() { return this.state.maxOtherLot > 0 && !utils.isEmpty(this.state.limitPrice) || !utils.isEmpty(this.state.stopPrice) }\r\n\r\n onInputChange(propName, value) {\r\n if (value >= 0) {\r\n this.setStateProp(propName, value);\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n onCloseOrderClick() {\r\n if (this.props.onCloseOrderClick) {\r\n this.props.onCloseOrderClick();\r\n }\r\n }\r\n\r\n onBackgroundPaneClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n\r\n onInstalmentButtonClick(e) {\r\n // if (this.onSubmitClick(this.props.isBuy)) {\r\n // this.goto(\"/placinginstalment\");\r\n // }\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n //this.onSubmitClick(this.props.isBuy);\r\n let { model, isPad } = this.props;\r\n\r\n model.placingData.physicalOptions.tradeOption = (model.placingData.useLimitPrice ? TradeOption.Better : TradeOption.Stop);\r\n if (isPad) {\r\n this.goto(\"/placinginstalment\");\r\n } else {\r\n this.setState({ subViewType: SubViewType.Instalment });\r\n if (this.props.onSwitchFullScreen) {\r\n this.props.onSwitchFullScreen(true);\r\n }\r\n }\r\n }\r\n\r\n onInstalmentDetailButtonClick() {\r\n this.setState({ subViewType: SubViewType.InstalmentDetail });\r\n }\r\n\r\n onTitleGobackClick() {\r\n this.setState({ subViewType: SubViewType.None });\r\n if (this.props.onSwitchFullScreen) {\r\n this.props.onSwitchFullScreen(false);\r\n }\r\n }\r\n\r\n onSubmitClick(isBuy) {\r\n\r\n let { model } = this.props;\r\n\r\n if (utils.isEmpty(this.state.limitPrice) && utils.isEmpty(this.state.stopPrice)) {\r\n model.showModalDialog(DialogWindow.PleaseEnterPrice);\r\n return false;\r\n }\r\n\r\n this.setState({ subViewType: SubViewType.None });\r\n if (this.props.onSwitchFullScreen) {\r\n this.props.onSwitchFullScreen(false);\r\n }\r\n\r\n let instrument = model.placingData.selectedInstrument;\r\n\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n if (instrument.Category == InstrumentCategory.Physical) {\r\n let canBuy = ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.Buy) == PhysicalTradeSide.Buy);\r\n let canShortSell = ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.ShortSell) == PhysicalTradeSide.ShortSell);\r\n if (!isBuy && !model.closeLot && !canShortSell) {\r\n model.showModalDialog(DialogWindow.PlaceOrder_ShortSellNotAllowed);\r\n return;\r\n }\r\n }\r\n\r\n let limitPrices = { setPrice: this.state.limitPrice, doneLimitPrice: this.state.limitPriceDoneLimit, doneStopPrice: this.state.limitPriceDoneStop };\r\n let stopPrices = { setPrice: this.state.stopPrice, doneLimitPrice: this.state.stopPriceDoneLimit, doneStopPrice: this.state.stopPriceDoneStop };\r\n\r\n let transactionType = (this.isOcoEnabled() && this.state.isOcoChecked ? TransactionType.OneCancelOther : TransactionType.Single);\r\n let orderType = (this.isOcoEnabled() && this.state.isOcoChecked ? OrderType.OneCancelOther : OrderType.Limit);\r\n if (!model.placingData.lot) {\r\n model.placingData.lot = this.state.lot;\r\n }\r\n let trans = model.buildTransactions(instrument, transactionType, orderType, isBuy, this.state.lot, undefined, undefined, limitPrices, stopPrices, this.state.expireType, this.state.expireTime);\r\n\r\n if (model.closeLot) {\r\n if (this.props.onSubmit) {\r\n this.props.onSubmit(this.state.limitPrice, this.state.stopPrice);\r\n }\r\n } else {\r\n model.placingData.transactionsBeforSubmit = trans;\r\n this.setState({ transactions: trans, confirmDialogVisible: true });\r\n }\r\n\r\n if (!model.closeLot) {\r\n if (this.state.saveLot) {\r\n utils.saveCookie(model.customer.Id + instrument.Id + SaveLotCookey, this.state.lot);\r\n } else {\r\n utils.removeCookie(model.customer.Id + instrument.Id + SaveLotCookey);\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n\r\n onConfirmCancel(e, isConfirmed) {\r\n let { model, onConfirmClosed } = this.props;\r\n model.closeLot = 0;\r\n\r\n this.setState({ confirmDialogVisible: false });\r\n\r\n if (onConfirmClosed) {\r\n onConfirmClosed(isConfirmed);\r\n }\r\n }\r\n\r\n onConfirmOk(e) {\r\n let { isPad, model, commService, onConfirmClosed } = this.props;\r\n console.log('PlacingPendingView', 'onConfirmOk');\r\n debugger;\r\n this.state.transactions.forEach((tran, index) => {\r\n commService.place(tran);\r\n // if (isPad && onConfirmClosed) {\r\n // onConfirmClosed(true);\r\n // }\r\n model.closeLot = 0;\r\n });\r\n }\r\n\r\n onExpireSelectViewChange(e) {\r\n let { model } = this.props;\r\n model.placingData.expireType = e.expireType;\r\n model.placingData.expireTime = e.date;\r\n this.setState({ expireType: e.expireType, expireTime: e.date });\r\n }\r\n\r\n setPaymentOptions(selectedPaymentForm) {\r\n console.log(\"PlacingPendingView.setPaymentOptions\");\r\n let { model } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n let tradePolicy = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let result = [];\r\n let paymentForms = [];\r\n let allowedPaymentForm = parseInt(tradePolicy.PaymentForm);\r\n if (allowedPaymentForm && (allowedPaymentForm & PaymentForm.FullPayment) === PaymentForm.FullPayment) {\r\n paymentForms.push(PaymentForm.FullPayment);\r\n result.push();\r\n }\r\n if (allowedPaymentForm && (allowedPaymentForm & PaymentForm.AdvancePayment) === PaymentForm.AdvancePayment) {\r\n paymentForms.push(PaymentForm.AdvancePayment);\r\n result.push();\r\n }\r\n if (allowedPaymentForm && (allowedPaymentForm & PaymentForm.Instalment) === PaymentForm.Instalment) {\r\n paymentForms.push(PaymentForm.Instalment);\r\n result.push();\r\n }\r\n\r\n if (selectedPaymentForm == undefined) {\r\n selectedPaymentForm = paymentForms.length > 0 ? paymentForms[0] : undefined;\r\n }\r\n\r\n this.setState({ paymentSelectOptions: result, paymentForms: paymentForms, selectedPaymentForm: selectedPaymentForm, instalmentDetailButtonVisible: selectedPaymentForm !== PaymentForm.FullPayment });\r\n\r\n let isPhysical = (parseInt(instrument.Category) === InstrumentCategory.Physical);\r\n let instalmentPolicyDetail = undefined;\r\n if (isPhysical) {\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let instalmentPolicy = model.instalmentPolicies[tradePolicyDetail.InstalmentPolicyId];\r\n\r\n if (instalmentPolicy != undefined && instalmentPolicy.details != undefined) {\r\n let instalmentPolicyDetails = Object.values(instalmentPolicy.details).sort((a, b) => a.Frequence.localeCompare(b.Frequence));\r\n for (const detail of instalmentPolicyDetails) {\r\n if (selectedPaymentForm == PaymentForm.AdvancePayment && parseInt(detail.Period) == 1) {\r\n instalmentPolicyDetail = detail;\r\n break;\r\n\r\n } else if (selectedPaymentForm == PaymentForm.Instalment && parseInt(detail.Period) > 1) {\r\n instalmentPolicyDetail = detail;\r\n break;\r\n }\r\n };\r\n }\r\n model.buildPlacingPhysicalOptions(instalmentPolicyDetail);\r\n }\r\n }\r\n\r\n onPaymentOptionChange(value, option) {\r\n this.setPaymentOptions(value);\r\n }\r\n\r\n onOrderTypeChange(orderType) {\r\n let { model } = this.props;\r\n // model.placingData.lot = this.state.lot;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let lotSettings = getLotSettings(model.selectedAccount, instrument, false, model.closeLot == 0);\r\n let savedLot = parseFloat(utils.loadCookie(model.customer.Id + instrument.Id + SaveLotCookey));\r\n if (savedLot > lotSettings.max || savedLot < lotSettings.min) {\r\n savedLot = undefined;\r\n }\r\n model.placingData.lot = parseFloat(parseFloat(this.getStateValue('lot', savedLot ? savedLot : lotSettings.default)).toFixed(6));\r\n\r\n if ((orderType == OrderType.SpotTrade || orderType == OrderType.Market)) {\r\n model.placingData.orderingNotifyId = utils.uuid();\r\n model.orderingNotify(model.placingData.orderingNotifyId, model.customer.Code, model.placingData.selectedInstrument.Code, model.placingData.isBuy.toString(), true, '1', (d) => { });\r\n }\r\n this.props.onOrderTypeChange(orderType);\r\n }\r\n\r\n render() {\r\n let moduleCss = this.getModuleCss('placeview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n //let isBuy = this.props.isBuy;\r\n let { isBuy, model, isPad } = this.props;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n\r\n let dealingPolicy = instrument.dealingPolicyDetail;\r\n let orderTypes = instrument.getAvailableOrderTypes();\r\n let isMarket = orderTypes.indexOf(OrderType.Market) >= 0;\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n let basePrice = (isBuy === isNormal ? instrument.quotation.Ask : instrument.quotation.Bid);\r\n\r\n let limitPriceSetting = getPendingPriceSetting(model, instrument, basePrice, 0, LimitOrStop.Limit, isBuy ? BuySell.Buy : BuySell.Sell, false);\r\n let limitPriceDoneLimitSetting = getPendingPriceSetting(model, instrument, this.state.limitPrice, 0, LimitOrStop.Limit, !isBuy ? BuySell.Buy : BuySell.Sell, true);\r\n let limitPriceDoneStopSetting = getPendingPriceSetting(model, instrument, this.state.limitPrice, 0, LimitOrStop.Stop, !isBuy ? BuySell.Buy : BuySell.Sell, true);\r\n\r\n let stopPriceSetting = getPendingPriceSetting(model, instrument, basePrice, 0, LimitOrStop.Stop, isBuy ? BuySell.Buy : BuySell.Sell, false);\r\n let stopPriceDoneLimitSetting = getPendingPriceSetting(model, instrument, this.state.stopPrice, 0, LimitOrStop.Limit, !isBuy ? BuySell.Buy : BuySell.Sell, true);\r\n let stopPriceDoneStopSetting = getPendingPriceSetting(model, instrument, this.state.stopPrice, 0, LimitOrStop.Stop, !isBuy ? BuySell.Buy : BuySell.Sell, true);\r\n\r\n\r\n let lotSettings = getLotSettings(model.selectedAccount, instrument, false, model.closeLot == 0);\r\n\r\n let expireTypes = model.getExpireTypes(instrument);\r\n let canPlaceIfDoneOrder = model.canPlaceIfDoneOrder(instrument, false);\r\n\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let isPhysical = (parseInt(instrument.Category) === InstrumentCategory.Physical);\r\n\r\n let bottomButtonRow = undefined;\r\n let isOpen = (model.closeLot ? false : true);\r\n let canPlaceLimit = isAcceptedNewLimitPosition(model.selectedAccount, instrument, isOpen, isBuy, this.getStateValue('lot'));\r\n if (canPlaceLimit && !utils.isEmpty(this.getStateValue('stopPrice'))) {\r\n canPlaceLimit = Boolean.parseBoolean(tradePolicyDetail.AllowNewLimitStopSameTime);\r\n }\r\n\r\n let canPlaceStop = isAcceptedNewStopPosition(model.selectedAccount, instrument, isOpen, isBuy, this.getStateValue('lot'));\r\n if (canPlaceStop && !utils.isEmpty(this.getStateValue('limitPrice'))) {\r\n canPlaceStop = Boolean.parseBoolean(tradePolicyDetail.AllowNewLimitStopSameTime);\r\n }\r\n\r\n let canPlaceOrder = (!utils.isEmpty(this.state.limitPrice) || !utils.isEmpty(this.state.stopPrice)) && model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Limit);\r\n let canPlaceDqOrder = model.canPlaceOrder(model.selectedAccount, instrument, OrderType.SpotTrade) || model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Market);\r\n // let submitButtonClass = `${!canPlaceOrder ? defaultCss.disabledColor : (isBuy ? moduleCss.buyColor : moduleCss.sellColor)} ${moduleCss.row}`;\r\n let submitButtonClass = defaultCss.defaultButtonColor; // isBuy ? moduleCss.buyColor : moduleCss.sellColor;\r\n if (!canPlaceOrder) {\r\n submitButtonClass = defaultCss.disabledColor;\r\n }\r\n if (this.props.isPad) {\r\n // if (model.placingData.closeBuyLot && model.placingData.closeSellLot) { // close buy and sell order\r\n // submitButtonText = \"MainView.Submit\";\r\n // }\r\n // else if (model.placingData.closeBuyLot || model.placingData.closeSellLot) { // close buy or sell order\r\n // submitButtonText = (model.placingData.closeSellLot ? \"MainView.Buy\" : \"MainView.Sell\");\r\n // }\r\n let submitButtonStyle = { textAlign: \"center\", fontSize: '1.4em', margin: '0 0.4em', borderRadius: '4px', border: 'darkgray solid 1px', width: 'calc(100% - 0.8em)' };\r\n\r\n bottomButtonRow =
\r\n
\r\n
{ if (canPlaceOrder) this.onSubmitClick.bind(this)(isBuy) }} > {isBuy ? \"MainView.Buy\" : \"MainView.Sell\"}DialogWindow.Submit
;\r\n }\r\n\r\n let closePaneButtonStyle = { display: \"inline-block\", width: \"2em\", marginRight: '0.5em', textAlign: \"center\", float: 'right', borderWidth: isPad ? '1px' : '0', borderStyle: 'solid', color: 'inherit' };\r\n let closePaneButtonClass = defaultCss.defaultBorderColor; // isPad ? (isBuy ? moduleCss.buyColor : moduleCss.sellColor) : \"\";\r\n let closePaneButton =
;\r\n //let closePaneButton =
;\r\n\r\n let titleBar = isPad ?\r\n
MainView.OrderType\r\n { this.onOrderTypeChange(e.target.value); }}>\r\n {!canPlaceDqOrder ? '' : {isMarket ? \"DialogWindow.MarketOrder\" : \"DialogWindow.SpotOrder\"}}\r\n DialogWindow.PendingOrder\r\n \r\n {/* closePaneButton */}\r\n
\r\n :
DialogWindow.PendingOrder
;\r\n\r\n let savedLot = parseFloat(utils.loadCookie(model.customer.Id + instrument.Id + SaveLotCookey));\r\n if (savedLot > lotSettings.max || savedLot < lotSettings.min) {\r\n savedLot = undefined;\r\n }\r\n let lot = parseFloat(parseFloat(this.getStateValue('lot', savedLot ? savedLot : lotSettings.default)).toFixed(6));\r\n // let lot = this.getStateValue('lot', lotSettings.default);\r\n let lotComponent = this.setStateProp('lot', value)}> ;\r\n\r\n if (this.state.subViewType === SubViewType.Instalment)\r\n return \r\n else if (this.state.subViewType === SubViewType.InstalmentDetail)\r\n return \r\n else\r\n return
\r\n
\r\n {titleBar}{isPad ? '' : closePaneButton}\r\n
\r\n
\r\n
\r\n {isPad ? null : [
DialogWindow.CloseLot
,\r\n ]}\r\n\r\n
{model.closeLot ? \"DialogWindow.CloseLot\" : \"DialogWindow.OpenLot\"}
\r\n
\r\n { /* this.onInputChange('lot', value)}> */}\r\n {lotComponent}\r\n
\r\n
{model.closeLot ? '' : this.setStateProp('saveLot', e.target.checked)}> DialogWindow.Save }
\r\n\r\n
\r\n\r\n\r\n
\r\n
\r\n
DialogWindow.PlacingOrder_LimitPrice
\r\n
\r\n this.onInputChange('limitPrice', value)} value={this.state.limitPrice} placeHolder={DialogWindow.Price}> \r\n
\r\n
\r\n {model.closeLot || utils.isEmpty(this.state.limitPrice) || !canPlaceIfDoneOrder ? [] :\r\n [
\r\n
DialogWindow.CloseLimit
\r\n
\r\n this.onInputChange('limitPriceDoneLimit', value)} value={this.state.limitPriceDoneLimit} placeHolder={DialogWindow.Price}> \r\n
\r\n
,\r\n\r\n\r\n
\r\n
DialogWindow.CloseStop
\r\n
\r\n this.onInputChange('limitPriceDoneStop', value)} value={this.state.limitPriceDoneStop} placeHolder={DialogWindow.Price}> \r\n
\r\n
\r\n ]}\r\n\r\n
\r\n
DialogWindow.TimeExpired
\r\n\r\n \r\n\r\n\r\n
\r\n\r\n\r\n
\r\n\r\n
\r\n
\r\n
DialogWindow.PlacingOrder_StopPrice
\r\n
\r\n this.onInputChange('stopPrice', value)} value={this.state.stopPrice} placeHolder={DialogWindow.Price}> \r\n
\r\n
\r\n {model.closeLot || utils.isEmpty(this.state.stopPrice) || !canPlaceIfDoneOrder ? [] :\r\n [
\r\n
DialogWindow.CloseLimit
\r\n
\r\n this.onInputChange('stopPriceDoneLimit', value)} value={this.state.stopPriceDoneLimit} placeHolder={DialogWindow.Price} > \r\n
\r\n
,\r\n\r\n
\r\n
DialogWindow.CloseStop
\r\n
\r\n this.onInputChange('stopPriceDoneStop', value)} value={this.state.stopPriceDoneStop} placeHolder={DialogWindow.Price} > \r\n
\r\n
]}\r\n {!this.isOcoEnabled() ? '' :\r\n
\r\n
\r\n
\r\n this.setStateProp('isOcoChecked', e.target.checked)}> DialogWindow.OCO\r\n
\r\n
\r\n }\r\n\r\n
\r\n\r\n {isPhysical && isBuy && !(this.state.paymentForms && this.state.paymentForms.length == 1 && this.state.paymentForms[0] == PaymentForm.FullPayment)\r\n && (!utils.isEmpty(this.state.limitPrice) || !utils.isEmpty(this.state.stopPrice)) ?\r\n (
\r\n
DialogWindow.Physical_PaymentType
\r\n
\r\n \r\n
\r\n {this.state.instalmentDetailButtonVisible ?
: ''}\r\n
\r\n ) : ''}\r\n\r\n
\r\n\r\n {/*
this.onSubmitClick.bind(this)(isBuy)} > DialogWindow.ClickTo{isBuy ? \"MainView.Buy\" : \"MainView.Sell\"}
*/}\r\n\r\n {this.props.isPad ? bottomButtonRow\r\n :
\r\n
 
\r\n
\r\n\r\n {!canPlaceDqOrder ? '' :
this.onOrderTypeChange(OrderType.SpotTrade)}> DialogWindow.SpotOrder
}\r\n
{ if (canPlaceOrder) this.onSubmitClick.bind(this)(isBuy) }} > DialogWindow.ClickTo{isBuy ? \"MainView.Buy\" : \"MainView.Sell\"}
\r\n
\r\n
}\r\n\r\n \r\n
\r\n\r\n }\r\n\r\n}\r\n\r\nexport default withRouter(PlacingPendingView);\r\n","import React from 'react';\r\n// import ReactDOM from 'react-dom';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Trans } from 'react-i18next';\r\nimport { CloseOutlined, } from '@ant-design/icons';\r\n\r\nimport * as utils from '../../common/utils.js';\r\nimport { Phase, OrderDetailViewType } from '../../common/const.js';\r\nimport { getWorkingListPhaseClassName, getOrderTypeLanguageKey } from '../../model/orderHelper.js';\r\nimport BaseView from \"../baseview.js\";\r\n\r\nclass WorkingListItem extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n console.log('WorkingListItem.ctor');\r\n }\r\n\r\n componentDidMount() { }\r\n\r\n onItemClick(order) {\r\n let { model, isPad, isTitle } = this.props;\r\n if (!isTitle) {\r\n model.placingData.selectedOrders = [order];\r\n model.placingData.orderDetailViewType = isPad ? OrderDetailViewType.Modify : OrderDetailViewType.WorkingList;\r\n\r\n this.goto('/pendingorderdetail');\r\n }\r\n }\r\n\r\n render() {\r\n let { model, isPad, order, isTitle, hasPips, showCommission } = this.props;\r\n\r\n let moduleCss = this.getModuleCss('WorkingListView', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n let enableRebate = utils.parseBoolean(model.config.getValue('enableRebate', \"false\"));\r\n if (isTitle) {\r\n\r\n if (isPad) {\r\n\r\n let titleStyle = (model && model.config) ? { backgroundColor: model.config.getValue('titleBackgroundColor'), color: model.config.getValue('titleColor') } : {};\r\n return
\r\n
MainView.Phase
\r\n
DialogWindow.SubmitTime
\r\n
DialogWindow.EndTime
\r\n
DialogWindow.AccountCode
\r\n
DialogWindow.InstrumentCode
\r\n
DialogWindow.Lot
\r\n {!hasPips ? '' :
DialogWindow.MovePips
}\r\n
DialogWindow.OpenCloseOrder
\r\n\r\n
MainView.BuySell
\r\n
DialogWindow.Price
\r\n
DialogWindow.ExecutePrice
\r\n\r\n
DialogWindow.OrderType
\r\n
MainView.TradePL
\r\n {!showCommission ? '' :
DialogWindow.Commission
}\r\n {!enableRebate ? '' :
DialogWindow.Rebate
}\r\n
DialogWindow.Levy
\r\n
DialogWindow.Remarks
\r\n\r\n
;\r\n } else {\r\n return
\r\n\r\n
DialogWindow.BuyOrSell
\r\n
DialogWindow.SubmitTime
\r\n
DialogWindow.Quantity
\r\n
DialogWindow.Price
\r\n
DialogWindow.OpenCloseOrder
\r\n
MainView.Phase
\r\n
\r\n\r\n\r\n }\r\n } else {\r\n let phaseClassName = getWorkingListPhaseClassName(order.Phase);\r\n let isBuy = Boolean.parseBoolean(order.IsBuy);\r\n let account = model.accounts[order.Transaction.AccountID];\r\n let instrument = model.instruments[order.Transaction.InstrumentID];\r\n let currency = undefined;\r\n if (Boolean.parseBoolean(model.selectedAccount.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n // this.Decimals = currency.Decimals;\r\n }\r\n else {\r\n currency = model.currencies[model.selectedAccount.CurrencyId];\r\n }\r\n\r\n if (isPad) {\r\n \r\n let commission = utils.formatNumber((order.Commission > 0 ? order.Commission : 0), currency.Decimals);\r\n let levy = utils.formatNumber((order.Levy > 0 ? order.Levy : 0), currency.Decimals);\r\n let rebate = utils.formatNumber(Math.abs((order.Commission < 0 ? order.Commission : 0) + (order.Levy < 0 ? order.Levy : 0)), currency.Decimals);\r\n return
this.onItemClick(order)}>\r\n
{utils.getPhaseLanguageKey(order.Phase)}
\r\n
{order.Transaction.SubmitTime}
\r\n
{order.Transaction.EndTime}
\r\n
{account.Name}
\r\n
{instrument.Description}
\r\n
{parseFloat(order.Lot)}
\r\n {!hasPips ? '' :
{order.DQMaxMove}
}\r\n
{Boolean.parseBoolean(order.IsOpen) ? \"DialogWindow.OpenPosition\" : \"DialogWindow.ClosePosition\"}
\r\n\r\n
{isBuy ? \"MainView.Buy\" : \"MainView.Sell\"}
\r\n
{order.SetPrice}
\r\n
{order.ExecutePrice}
\r\n\r\n
{getOrderTypeLanguageKey(order)}
\r\n
{!order.TradePL ? '' : utils.formatNumber(order.TradePL, currency.Decimals)}
\r\n {!showCommission ? '' :
{isNaN(commission) ? 0 : commission}
} \r\n {!enableRebate ? '' :
{rebate}
}\r\n
{isNaN(levy) ? 0 : levy}
\r\n
{order.Remark}
\r\n\r\n
\r\n\r\n } else {\r\n let isBuy = Boolean.parseBoolean(order.IsBuy);\r\n // let phaseClassName = getWorkingListPhaseClassName(order.Phase);\r\n\r\n return
this.onItemClick(order)}>\r\n
{isBuy ? \"MainView.Buy\" : \"MainView.Sell\"}
\r\n
{order.Transaction.SubmitTime.substring(11)}
\r\n
{parseFloat(order.Lot)}
\r\n
{utils.isEmpty(order.ExecutePrice) ? order.SetPrice : order.ExecutePrice}
\r\n
{Boolean.parseBoolean(order.IsOpen) ? \"DialogWindow.OpenPosition\" : \"DialogWindow.ClosePosition\"}
\r\n
{utils.getPhaseLanguageKey(order.Phase)}
\r\n
\r\n }\r\n }\r\n }\r\n}\r\nlet WorkingListItemComponent = withRouter(WorkingListItem);\r\n\r\nclass WorkingListView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n console.log('WorkingListView.ctor');\r\n }\r\n\r\n componentDidMount() { }\r\n\r\n onClearAllClick() {\r\n let { model } = this.props;\r\n if (model.placingData.selectedInstrument && model.placingData.selectedInstrument.workingList) {\r\n let orders = Object.values(model.placingData.selectedInstrument.workingList);\r\n orders.forEach((o) => {\r\n if (o.Phase != Phase.Placing && o.Phase != Phase.Placed) {\r\n delete model.placingData.selectedInstrument.workingList[o.ID];\r\n }\r\n });\r\n\r\n this.forceUpdate();\r\n }\r\n }\r\n\r\n onMainPaneClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n\r\n onCloseButtonClick(e) {\r\n if (this.props.onCloseButtonClick) {\r\n this.props.onCloseButtonClick(e);\r\n }\r\n }\r\n\r\n\r\n render() {\r\n\r\n let { model, isPad } = this.props;\r\n let moduleCss = this.getModuleCss('WorkingListView', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n // let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let orderItems = [];\r\n //instruments.forEach((instrument, index) => {\r\n let orders = [];\r\n let hasPips = false;\r\n let showRebate = false;\r\n let showCommission = true; // false;\r\n Object.values(model.instruments).forEach((instrument, index) => {\r\n if (instrument.workingList && (isPad || instrument.Id === model.placingData.selectedInstrument.Id)) {\r\n // let lotSettings = getLotSettings(model.selectedAccount, instrument, true, true);\r\n Object.values(instrument.workingList).forEach((order, index) => {\r\n if (parseFloat(order.DQMaxMove) > 0) hasPips = true;\r\n // if (parseFloat(order.Commission) > 0) showCommission = true;\r\n if (parseFloat(order.Commission) < 0) showRebate = true;\r\n orders.push(order);\r\n });\r\n }\r\n });\r\n\r\n let enableRebate = utils.parseBoolean(model.config.getValue('enableRebate', 'false'));\r\n orders.sort((a, b) => b.Transaction.SubmitTime.localeCompare(a.Transaction.SubmitTime));\r\n orders.forEach((order) => {\r\n orderItems.push();\r\n });\r\n\r\n\r\n return
\r\n {isPad ? null :
\r\n
DialogWindow.ClearAll
\r\n DialogWindow.OnlineTrading\r\n
\r\n
}\r\n\r\n
\r\n \r\n
\r\n
\r\n\r\n {/*
*/}\r\n {orderItems}\r\n {/*
*/}\r\n
\r\n\r\n
;\r\n\r\n\r\n }\r\n\r\n}\r\n\r\nexport default withRouter(WorkingListView);\r\n","import React from 'react';\r\n// import ReactDOM from 'react-dom';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Trans } from 'react-i18next';\r\nimport { CloseOutlined, } from '@ant-design/icons';\r\n\r\nimport * as utils from '../../common/utils.js';\r\nimport { OrderType, Phase, TradeOption, TransactionType, OrderDetailViewType } from '../../common/const';\r\n\r\nimport BaseView from \"../baseview.js\";\r\n\r\nimport { getLotSettings, getMovePipsSettings } from '../../model/placinglotsetting';\r\n\r\nclass PendingListView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n\r\n let { model } = props;\r\n if (model && model.placingData && model.selectedAccount) {\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let lotSettings = getLotSettings(model.selectedAccount, instrument, true, true);\r\n this.state = { lotSettings: lotSettings, lot: lotSettings.default }\r\n }\r\n }\r\n\r\n componentDidMount() { }\r\n\r\n onClearAllClick() {\r\n let { model } = this.props;\r\n if (model.placingData.selectedInstrument) {\r\n model.placingData.selectedInstrument.workingList = {};\r\n }\r\n }\r\n\r\n onMainPaneClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n\r\n onCloseButtonClick(e) {\r\n if (this.props.onCloseButtonClick) {\r\n this.props.onCloseButtonClick(e);\r\n\r\n }\r\n }\r\n\r\n\r\n getOrderTypeLanguageKey(transactionType, orderType, tradeOption) {\r\n switch (orderType) {\r\n case OrderType.OneCancelOther: return tradeOption === TradeOption.Stop ? \"MainView.StopOfOCO\" : \"MainView.LimitOfOCO\";\r\n case OrderType.Limit:\r\n\r\n if (transactionType === TransactionType.OneCancelOther) {\r\n return tradeOption === TradeOption.Stop ? \"MainView.StopOfOCO\" : \"MainView.LimitOfOCO\";\r\n } else {\r\n return tradeOption === TradeOption.Stop ? \"MainView.OrderType_Stop\" : \"MainView.OrderType_Limit\";\r\n }\r\n default: return \"\";\r\n }\r\n }\r\n\r\n onItemClick(order) {\r\n this.props.model.placingData.selectedOrders = [order];\r\n this.props.model.placingData.orderDetailViewType = OrderDetailViewType.Modify;\r\n this.goto('/pendingorderdetail');\r\n }\r\n\r\n render() {\r\n let moduleCss = this.getModuleCss('WorkingListView', 'common');\r\n\r\n let { model } = this.props;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let orderItems = [];\r\n\r\n if (instrument.workingList) {\r\n let orders = Object.values(instrument.workingList).reverse(); // .sort((a, b) => b.Transaction.SubmitTime.localeCompare(a.Transaction.SubmitTime));\r\n orders.forEach((order, index) => {\r\n let tradeOption = parseInt(order.TradeOption);\r\n let isBuy = Boolean.parseBoolean(order.IsBuy);\r\n if (tradeOption !== TradeOption.Invalid && (order.Phase == Phase.Placing || order.Phase == Phase.Placed)) {\r\n orderItems.push(
this.onItemClick(order)}>\r\n
{isBuy ? \"MainView.Buy\" : \"MainView.Sell\"}
 \r\n
{Boolean.parseBoolean(order.IsOpen) ? \"DialogWindow.OpenOrder\" : \"DialogWindow.CloseOrder\"}
 \r\n
{parseFloat(order.Lot)}
DialogWindow.PlacingConfirmation_Lot  \r\n
{this.getOrderTypeLanguageKey(parseInt(order.Transaction.Type), parseInt(order.Transaction.OrderType), tradeOption)}
 \r\n
DialogWindow.At
 \r\n
{order.SetPrice}
 \r\n
{utils.getPhaseLanguageKey(order.Phase)}
\r\n
);\r\n }\r\n });\r\n }\r\n\r\n return
\r\n
\r\n DialogWindow.UnPendingOrder\r\n
\r\n
\r\n\r\n
\r\n {orderItems}\r\n {this.props.children}\r\n
\r\n\r\n
\r\n\r\n\r\n }\r\n\r\n}\r\n\r\nexport default withRouter(PendingListView);\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\n// import { CaretDownFilled } from '@ant-design/icons';\r\nimport { Checkbox } from 'antd';\r\nimport { CaretRightOutlined, CaretDownOutlined, ShoppingCartOutlined, PoweroffOutlined, RollbackOutlined, FileTextOutlined } from '@ant-design/icons';\r\n\r\nimport * as utils from '../../common/utils';\r\nimport { getLotSettings } from '../../model/placinglotsetting';\r\nimport { InventoryInProcessStatus, OrderType, InstrumentStatus, PhysicalTradeSide, AllowCloseInstalment, AdvancePaymentOption } from '../../common/const';\r\nimport * as physicalHelper from '../../model/physicalHelper.js';\r\nimport BaseView from \"../baseview.js\";\r\nimport InputNumberComponent from '../inputnumbercomponent';\r\n\r\nclass InventoryItemView extends BaseView {\r\n\r\n componentDidMount() {\r\n }\r\n\r\n onInventoryClick(e) {\r\n if (e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n if (!this.props.disableClick) {\r\n this.props.model.placingData.selectedInstrument = this.props.instrument;\r\n this.props.model.placingData.selectedInventory = this.props.inventory;\r\n this.goto('/inventorydetail');\r\n }\r\n }\r\n\r\n onDeliveryButtonClick(e) {\r\n if (e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n\r\n let { model, inventory, instrument, isPad, isTitle } = this.props;\r\n physicalHelper.gotoDelivery(model, model.selectedAccount, instrument, inventory, () => this.goto('/delivery'));\r\n }\r\n\r\n onRepaymentButtonClick(e) {\r\n if (e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n let { inventory, instrument, model, isTitle } = this.props;\r\n model.placingData.selectedInstrument = instrument;\r\n model.placingData.selectedInventory = this.props.inventory;\r\n let unPaid = !inventory ? '' : parseFloat(inventory.PhysicalOriginValueBalance) - Math.abs(parseFloat(inventory.PaidPledgeBalance));\r\n if (unPaid != 0) {\r\n model.placingData.selectedInventory = inventory;\r\n this.goto('/repayment');\r\n }\r\n }\r\n\r\n onInstalmentButtonClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n\r\n let { inventory, instrument, model, isTitle } = this.props;\r\n if (inventory.Period > 1) {\r\n model.placingData.selectedOrders = [inventory];\r\n model.placingData.selectedInventory = inventory;\r\n this.goto('/instalmentsum');\r\n }\r\n }\r\n\r\n onCloseOrderButtonClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n\r\n let { inventory, instrument, model, isTitle } = this.props;\r\n if (!isTitle) {\r\n // let instrument = model.instruments[order.Transaction.InstrumentID];\r\n let isMarketClose = (instrument.status != InstrumentStatus.DayOpen && instrument.status != InstrumentStatus.SessionOpen);\r\n\r\n if (!isMarketClose) {\r\n model.buildPlacingData(this.props.instrument, [inventory], OrderType.SpotTrade);\r\n this.goto('/closeorder');\r\n }\r\n }\r\n }\r\n\r\n setDeliveryLot(inventory, deliveryLot) {\r\n console.log('setDeliveryLot');\r\n inventory.deliveryLot = parseFloat(deliveryLot);\r\n\r\n if (deliveryLot) {\r\n let { model, inventory, instrument } = this.props;\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : {});\r\n inventory.deliveryQuantity = parseFloat((inventory.deliveryLot * parseFloat(inventory.Transaction.ContractSize) * parseFloat(instrumentUnit.Weight)).toFixed(6));\r\n } else {\r\n inventory.deliveryQuantity = 0;\r\n }\r\n\r\n if (this.props.onDeliveryLotChange) {\r\n this.props.onDeliveryLotChange(inventory);\r\n }\r\n\r\n this.forceUpdate();\r\n return true;\r\n }\r\n\r\n onCheckboxChange(inventory, checked, e) {\r\n //inventory.deliveryLot = (checked ? parseFloat(inventory.LotBalance) : 0);\r\n\r\n this.setDeliveryLot(inventory, (checked ? parseFloat((parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess).toFixed(6)) : 0));\r\n inventory.checked = checked;\r\n this.props.model.placingData.selectedInventory = inventory;\r\n\r\n if (this.props.onCheckboxChange) {\r\n this.props.onCheckboxChange(inventory, checked)\r\n }\r\n }\r\n\r\n getInprocessStatusText(status) {\r\n switch (status) {\r\n case InventoryInProcessStatus.StockIsAvailable:\r\n return DialogWindow.Physical_StockIsAvailable;\r\n case InventoryInProcessStatus.Submitted:\r\n return DialogWindow.Physical_Submitted;\r\n case InventoryInProcessStatus.Approved:\r\n return DialogWindow.Physical_Approved;\r\n default:\r\n return status;\r\n }\r\n }\r\n\r\n render() {\r\n let { model, inventory, instrument, isPad, isTitle, columnProps, showInOpenPosition } = this.props;\r\n let moduleCss = this.getModuleCss('inventoryview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n // let instrument = model.instruments[inventory.Transaction.InstrumentID];\r\n let account = !inventory ? '' : model.accounts[inventory.Transaction.AccountID];\r\n let tradePolicyDetail = !inventory ? undefined : account.TradePolicyDetails[instrument.Id];\r\n let instalmentPolicy = !inventory ? undefined : model.instalmentPolicies[tradePolicyDetail.InstalmentPolicyId];\r\n let canRepayment = false;\r\n let canClose = !inventory ? false : ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.Sell) == PhysicalTradeSide.Sell);\r\n let advancePayment = !instalmentPolicy ? '' : parseInt(instalmentPolicy.AdvancePayment);\r\n let canDelivery = !inventory ? false : ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.Delivery) == PhysicalTradeSide.Delivery);\r\n\r\n let currency = undefined;\r\n if (inventory) {\r\n if (Boolean.parseBoolean(account.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n }\r\n else {\r\n currency = model.currencies[account.CurrencyId];\r\n }\r\n }\r\n\r\n let unPaid = !inventory ? '' : inventory.UnpaidAmount; // !inventory ? '' : utils.formatNumber(parseFloat(inventory.PhysicalOriginValueBalance) - Math.abs(parseFloat(inventory.PaidPledgeBalance)), currency.Decimals);\r\n if (unPaid > 0) {\r\n canDelivery = false;\r\n\r\n let allowClose = parseInt(instalmentPolicy.AllowClose);\r\n if (parseInt(inventory.Period) == 1) {\r\n canClose = (allowClose != AllowCloseInstalment.DisAllow);\r\n canRepayment = (advancePayment == AdvancePaymentOption.AllowPrepayment || advancePayment == AdvancePaymentOption.AllowAll);\r\n } else {\r\n canClose = (allowClose == AllowCloseInstalment.AllowWhenNoOutstandingInstalment || allowClose == AllowCloseInstalment.AllowAll);\r\n canRepayment = (advancePayment == AdvancePaymentOption.AllowInstalment || advancePayment == AdvancePaymentOption.AllowAll);\r\n }\r\n }\r\n\r\n let titleStyle = (model && model.config) ? { backgroundColor: model.config.getValue('titleBackgroundColor'), color: model.config.getValue('titleColor') } : {};\r\n\r\n if (this.props.showInDelivery) {\r\n let lotSettings = !model ? {} : getLotSettings(model.selectedAccount, instrument, true, true);\r\n let avaiableMaxLot = !model ? '' : parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess;\r\n if (inventory) {\r\n lotSettings.default = lotSettings.max = avaiableMaxLot;\r\n if (lotSettings.min > lotSettings.max) {\r\n lotSettings.min = lotSettings.max;\r\n }\r\n }\r\n let rowCss = `${!isTitle ? '' : moduleCss.orderTitleBackground} `;\r\n let checkboxStyle = { display: 'inline-block', width: '4em', whiteSpace: 'nowrap' };\r\n let tradingDetail = !inventory ? '' :
{inventory.Transaction.ExecuteTime.substring(0, 10)} DialogWindow.Buy@ {inventory.ExecutePrice}
;\r\n return
\r\n
{isTitle ? Chart.OpenOrder : { e.stopPropagation(); e.cancelBubble = true; }} onChange={(e) => { this.onCheckboxChange(inventory, e.target.checked) }} checked={inventory.deliveryLot ? true : false} />}
\r\n\r\n
{isTitle ? DialogWindow.Physical_TradingDetails : tradingDetail}
\r\n
\r\n {isTitle ? DialogWindow.Lot : this.setDeliveryLot(inventory, value)}> }\r\n
\r\n\r\n
\r\n\r\n }\r\n\r\n if (isPad) {\r\n if (this.props.isTitle) {\r\n return
\r\n {!columnProps.showDeliveryColumn ? '' :
DialogWindow.Physical_Delivery
}\r\n
MainView.Close
\r\n {!columnProps.showInstalmentColumn ? '' :
DialogWindow.Physical_Instalment
}\r\n {!columnProps.showRepaymentColumn ? '' :
DialogWindow.Physical_Repayment
}\r\n
DialogWindow.InstrumentCode
\r\n
DialogWindow.ExecuteTradeDay
\r\n
DialogWindow.Physical_Weight
\r\n
DialogWindow.ExecutePrice
\r\n
DialogWindow.RefPrice
\r\n
DialogWindow.PhysicalItem_MarketValue
\r\n\r\n
DialogWindow.PhysicalItem_PaidPledge
\r\n
DialogWindow.TradePLFloat
\r\n
DialogWindow.Physical_RemainAmount
\r\n
DialogWindow.PhysicalItem_PedgeValue
\r\n
DialogWindow.Physical_PaymentDiscount
\r\n
\r\n } else {\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : {});\r\n let weight = instrumentUnit ? parseFloat(instrumentUnit.Weight) : 1;\r\n return
\r\n {!columnProps.showDeliveryColumn ? '' :
{ if (canDelivery) this.onDeliveryButtonClick.bind(this)(e) }}>
\r\n }\r\n
{ if (canClose) this.onCloseOrderButtonClick.bind(this)(e) }}>
\r\n {!columnProps.showInstalmentColumn ? '' :
1 ? '' : defaultCss.disabledColor}`} style={{ background: 'inherit' }} onClick={this.onInstalmentButtonClick.bind(this)}>
}\r\n {!columnProps.showRepaymentColumn ? '' :
{ if (canRepayment) this.onRepaymentButtonClick.bind(this)(e) }} >
}\r\n
{inventory.Code}
\r\n
{inventory.Transaction.ExecuteTime}
\r\n
{(parseFloat(inventory.Transaction.ContractSize) * (parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess) * weight).toFixed(currency.Decimals)}
\r\n
{inventory.ExecutePrice}
\r\n
{inventory.LivePrice}
\r\n
{utils.formatNumber(model.exchangeRate(inventory.MarketValue, instrument.CurrencyId, currency.Id), currency.Decimals)}
\r\n\r\n
{unPaid == 0 ? '' : utils.formatNumber(Math.abs(inventory.PaidPledgeBalance), currency.Decimals)}
\r\n
{utils.formatNumber(inventory.TradePLFloat, currency.Decimals)}
\r\n
{utils.formatNumber(unPaid, currency.Decimals)}
\r\n
{utils.formatNumber(inventory.PedgeAmount, currency.Decimals)}
\r\n
{utils.formatNumber(inventory.PhysicalPaymentDiscount, currency.Decimals)}
\r\n\r\n
\r\n }\r\n } else {\r\n if (this.props.isTitle) {\r\n let titleCss = `${showInOpenPosition ? '' : moduleCss.orderTitleBackground} ${moduleCss.orderRow}`;\r\n return
\r\n
\r\n
DialogWindow.ExecuteTime
\r\n
DialogWindow.Physical_Weight
\r\n
DialogWindow.Physical_Unit
\r\n
DialogWindow.ExecutePrice
\r\n
DialogWindow.PhysicalItem_MarketValue
\r\n
\r\n }\r\n else {\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : {});\r\n let weight = instrumentUnit ? parseFloat(instrumentUnit.Weight) : 1;\r\n return
this.onInventoryClick()} >\r\n {showInOpenPosition ?
:\r\n { e.stopPropagation(); e.cancelBubble = true; }} onChange={(e) => { this.onCheckboxChange(inventory, e.target.checked) }} checked={inventory.deliveryLot ? true : false} />\r\n }\r\n
{inventory.Transaction.ExecuteTime.substring(0, 10)}
\r\n
{(parseFloat(inventory.Transaction.ContractSize) * (parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess) * weight).toFixed(currency.Decimals)}
\r\n
{instrument.Unit}
\r\n
{inventory.ExecutePrice}
\r\n
{(parseFloat(inventory.Transaction.ContractSize) * parseFloat(inventory.ExecutePrice) * (parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess)).toFixed(currency.Decimals)}
\r\n
\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\n\r\n\r\nclass InventoryInstrumentTitleView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n this.state = { itemsVisible: true };\r\n }\r\n\r\n componentDidMount() {\r\n console.log('InventoryInstrumentView.componentDidMount');\r\n\r\n\r\n }\r\n\r\n onToggleClapseClick() {\r\n // this.setState({ itemsVisible: !this.state.itemsVisible });\r\n if (this.props.onToggleClapseClick) {\r\n this.props.onToggleClapseClick();\r\n }\r\n }\r\n\r\n hasDeliveryOrder(instrument) {\r\n let result = false;\r\n Object.values(instrument.physicalInventory).forEach((item, index) => {\r\n if (physicalHelper.canDelivery(item)) {\r\n result = true;\r\n }\r\n });\r\n return result;\r\n }\r\n\r\n render() {\r\n let moduleCss = this.getModuleCss('inventoryview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n let { model, isTitle, instrument, columnProps } = this.props;\r\n let account = isTitle ? '' : model.selectedAccount;\r\n\r\n let currency = undefined;\r\n let totalQuantity = 0;\r\n let averagePrice = 0, totalValue = 0, totalMarketValue = 0, buyPrice = '', sellPrice = '';\r\n if (!isTitle) {\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n let quotation = model.placingData.quoteAnswer && model.placingData.quoteAnswer.Ask ? model.placingData.quoteAnswer : instrument.quotation;\r\n buyPrice = (isNormal ? quotation.Ask : quotation.Bid);\r\n sellPrice = (isNormal ? quotation.Bid : quotation.Ask);\r\n\r\n if (Boolean.parseBoolean(account.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n }\r\n else {\r\n currency = model.currencies[account.CurrencyId];\r\n }\r\n\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : {});\r\n let weight = instrumentUnit ? parseFloat(instrumentUnit.Weight) : 1;\r\n\r\n Object.values(instrument.physicalInventory).forEach((inventory) => {\r\n let lotBalance = (parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess);\r\n totalQuantity += (parseFloat(inventory.Transaction.ContractSize) * lotBalance * weight);\r\n if (lotBalance > 0) {\r\n totalValue += model.exchangeRate(parseFloat(inventory.Transaction.ContractSize) * lotBalance * parseFloat(inventory.ExecutePrice), instrument.CurrencyId, currency.Id);\r\n // totalLot += parseFloat(inventory.LotBalance);\r\n totalMarketValue += model.exchangeRate(parseFloat(inventory.Transaction.ContractSize) * lotBalance * parseFloat(sellPrice), instrument.CurrencyId, currency.Id);\r\n }\r\n });\r\n averagePrice = utils.formatPrice(totalValue / totalQuantity, instrument.Denominator);\r\n }\r\n\r\n let titleStyle = (model && model.config) ? { backgroundColor: model.config.getValue('titleBackgroundColor'), color: model.config.getValue('titleColor') } : {};\r\n titleStyle.borderBottomStyle = 'solid';\r\n titleStyle.borderBottomWidth = '1px';\r\n titleStyle.lineHeight = '2em';\r\n\r\n let foldArrow = '';\r\n if (this.props.itemsVisible != undefined) {\r\n foldArrow = this.props.itemsVisible ? : \r\n }\r\n\r\n let canDelivery = columnProps.showDeliveryColumn;\r\n let deliveryCss = moduleCss.padOrderItemDelivery;\r\n if (instrument) {\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n canDelivery = ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.Delivery) == PhysicalTradeSide.Delivery) && this.hasDeliveryOrder(instrument);\r\n\r\n if (!canDelivery) {\r\n deliveryCss = `${moduleCss.padOrderItemDelivery} ${canDelivery ? '' : defaultCss.disabledColor}`;\r\n }\r\n }\r\n\r\n return
\r\n this.onToggleClapseClick()}> {foldArrow} \r\n {!columnProps.showDeliveryColumn ? '' :
{ if (canDelivery) this.props.onDeliveryButtonClick(e) }}> {isTitle ? DialogWindow.Physical_Delivery : }
}\r\n
this.props.onCloseOrderButtonClick(e)}> {isTitle ? MainView.Close : }
\r\n
{isTitle ? DialogWindow.Physical_Commodity : instrument.Description}
\r\n\r\n
{isTitle ? DialogWindow.Account : model.selectedAccount.Name}
\r\n
{isTitle ? DialogWindow.Physical_Weight : totalQuantity.toFixed(currency.Decimals)}
\r\n\r\n
{isTitle ? DialogWindow.Physical_Unit : instrument.Unit}
\r\n
{isTitle ? DialogWindow.Currency : currency.Code}
\r\n\r\n
{isTitle ? MainListView.Physical_AveragePrice : averagePrice}
\r\n
{isTitle ? DialogWindow.RefPrice : sellPrice}
\r\n
{isTitle ? DialogWindow.PhysicalItem_MarketValue : utils.formatNumber(totalMarketValue, currency.Decimals)}
\r\n
\r\n }\r\n}\r\n\r\n\r\nclass InventoryInstrumentView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = { itemsVisible: true };\r\n }\r\n\r\n componentDidMount() {\r\n console.log('InventoryInstrumentView.componentDidMount');\r\n }\r\n\r\n\r\n onDeliveryButtonClick(e) {\r\n if (e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n\r\n let { model, instrument, isPad } = this.props;\r\n if (instrument) {\r\n\r\n physicalHelper.gotoDelivery(model, model.selectedAccount, instrument, undefined, this.deliveryCallback.bind(this));\r\n }\r\n }\r\n\r\n deliveryCallback() {\r\n this.goto('/delivery')\r\n }\r\n\r\n onCloseOrderButtonClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n\r\n let { instrument, model } = this.props;\r\n let isMarketClose = (instrument.status != InstrumentStatus.DayOpen && instrument.status != InstrumentStatus.SessionOpen);\r\n model.placingData.selectedInstrument = instrument;\r\n if (!isMarketClose) {\r\n let openOrders = [];\r\n Object.values(instrument.physicalInventory).forEach((o) => {\r\n o.isSelected = true;\r\n o.checked = true;\r\n o.selectedLot = parseFloat(o.LotBalance);\r\n if (o.LotBalance > 0) openOrders.push(o);\r\n });\r\n\r\n model.buildPlacingData(instrument, openOrders, OrderType.SpotTrade);\r\n\r\n this.goto('/closeorder');\r\n }\r\n\r\n }\r\n\r\n render() {\r\n let moduleCss = this.getModuleCss('inventoryview', 'common');\r\n let { model, isPad, instrument, columnProps } = this.props;\r\n\r\n let fullPaidOrderViews = [];\r\n let partialPaidOrderViews = [];\r\n // let columnProps = { showInstalmentColumn: false, showRepaymentColumn: false, showDeliveryColumn: false }\r\n\r\n let padView = [];\r\n if (instrument && instrument.physicalInventory) {\r\n let inventories = Object.values(instrument.physicalInventory).sort((a, b) => b.Transaction.ExecuteTime.localeCompare(a.Transaction.ExecuteTime));\r\n inventories.forEach((inventory, index) => {\r\n if (parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess > 0) {\r\n padView.push();\r\n /*\r\n if (Math.abs(parseFloat(inventory.PaidPledgeBalance)) == parseFloat(inventory.PhysicalOriginValueBalance)) {\r\n fullPaidOrderViews.push();\r\n } else {\r\n if (inventory.Period > 1) {\r\n // columnProps.showInstalmentColumn = true;\r\n }\r\n if (inventory.UnpaidAmount > 0) {\r\n // columnProps.showRepaymentColumn = true;\r\n }\r\n partialPaidOrderViews.push();\r\n } */\r\n }\r\n });\r\n }\r\n // });\r\n //columnProps.showDeliveryColumn = (fullPaidOrderViews.length > 0);\r\n\r\n /*\r\n if (isPad) {\r\n if (this.props.viewType == 'shortsell') {\r\n\r\n } else {\r\n padView = padView.concat(fullPaidOrderViews);\r\n padView = padView.concat(partialPaidOrderViews);\r\n\r\n }\r\n } */\r\n\r\n let itemsDisplay = this.state.itemsVisible ? 'block' : 'none';\r\n\r\n return isPad && padView.length > 0 ?
\r\n this.setState({ itemsVisible: !this.state.itemsVisible })} onDeliveryButtonClick={this.onDeliveryButtonClick.bind(this)} onCloseOrderButtonClick={this.onCloseOrderButtonClick.bind(this)}>\r\n\r\n
\r\n \r\n {padView}\r\n
\r\n
: ''\r\n\r\n }\r\n\r\n}\r\n\r\n\r\n\r\nconst inventoryItemView = withRouter(InventoryItemView);\r\nconst inventoryInstrumentView = withRouter(InventoryInstrumentView);\r\nconst inventoryInstrumentTitleViewWithRouter = withRouter(InventoryInstrumentTitleView);\r\n\r\nexport { inventoryItemView as InventoryItemView, inventoryInstrumentView as InventoryInstrumentView, inventoryInstrumentTitleViewWithRouter as InventoryInstrumentTitleView };\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Button, Checkbox, Select, Radio } from 'antd';\r\nimport { CloseOutlined } from '@ant-design/icons';\r\n\r\nimport { PhysicalTradeSide, OrderType, InstrumentStatus, AllowCloseInstalment, AdvancePaymentOption, InstrumentCategory } from '../../common/const';\r\nimport * as utils from '../../common/utils';\r\nimport * as physiclHelper from '../../model/physicalHelper.js';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport { InventoryInstrumentView, InventoryItemView, InventoryInstrumentTitleView } from './inventoryitemview';\r\n\r\nclass InventoryView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = { showDeliveryColumn: false, showRepaymentColumn: false, showInstalmentColumn: false };\r\n\r\n }\r\n\r\n componentDidMount() {\r\n // this.setState({ orderGroup : this.props.orderGroup});\r\n let { model, isPad } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let instalmentPolicy = model.instalmentPolicies[tradePolicyDetail.InstalmentPolicyId];\r\n\r\n if (instrument.physicalInventory) {\r\n Object.values(instrument.physicalInventory).forEach((o) => {\r\n o.isSelected = true;\r\n o.checked = false;\r\n o.deliveryLot = 0;\r\n o.deliveryQuantity = 0;\r\n });\r\n }\r\n\r\n this.setState({ instalmentPolicy: instalmentPolicy });\r\n this.refreshButton(true);\r\n }\r\n\r\n refreshGroup() {\r\n }\r\n\r\n onBackgroundPaneClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n\r\n onDeliveryButtonClick(e) {\r\n if (e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n\r\n let { model } = this.props;\r\n physiclHelper.gotoDelivery(model, model.selectedAccount, model.placingData.selectedInstrument, undefined, () => this.goto('/delivery'));\r\n\r\n // let { model, isPad } = this.props;\r\n // let instrument = model.placingData.selectedInstrument;\r\n // let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n\r\n // if ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.Delivery) == PhysicalTradeSide.Delivery) {\r\n // let hasDeliveryOrder = false;\r\n // Object.values(instrument.physicalInventory).forEach((inventory, index) => {\r\n // if (physiclHelper.canDelivery(inventory)) {\r\n // hasDeliveryOrder = true;\r\n // }\r\n // });\r\n // if (hasDeliveryOrder) {\r\n // this.props.commService.getDeliveryAddress(tradePolicyDetail.DeliveryPointGroupId, this.deliveryAddressCallback.bind(this));\r\n // }\r\n // }\r\n // this.goto('/delivery');\r\n }\r\n\r\n deliveryAddressCallback(d) {\r\n console.log('deliveryAddressCallback', d);\r\n let data = JSON.parse(d);\r\n\r\n if (data.Result.content_result.DeliveryAddresses) {\r\n this.props.model.placingData.deliveryAddresses = utils.forceToArray(data.Result.content_result.DeliveryAddresses.DeliveryAddress);\r\n\r\n this.goto('/delivery');\r\n }\r\n }\r\n\r\n\r\n onRepaymentButtonClick(e) {\r\n this.goto('/repayment');\r\n }\r\n\r\n onInstalmentButtonClick(e) {\r\n this.goto('/instalmentsum');\r\n }\r\n\r\n onCloseOrderButtonClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n\r\n let { instrument, model } = this.props;\r\n\r\n let isMarketClose = (instrument.status != InstrumentStatus.DayOpen && instrument.status != InstrumentStatus.SessionOpen);\r\n model.placingData.selectedInstrument = instrument;\r\n if (!isMarketClose) {\r\n let openOrders = [];\r\n Object.values(instrument.physicalInventory).forEach((o) => {\r\n o.isSelected = true;\r\n o.checked = true;\r\n o.selectedLot = parseFloat(o.LotBalance);\r\n if (o.LotBalance > 0) openOrders.push(o);\r\n });\r\n\r\n model.buildPlacingData(instrument, openOrders, OrderType.SpotTrade);\r\n\r\n this.goto('/closeorder');\r\n }\r\n\r\n }\r\n\r\n onItemCheckboxChange(inventory, checked) {\r\n this.refreshButton(true);\r\n // this.forceUpdate();\r\n }\r\n\r\n onPartialItemCheckboxChange(inventoryClicked, checked) {\r\n if (checked) {\r\n let instrument = this.props.model.placingData.selectedInstrument;\r\n if (instrument.physicalInventory) {\r\n Object.values(instrument.physicalInventory).forEach((inventory, index) => {\r\n if (parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess > 0) {\r\n if (Math.abs(parseFloat(inventory.PaidPledgeBalance)) == parseFloat(inventory.PhysicalOriginValueBalance)) {\r\n // fullPaidOrderViews.push();\r\n inventory.deliveryLot = 0;\r\n } else {\r\n\r\n if (inventory.ID !== inventoryClicked.ID) {\r\n inventory.deliveryLot = 0;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n }\r\n //this.forceUpdate();\r\n this.refreshButton(false);\r\n }\r\n\r\n\r\n\r\n refreshButton(isFullPaid) {\r\n let instrument = this.props.model.placingData.selectedInstrument;\r\n let fullPaidCheckedCount = 0;\r\n let partialPaidCheckedCount = 0;\r\n let instalmentCheckedCount = 0;\r\n let canRepayment = false;\r\n let advancePayment = (this.state.instalmentPolicy ? parseInt(this.state.instalmentPolicy.AdvancePayment) : false);\r\n // let isFullPaid = Math.abs(parseFloat(inventoryClicked.PaidPledgeBalance)) == parseFloat(inventoryClicked.PhysicalOriginValueBalance)\r\n if (instrument.physicalInventory) {\r\n let inventories = Object.values(instrument.physicalInventory).sort((a, b) => b.Transaction.ExecuteTime.localeCompare(a.Transaction.ExecuteTime));\r\n inventories.forEach((inventory, index) => {\r\n if (parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess > 0) {\r\n\r\n let itemFullPaid = Math.abs(parseFloat(inventory.PaidPledgeBalance)) === parseFloat(inventory.PhysicalOriginValueBalance);\r\n if (itemFullPaid !== isFullPaid) { // (inventory.ID !== inventoryClicked.ID) {\r\n inventory.deliveryLot = 0;\r\n inventory.checked = false;\r\n }\r\n\r\n if (inventory.deliveryLot) {\r\n if (isFullPaid) {\r\n fullPaidCheckedCount++;\r\n } else {\r\n\r\n partialPaidCheckedCount++;\r\n if (inventory.Period > 1) {\r\n instalmentCheckedCount++;\r\n canRepayment = (advancePayment == AdvancePaymentOption.AllowInstalment || advancePayment == AdvancePaymentOption.AllowAll);\r\n } else {\r\n canRepayment = (advancePayment == AdvancePaymentOption.AllowPrepayment || advancePayment == AdvancePaymentOption.AllowAll);\r\n }\r\n }\r\n }\r\n }\r\n });\r\n }\r\n\r\n\r\n console.log(\"fullPaidCheckedItems\", fullPaidCheckedCount, \"partialPaidCheckedItems\", partialPaidCheckedCount);\r\n this.setState({ showDeliveryColumn: fullPaidCheckedCount != 0, showRepaymentColumn: canRepayment, showInstalmentColumn: instalmentCheckedCount != 0 });\r\n this.forceUpdate();\r\n }\r\n\r\n onSelectAllCheckboxChange(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n\r\n let checked = e.target.checked;\r\n let instrument = this.props.model.placingData.selectedInstrument;\r\n if (instrument.physicalInventory) {\r\n Object.values(instrument.physicalInventory).forEach((inventory, index) => {\r\n if (parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess > 0) {\r\n if (Math.abs(parseFloat(inventory.PaidPledgeBalance)) == parseFloat(inventory.PhysicalOriginValueBalance)) {\r\n inventory.deliveryLot = (checked ? parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess : 0);\r\n inventory.checked = checked;\r\n } else {\r\n inventory.deliveryLot = 0;\r\n inventory.checked = false;\r\n }\r\n }\r\n });\r\n }\r\n this.refreshButton(true);\r\n }\r\n\r\n render() {\r\n let css = this.getModuleCss('inventoryview', 'common');\r\n\r\n let { model, isPad, showInOpenPosition } = this.props;\r\n\r\n if (isPad) {\r\n let padView = [];\r\n let instruments = this.props.model.instruments;\r\n let columnProps = { showDeliveryColumn: this.state.showDeliveryColumn, showRepaymentColumn: this.state.showRepaymentColumn, showInstalmentColumn: this.state.showInstalmentColumn };\r\n\r\n for (let instrumentId in instruments) {\r\n let instrument = instruments[instrumentId];\r\n if (instrument.physicalInventory) {\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let canDelivery = ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.Delivery) == PhysicalTradeSide.Delivery);\r\n let inventories = Object.values(instrument.physicalInventory).sort((a, b) => b.Transaction.ExecuteTime.localeCompare(a.Transaction.ExecuteTime));\r\n padView.push( )\r\n\r\n inventories.forEach((inventory, index) => {\r\n if (parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess > 0) {\r\n if (canDelivery && Math.abs(parseFloat(inventory.PaidPledgeBalance)) == parseFloat(inventory.PhysicalOriginValueBalance)) {\r\n columnProps.showDeliveryColumn = true;\r\n } else {\r\n if (inventory.Period > 1) {\r\n columnProps.showInstalmentColumn = true;\r\n }\r\n if (inventory.UnpaidAmount > 0) {\r\n columnProps.showRepaymentColumn = true;\r\n }\r\n }\r\n }\r\n });\r\n\r\n }\r\n };\r\n\r\n\r\n return
\r\n
\r\n \r\n
\r\n {padView}\r\n
\r\n
\r\n
\r\n }\r\n else {\r\n let instrument = showInOpenPosition ? this.props.instrument : model.placingData.selectedInstrument;\r\n\r\n let columnProps = { showInstalmentColumn: false, showRepaymentColumn: false, showDeliveryColumn: false }\r\n\r\n let fullPaidOrderViews = [];\r\n let partialPaidOrderViews = [];\r\n if (instrument.physicalInventory) {\r\n let inventories = Object.values(instrument.physicalInventory).sort((a, b) => b.Transaction.ExecuteTime.localeCompare(a.Transaction.ExecuteTime));\r\n inventories.forEach((inventory, index) => {\r\n if (parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess > 0) {\r\n if (Math.abs(parseFloat(inventory.PaidPledgeBalance)) == parseFloat(inventory.PhysicalOriginValueBalance)) {\r\n fullPaidOrderViews.push();\r\n } else {\r\n if (inventory.Period > 1) {\r\n columnProps.showInstalmentColumn = true;\r\n }\r\n if (inventory.UnpaidAmount > 0) {\r\n columnProps.showRepaymentColumn = true;\r\n }\r\n partialPaidOrderViews.push();\r\n }\r\n }\r\n });\r\n }\r\n\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let canDelivery = ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.Delivery) == PhysicalTradeSide.Delivery);\r\n columnProps.showDeliveryColumn = (fullPaidOrderViews.length > 0);\r\n\r\n let mainPaneCss = showInOpenPosition ? '' : (isPad ? css.padMainPane : css.mainPane);\r\n return
\r\n {showInOpenPosition ? '' :\r\n
\r\n DialogWindow.Physical_Inventory\r\n
\r\n
\r\n }\r\n\r\n
\r\n \r\n {fullPaidOrderViews.length == 0 ? '' :
\r\n
DialogWindow.FullyPAD{showInOpenPosition ? '' : DialogWindow.Button_SelectAll}
\r\n {fullPaidOrderViews}\r\n
}\r\n\r\n {partialPaidOrderViews.length == 0 ? '' :\r\n
\r\n
DialogWindow.PartlyPAD
\r\n {partialPaidOrderViews}\r\n
\r\n }\r\n\r\n {showInOpenPosition ? '' :\r\n
\r\n \r\n \r\n \r\n
\r\n }\r\n
\r\n
\r\n }\r\n }\r\n\r\n\r\n}\r\n\r\n\r\nexport default withRouter(InventoryView);\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { CloseOutlined } from '@ant-design/icons';\r\n\r\nimport { DeliveryRequestStatus } from '../../common/const';\r\n\r\nimport BaseView from \"../baseview.js\";\r\n\r\nexport default class DeliveryInProcessView extends BaseView {\r\n\r\n componentDidMount() {\r\n // this.setState({ orderGroup : this.props.orderGroup});\r\n }\r\n\r\n refreshGroup() {\r\n }\r\n\r\n onPaneClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n\r\n render() {\r\n let moduleCss = this.getModuleCss('inventoryview', 'common');\r\n\r\n let { model, isPad } = this.props;\r\n\r\n let orderViews = [];\r\n // orderViews.push( );\r\n\r\n Object.values(model.instruments).forEach((instrument, index) => {\r\n if (instrument.deliveryInProcess && (isPad || instrument.Id === model.placingData.selectedInstrument.Id)) {\r\n let inventories = Object.values(instrument.deliveryInProcess).sort((a, b) => b.SubmitTime.localeCompare(a.SubmitTime));\r\n inventories.forEach((inventory, index) => {\r\n if (inventory.Status != DeliveryRequestStatus.Cancelled) {\r\n orderViews.push();\r\n }\r\n });\r\n }\r\n });\r\n\r\n return
\r\n
\r\n DialogWindow.Physical_InventoryInProcess\r\n
\r\n
\r\n \r\n
\r\n {orderViews}\r\n
\r\n
\r\n }\r\n\r\n\r\n}\r\n\r\n\r\nclass DeliveryInProcessItemView extends BaseView {\r\n\r\n componentDidMount() {\r\n }\r\n\r\n\r\n getInprocessStatusText(status) {\r\n switch (parseInt(status)) {\r\n\r\n case DeliveryRequestStatus.Stocked: //InventoryInProcessStatus.StockIsAvailable:\r\n return DialogWindow.Physical_StockIsAvailable;\r\n case DeliveryRequestStatus.Accepted: // InventoryInProcessStatus.Submitted:\r\n return DialogWindow.Physical_Submitted;\r\n case DeliveryRequestStatus.Approved: //InventoryInProcessStatus.Approved:\r\n return DialogWindow.Physical_Approved;\r\n case DeliveryRequestStatus.Cancelled: //InventoryInProcessStatus.Approved:\r\n return DialogWindow.Physical_Canceled;\r\n case DeliveryRequestStatus.OrderCreated: //InventoryInProcessStatus.StockIsAvailable:\r\n return DialogWindow.Physical_ContractConverted;\r\n case DeliveryRequestStatus.Delivered: //InventoryInProcessStatus.StockIsAvailable:\r\n return DialogWindow.Physical_DeliveryCompletede;\r\n default:\r\n return status;\r\n }\r\n }\r\n\r\n render() {\r\n let { model, inventory, instrument, isPad, isTitle } = this.props;\r\n let moduleCss = this.getModuleCss('inventoryview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n // let instrument = model.instruments[inventory.Transaction.InstrumentID];\r\n let account = !inventory ? '' : model.accounts[inventory.AccountId];\r\n let currency = undefined;\r\n if (inventory) {\r\n if (Boolean.parseBoolean(account.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n }\r\n else {\r\n currency = model.currencies[account.CurrencyId];\r\n }\r\n }\r\n let titleStyle = (model && model.config) ? { backgroundColor: model.config.getValue('titleBackgroundColor'), color: model.config.getValue('titleColor') } : {};\r\n titleStyle.borderBottomStyle = 'solid';\r\n titleStyle.borderBottomWidth = '1px';\r\n titleStyle.lineHeight = '2em';\r\n\r\n if (isPad) {\r\n if (this.props.isTitle)\r\n return
\r\n
DialogWindow.OrderCode
\r\n
DialogWindow.Account
\r\n
DialogWindow.InstrumentCode
\r\n
DialogWindow.SubmitTime
\r\n
DialogWindow.Physical_Weight
\r\n
DialogWindow.Physical_Unit
\r\n
DialogWindow.Physical_Status
\r\n\r\n
DialogWindow.Physical_SettlementTime
\r\n
\r\n else\r\n return
\r\n
{inventory.Code}
\r\n
{account.Name}
\r\n
{instrument.Description}
\r\n
{inventory.SubmitTime.substring(0, 10)}
\r\n
{parseFloat(inventory.RequireQuantity).toFixed(2)}
\r\n
{instrument.Unit}
\r\n
{this.getInprocessStatusText(inventory.Status)}
\r\n\r\n
{inventory.SettlementTime}
\r\n\r\n
\r\n } else {\r\n if (this.props.isTitle)\r\n return
\r\n
DialogWindow.OrderCode
\r\n
DialogWindow.Physical_Weight
\r\n
DialogWindow.Physical_Unit
\r\n
DialogWindow.Physical_Status
\r\n
DialogWindow.SubmitTime
\r\n
\r\n else\r\n return
\r\n
{inventory.Code}
\r\n
{parseFloat(inventory.RequireQuantity).toFixed(2)}
\r\n
{instrument.Unit}
\r\n
{this.getInprocessStatusText(inventory.Status)}
\r\n
{inventory.SubmitTime.substring(0, 10)}
\r\n
\r\n\r\n }\r\n }\r\n\r\n}\r\n\r\n","import { Map } from 'd3-collection';\r\nimport { timeFormat, timeParse } from 'd3-time-format';\r\nimport { ResolutionString } from '../charting_library/datafeed-api';\r\n// export type Int = number & { __int__: void };\r\n\r\nexport type IMap = Map;\r\n\r\nexport enum ViewType {\r\n original,\r\n tradingview,\r\n};\r\n\r\nexport enum SettingType {\r\n MainIndicator,\r\n AuxIndicator,\r\n General\r\n};\r\n\r\nexport interface ILineSettings {\r\n // name: string;\r\n color: string;\r\n width: number;\r\n};\r\n\r\nexport interface IIndicatorArg{\r\n decimals: number;\r\n min: number;\r\n value: number;\r\n};\r\n\r\nexport interface IIndicatorSettings {\r\n indicatorName: string;\r\n args: IMap;\r\n lineSettings: IMap;\r\n};\r\n\r\nexport interface IChartIndicatorSettings {\r\n configId: string | undefined; // for debug\r\n mainIndictorsSettings: IMap; // indicatorName=>IIndicatorSettings\r\n auxIndicatorSettings: IIndicatorSettings;\r\n};\r\n\r\nexport interface IChartGeneralSettings {\r\n riseBarColor: string;\r\n fallBarColor: string;\r\n}\r\n\r\nexport interface IChartConfig {\r\n chartType: ChartType;\r\n generalSettings: IChartGeneralSettings;\r\n indictorsSettings: IChartIndicatorSettings;\r\n};\r\n\r\nexport enum actionType {\r\n AddIndicator,\r\n RemoveIndicator,\r\n ChangeArg,\r\n ChangeLineColor,\r\n ReplaceSettings,\r\n ChangeBarColor\r\n};\r\n\r\nexport interface IChangeIndiLineColorArgs {\r\n indiName: string,\r\n lineName: string,\r\n color: string\r\n};\r\n\r\nexport interface IInfoItem {\r\n name: string;\r\n value: any;\r\n}\r\n\r\nexport interface IAction {\r\n type: actionType;\r\n args: any | IChangeIndiLineColorArgs | IInfoItem;\r\n};\r\n\r\nexport interface IChildRef {\r\n setData: (data: any) => void;\r\n onGetMoreData: (endTime: Date, xExtents: number[]) => void;\r\n readonly onLoadingData: (isLoading: boolean) => void;\r\n};\r\n\r\nexport interface ITooltipProps {\r\n readonly settings: IIndicatorSettings;\r\n readonly currentBarData: any;\r\n readonly pricesDisplayFormat: (n: number | { valueOf(): number; }) => string;\r\n};\r\n\r\n\r\nexport enum ChartType {\r\n Minute1 = 1,\r\n Minute5 = 5,\r\n Minute15 = 15,\r\n Minute30 = 30,\r\n Hour1 = 60,\r\n Hour2 = 120,\r\n Hour3 = 180,\r\n Hour4 = 240,\r\n Hour5 = 300,\r\n Hour6 = 360,\r\n Hour7 = 420,\r\n Hour8 = 480,\r\n Daily = 1440,\r\n Weekly = 10080,\r\n Monthly = 42000,\r\n};\r\n\r\nexport const timeFormater = timeFormat(\"%Y-%m-%d %H:%M:%S\");\r\nexport const timeFormaterWithMs = timeFormat(\"%Y-%m-%d %H:%M:%S.%L\");\r\nexport const timeParser = timeParse(\"%Y-%m-%d %H:%M:%S\");\r\nexport const timeParserWithMs = timeParse(\"%Y-%m-%d %H:%M:%S.%L\");\r\n\r\nexport enum ScreenOrient{\r\n portrait,\r\n landscape\r\n};\r\n\r\nexport enum DataRangeType\r\n{\r\n Unlimited = 0,\r\n Today = 1,\r\n ThisWeek = 2,\r\n ThisMonth = 3,\r\n ThisQuarter = 4,\r\n ThisYear = 5,\r\n Day2 = 6,\r\n Day3 = 7,\r\n Day4 = 8,\r\n Day5 = 9,\r\n Day10 = 10,\r\n Day15 = 15,\r\n Day30 = 30,\r\n Day45 = 45,\r\n Day60 = 60,\r\n Day90 = 90,\r\n Day120 = 120,\r\n Day180 = 180,\r\n Month1 = 201,\r\n Month2 = 202,\r\n Month3 = 203,\r\n Month6 = 204,\r\n Year1 = 305,\r\n Year2 = 306,\r\n Year3 = 307,\r\n Year4 = 308,\r\n Year5 = 309,\r\n Year10 = 300,\r\n Year20 = 301,\r\n};\r\n\r\nexport function ResolutionToChartType(resolution: ResolutionString) {\r\n\tlet chartType;\r\n\tswitch (resolution) {\r\n\t\tcase '1D':\r\n\t\t\tchartType = ChartType.Daily;\r\n\t\t\tbreak;\r\n\t\tcase '1W':\r\n\t\t\tchartType = ChartType.Weekly;\r\n\t\t\tbreak;\r\n\t\tcase '1M':\r\n\t\t\tchartType = ChartType.Monthly;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t// console.error('Unknown resolution: ' + resolution);\r\n\t\t\tchartType = parseInt(resolution);\r\n\t\t\tbreak;\r\n\t}\r\n\treturn chartType as ChartType;\r\n}\r\n\r\nexport function ChartTypeToResolution(chartType: ChartType) {\r\n let resolution;\r\n if (chartType <= 480) {\r\n resolution = '' + chartType;\r\n } else {\r\n const typeName = ChartType[chartType];\r\n resolution = typeName[0];\r\n }\r\n\treturn resolution as ResolutionString;\r\n}\r\n\r\nexport interface IInstrumentInfo {\r\n id: string;\r\n code: string;\r\n description: string;\r\n quotePolicyId: string;\r\n}\r\n\r\nexport interface IQuotation {\r\n Bid: string;\r\n Ask: string;\r\n Timestamp: Date;\r\n}\r\n\r\nexport function GetDataCycleString(chartType: ChartType)\r\n{\r\n let ret: string = \"\";\r\n switch (chartType)\r\n {\r\n case ChartType.Minute1:\r\n ret = \"M1\";\r\n break;\r\n case ChartType.Minute5:\r\n ret = \"M5\";\r\n break;\r\n case ChartType.Minute15:\r\n ret = \"M15\";\r\n break;\r\n case ChartType.Minute30:\r\n ret = \"M30\";\r\n break;\r\n case ChartType.Hour1:\r\n ret = \"H1\";\r\n break;\r\n case ChartType.Hour2:\r\n ret = \"H2\";\r\n break;\r\n case ChartType.Hour3:\r\n ret = \"H3\";\r\n break;\r\n case ChartType.Hour4:\r\n ret = \"H4\";\r\n break;\r\n case ChartType.Hour5:\r\n ret = \"H5\";\r\n break;\r\n case ChartType.Hour6:\r\n ret = \"H6\";\r\n break;\r\n case ChartType.Hour7:\r\n ret = \"H7\";\r\n break;\r\n case ChartType.Hour8:\r\n ret = \"H8\";\r\n break;\r\n case ChartType.Daily:\r\n ret = \"Daily\";\r\n break;\r\n case ChartType.Weekly:\r\n ret = \"Weekly\";\r\n break;\r\n case ChartType.Monthly:\r\n ret = \"Monthly\";\r\n break;\r\n }\r\n return ret;\r\n}\r\n","// import { TypeofTypeAnnotation } from '@babel/types';\r\n// import { AnyTxtRecord } from 'dns';\r\n// import { type } from 'os';\r\nimport { Bar, SubscribeBarsCallback } from '../../charting_library/datafeed-api';\r\n// import { nanoid } from '../chartHelper';\r\nimport { ChartType, DataRangeType, timeFormater } from '../typeDefine';\r\nimport { IAsyncResult } from \"./asyncResult\";\r\nimport { IOHLCData } from './iOHLCData';\r\nimport lastbarUpdater, { ILastbarUpdater, LastUpdateCallback } from './lastbarUpdater';\r\n\r\nexport enum RequestChartType\r\n{\r\n //0 = 获取图形当前数据 1 = 同步上一个或多个周期数据 2 = 获取图形历史数据\r\n GetCurrentChartData = 0,\r\n SynchronizeLastOrMoreCycleData = 1,\r\n GetHistoricalData = 2\r\n}\r\n\r\ntype RealPriceCallback = (bid: number, ask: number, timestamp: Date) => void\r\n\r\nexport interface IChartDataSource{\r\n (): () => void;\r\n instrumentId(): string;\r\n instrumentId(x: string): IChartDataSource;\r\n instrumentCode(): string;\r\n instrumentCode(x: string): IChartDataSource;\r\n instrumentDescription(): string;\r\n instrumentDescription(x: string): IChartDataSource;\r\n quotePolicyId(): string;\r\n quotePolicyId(x: string): IChartDataSource;\r\n chartType(): ChartType;\r\n chartType(x: ChartType): IChartDataSource;\r\n dataRange(): DataRangeType;\r\n dataRange(x: DataRangeType): IChartDataSource;\r\n commService(): ICommService;\r\n commService(x: ICommService): IChartDataSource;\r\n model(): IModel;\r\n model(x: IModel): IChartDataSource;\r\n\r\n OnChartTypeChanged: () => void | undefined;\r\n OnPeriodRangeChanged: (rangeType: DataRangeType) => void | undefined;\r\n GetInitChartData: (recordCount: number) => IAsyncResult;\r\n GetMoreChartData: (endTime: Date, recordCount: number) => IAsyncResult;\r\n GetLastBars: (beginTime: Date) => IAsyncResult;\r\n GetSystemTime: () => any; // assumption: SystemTime can be obtained directly from the data source.\r\n OnRealPrice: RealPriceCallback;\r\n OnChartDataNotify: (chartData: IOHLCData) => void; // 暂不处理DataNotify,图形已可正常走动。\r\n\r\n GetRangeBegintTime: (rangeType: DataRangeType) => string | undefined;\r\n BeginGetFixPeriodData: (rangeType: DataRangeType) => IAsyncResult;\r\n\r\n registerLastbarUpdateCallback: (listenerId: string, lastbar: Bar | undefined, callback: LastUpdateCallback) => void;\r\n unregisterLastbarUpdateCallback: (listenerId: string) => void;\r\n\r\n // subscribeRealPrice: (callback: RealPriceCallback) => void;\r\n registerDataBufferAccessor: (accessor: (begin: number, end: number) => IOHLCData[]) => void;\r\n getDataFromBuffer: (begin: number, end: number) => IOHLCData[];\r\n}\r\n\r\nexport interface ICommService {\r\n GetInitChartData: (instrumentId: string, quotePolicyId: string, chartType: ChartType, now: string, recordCount: number) => IAsyncResult;\r\n GetMoreChartData: (instrumentId: string, quotePolicyId: string, chartType: ChartType, endTime: Date, recordCount: number) => IAsyncResult;\r\n GetLastBars: (instrumentId: string, quotePolicyId: string, chartType: ChartType, beginTime: string, endTime: string) => IAsyncResult;\r\n GetFixPeriodData: (instrumentId: string, quotePolicyId: string, chartType: ChartType, beginTime: string, endTime: string) => IAsyncResult;\r\n GetChartFirstTradeDay: () => IAsyncResult;\r\n getFixPeriodBeginTimes: (instrumentId: string) => IAsyncResult;\r\n}\r\n\r\nexport interface ITradeDay {\r\n CurrentDay: Date;\r\n BeginTime: Date;\r\n EndTime: Date;\r\n LastDay: Date;\r\n}\r\n\r\nexport interface IModel {\r\n getServerTime: () => any;\r\n tradeDay: ITradeDay;\r\n config: {\r\n showTradingView: string,\r\n defaultViewType: string\r\n }\r\n}\r\n\r\nconst CurrentRangeTypes = [1, 2, 3, 4, 5] as const; // 1: currentDay, 2: current week 3: current month, 4: current quarter 5: current year\r\ntype TCurrentRangeTypes = typeof CurrentRangeTypes[number];\r\n\r\ntype TBeginTimes = { [key: number]: string };\r\ntype TInstrumentBeginTimes = {\r\n tradeDay?: Date,\r\n beginTimeDict?: { [key: string]: { [key: number]: string } }\r\n};\r\n\r\nexport const CurrentPeriodBeginTime: TBeginTimes = {}; // for period range: 1: currentDay, 2: current week 3: current month, 4: current quarter 5: current year\r\nexport const FixPeriodBeginTime: TInstrumentBeginTimes = {};\r\n\r\nexport default function () {\r\n let _instrumentId: string;\r\n let _instrumentCode: string;\r\n let _instrumentDescription: string;\r\n let _quotePolicyId: string;\r\n let _chartType: ChartType;\r\n let _dataRange: DataRangeType = DataRangeType.Unlimited;\r\n let _commService: TCommService;\r\n let _model: TModel;\r\n\r\n let _lastbarUpdater: ILastbarUpdater;\r\n let _dataBufferAccessor: (begin: number, end: number) => IOHLCData[];\r\n // const _callbacks: RealPriceCallback[] = [];\r\n\r\n // get begin time for: Month1 to Year20\r\n function getSpecificRangeBeginTime(rangeType: DataRangeType) {\r\n const typeName = DataRangeType[rangeType];\r\n const period = typeName.startsWith(\"Month\") ? \"months\" : \"years\";\r\n const unit = +typeName.substr(period.length - 1);\r\n const mom = _model.getServerTime();\r\n return mom.subtract(unit, period).format(\"yyyy-MM-DD HH:mm:ss\");\r\n }\r\n\r\n const chartDataSource: any = () => () => {\r\n /** Do Nothing */\r\n };\r\n\r\n chartDataSource.instrumentId = (newId?: string) => {\r\n if (newId === void 0) {\r\n return _instrumentId;\r\n }\r\n _instrumentId = newId;\r\n return chartDataSource;\r\n };\r\n\r\n chartDataSource.instrumentCode = (x?: string) => {\r\n if (x === void 0) {\r\n return _instrumentCode;\r\n }\r\n _instrumentCode = x;\r\n return chartDataSource;\r\n };\r\n\r\n chartDataSource.instrumentDescription = (x?: string) => {\r\n if (x === void 0) {\r\n return _instrumentDescription;\r\n }\r\n _instrumentDescription = x;\r\n return chartDataSource;\r\n };\r\n\r\n chartDataSource.quotePolicyId = (newId?: string) => {\r\n if (newId === void 0) {\r\n return _quotePolicyId;\r\n }\r\n _quotePolicyId = newId;\r\n return chartDataSource;\r\n }\r\n\r\n chartDataSource.chartType = (newType?: number) => {\r\n if (newType === void 0) {\r\n return _chartType;\r\n }\r\n if (_chartType !== newType) {\r\n _chartType = newType;\r\n if (chartDataSource.OnChartTypeChanged) {\r\n chartDataSource.OnChartTypeChanged();\r\n }\r\n }\r\n return chartDataSource;\r\n };\r\n\r\n chartDataSource.dataRange = (newType?: DataRangeType) => {\r\n if (newType === void 0) {\r\n return _dataRange;\r\n }\r\n _dataRange = newType;\r\n return chartDataSource;\r\n };\r\n\r\n chartDataSource.commService = (service?: TCommService) => {\r\n if (service === void 0) {\r\n return _commService;\r\n }\r\n _commService = service;\r\n return chartDataSource;\r\n };\r\n\r\n chartDataSource.model = (newModel?: TModel) => {\r\n if (newModel === void 0) {\r\n return _model;\r\n }\r\n _model = newModel;\r\n // @ts-ignore\r\n _commService.modelRef = _model;\r\n return chartDataSource;\r\n };\r\n\r\n chartDataSource.GetSystemTime = () => {\r\n const st = _model.getServerTime();\r\n // const std = timeParser(sts);\r\n if (!st) {\r\n console.error(`chartDataSource can not parser SeverTime: ${st}`);\r\n }\r\n return st;\r\n };\r\n\r\n // chartDataSource.OnChartTypeChanged = () => {\r\n // console.error(\"OnChartTypeChanged, should not be called here.\");\r\n // };\r\n\r\n chartDataSource.GetInitChartData = (recordCount: number) => {\r\n // const rangeType = 0;\r\n const momt = _model.getServerTime();\r\n if (!momt._isValid) {\r\n console.error(\"chartDataSource.GetInitChartData: getServerTime error.\");\r\n }\r\n const now = momt.format(\"yyyy-MM-DD HH:mm:ss\"); // timeFormater(new Date()); \r\n return _commService.GetInitChartData(_instrumentId, _quotePolicyId, _chartType, now, recordCount);\r\n };\r\n\r\n chartDataSource.GetMoreChartData = (endTime: Date, recordCount: number) => {\r\n return _commService.GetMoreChartData(_instrumentId, _quotePolicyId, _chartType, endTime, recordCount);\r\n };\r\n\r\n chartDataSource.GetLastBars = (beginTime: Date) => {\r\n const from = timeFormater(beginTime);\r\n const to = _model.getServerTime().format(\"yyyy-MM-DD HH:mm:ss\");\r\n return _commService.GetLastBars(_instrumentId, _quotePolicyId, _chartType, from, to);\r\n };\r\n\r\n chartDataSource.OnRealPrice = (bid: number, ask: number, timestamp: Date) => {\r\n setTimeout(() => _lastbarUpdater.onRealPrice(bid, ask, timestamp), 0);\r\n };\r\n chartDataSource.OnChartDataNotify = (chartData: IOHLCData) => { console.error(\"OnChartDataNotify should not be called here.\"); };\r\n\r\n\r\n chartDataSource.GetFixPeriodData = (beginTime: string, endTime: string) => {\r\n return _commService.GetFixPeriodData(_instrumentId, _quotePolicyId, _chartType, beginTime, endTime);\r\n };\r\n\r\n chartDataSource.GetRangeBegintTime = (rangeType: DataRangeType) => {\r\n let beginTime: string | undefined;\r\n if (CurrentRangeTypes.indexOf(rangeType as TCurrentRangeTypes) >= 0) {\r\n beginTime = CurrentPeriodBeginTime[rangeType];\r\n }\r\n else if (rangeType < DataRangeType.Month1) {\r\n if (FixPeriodBeginTime.beginTimeDict && FixPeriodBeginTime.beginTimeDict[_instrumentId]) {\r\n beginTime = FixPeriodBeginTime.beginTimeDict[_instrumentId][rangeType];\r\n }\r\n }\r\n else {\r\n beginTime = getSpecificRangeBeginTime(rangeType);\r\n }\r\n return beginTime;\r\n };\r\n\r\n chartDataSource.BeginGetFixPeriodData = (rangeType: DataRangeType) => {\r\n if (CurrentRangeTypes.indexOf(rangeType as TCurrentRangeTypes) >= 0) {\r\n if (Object.keys(CurrentPeriodBeginTime).length === 0) {\r\n const result = _commService.GetChartFirstTradeDay();\r\n result.done((dates) => {\r\n CurrentPeriodBeginTime[DataRangeType.Today] = dates[0];\r\n CurrentPeriodBeginTime[DataRangeType.ThisWeek] = dates[1];\r\n CurrentPeriodBeginTime[DataRangeType.ThisMonth] = dates[2];\r\n CurrentPeriodBeginTime[DataRangeType.ThisQuarter] = dates[3];\r\n CurrentPeriodBeginTime[DataRangeType.ThisYear] = dates[4];\r\n }).fail((err) => {\r\n console.error(\"GetChartFirstTradeDay error\", err);\r\n });\r\n return result;\r\n }\r\n else {\r\n const beginTime = CurrentPeriodBeginTime[rangeType];\r\n const endTime = _model.getServerTime().format(\"yyyy-MM-DD HH:mm:ss\");\r\n return chartDataSource.GetFixPeriodData(beginTime, endTime);\r\n }\r\n }\r\n else if (rangeType < DataRangeType.Month1) {\r\n const tradeDay = _model.tradeDay.CurrentDay;\r\n if (!FixPeriodBeginTime.tradeDay\r\n || FixPeriodBeginTime.tradeDay !== tradeDay\r\n || !FixPeriodBeginTime.beginTimeDict\r\n || !FixPeriodBeginTime.beginTimeDict[_instrumentId]\r\n ) {\r\n const result = _commService.getFixPeriodBeginTimes(_instrumentId);\r\n result.done((data) => {\r\n FixPeriodBeginTime.tradeDay = tradeDay;\r\n const dict: TBeginTimes = {};\r\n dict[DataRangeType.Day2] = data.day2BeginTime;\r\n dict[DataRangeType.Day3] = data.day3BeginTime;\r\n dict[DataRangeType.Day4] = data.day4BeginTime;\r\n dict[DataRangeType.Day5] = data.day5BeginTime;\r\n dict[DataRangeType.Day10] = data.day10BeginTime;\r\n dict[DataRangeType.Day15] = data.day15BeginTime;\r\n dict[DataRangeType.Day30] = data.day30BeginTime;\r\n dict[DataRangeType.Day45] = data.day45BeginTime;\r\n dict[DataRangeType.Day60] = data.day60BeginTime;\r\n dict[DataRangeType.Day90] = data.day90BeginTime;\r\n dict[DataRangeType.Day120] = data.day120BeginTime;\r\n dict[DataRangeType.Day180] = data.day180BeginTime;\r\n if (!FixPeriodBeginTime.beginTimeDict) {\r\n FixPeriodBeginTime.beginTimeDict = {};\r\n }\r\n FixPeriodBeginTime.beginTimeDict[_instrumentId] = dict;\r\n }).fail((err) => {\r\n console.log(\"getFixPeriodBeginTimes error\", err);\r\n });\r\n return result;\r\n }\r\n else {\r\n const beginTime = FixPeriodBeginTime.beginTimeDict[_instrumentId][rangeType as number];\r\n const endTime = _model.getServerTime().format(\"yyyy-MM-DD HH:mm:ss\");\r\n return chartDataSource.GetFixPeriodData(beginTime, endTime);\r\n }\r\n }\r\n else {\r\n const beginTime = getSpecificRangeBeginTime(rangeType);\r\n const endTime = _model.getServerTime().format(\"yyyy-MM-DD HH:mm:ss\");\r\n return chartDataSource.GetFixPeriodData(beginTime, endTime);\r\n }\r\n };\r\n\r\n chartDataSource.registerLastbarUpdateCallback = (listenerId: string, lastbar: IOHLCData | undefined, callback: LastUpdateCallback) => {\r\n // _lastbarUpdater = lastbarUpdater().chartDataSource(chartDataSource);\r\n // console.log(\"****** lastbarUpdater created!\");\r\n _lastbarUpdater.registerCallback(listenerId, lastbar, callback);\r\n };\r\n\r\n chartDataSource.unregisterLastbarUpdateCallback = (listenerId: string, lastbar: Bar, callback: LastUpdateCallback) => {\r\n // _lastbarUpdater = lastbarUpdater().chartDataSource(chartDataSource);\r\n // console.log(\"****** lastbarUpdater created!\");\r\n _lastbarUpdater.unregisterCallback(listenerId);\r\n };\r\n\r\n // chartDataSource.subscribeRealPrice = (callback: RealPriceCallback) => {\r\n // _callbacks.push(callback);\r\n // };\r\n chartDataSource.registerDataBufferAccessor = (accessor: (begin: number, end: number) => IOHLCData[]) => {\r\n _dataBufferAccessor = accessor;\r\n };\r\n\r\n chartDataSource.getDataFromBuffer = (begin: number, end: number) => {\r\n return _dataBufferAccessor(begin, end);\r\n };\r\n\r\n _lastbarUpdater = lastbarUpdater().chartDataSource(chartDataSource);\r\n\r\n return chartDataSource as IChartDataSource;\r\n}\r\n","import { IOHLCData } from \".\";\r\n// import { Bar } from \"../../charting_library/datafeed-api\";\r\n\r\nimport { timeFormaterWithMs } from \"../typeDefine\";\r\n// import { IAsyncResult } from \"./asyncResult\";\r\nimport { IChartDataSource } from './dataSource'\r\n\r\nexport type LastUpdateCallback = (bar: IOHLCData, ask?: number) => void;\r\n\r\nexport interface ILastbarUpdater{\r\n (): () => void;\r\n chartDataSource(): IChartDataSource;\r\n chartDataSource(x: IChartDataSource): ILastbarUpdater;\r\n registerCallback: (listenerId: string, lastbar: IOHLCData | undefined, callback: LastUpdateCallback) => void;\r\n unregisterCallback: (listenerId: string) => void;\r\n onRealPrice: (bid: number, ask: number, timestamp: Date) => void;\r\n}\r\n\r\nexport default function () {\r\n let _timeoutId: number = 0;\r\n let _lagFixingCount: number = 0;\r\n let _maxLagFixingCount: number = 10; // maybe market closed\r\n let _inLagFixing: boolean = false;\r\n // let _fixingBeginTime: number = 0;\r\n\r\n let _dataSource: IChartDataSource;\r\n // let _lastbar: Bar;\r\n let _lastbar: IOHLCData;\r\n let _callbacks: any = {};\r\n\r\n const lastbarUpdater = () => () => {\r\n\t\t/** Do Nothing */\r\n };\r\n \r\n\tlastbarUpdater.chartDataSource = (dataSource?: IChartDataSource) => {\r\n\t\tif (dataSource === void 0) {\r\n\t\t\treturn dataSource;\r\n\t\t}\r\n _dataSource = dataSource;\r\n // _dataSource.OnRealPrice = onRealPrice;\r\n\t\treturn lastbarUpdater;\r\n };\r\n \r\n lastbarUpdater.registerCallback = (listenerId: string, lastbar: IOHLCData | undefined, callback: LastUpdateCallback) => {\r\n if (lastbar) {\r\n //const { time, open, high, low, close, volume } = lastbar;\r\n const { date, open, high, low, close, volume } = lastbar;\r\n _lastbar = { date, open, high, low, close, volume };\r\n }\r\n _callbacks[listenerId] = callback;\r\n laggingCheck();\r\n\r\n // _dataSource.OnRealPrice = onRealPrice;\r\n // _dataSource.subscribeRealPrice(onRealPrice);\r\n }\r\n\r\n lastbarUpdater.unregisterCallback = (listenerId: string) => {\r\n delete _callbacks[listenerId];\r\n }\r\n\r\n function updateLastBar(bar: IOHLCData, ask?: number) {\r\n Object.values(_callbacks).forEach(callback => {\r\n (callback as LastUpdateCallback)(bar, ask);\r\n });\r\n }\r\n\r\n function getChartLeadingSpan() {\r\n const now = +_dataSource.GetSystemTime();\r\n const lastBarTime = _lastbar.date;\r\n\r\n let lastTime = new Date(lastBarTime);\r\n lastTime.setTime(lastTime.getTime() + _dataSource.chartType() * 60 * 1000);\r\n var chartLeadingSpan = +lastTime - now;\r\n return chartLeadingSpan;\r\n }\r\n\r\n function laggingCheck() {\r\n // if (this.unmounted) return;\r\n if (_lagFixingCount >= _maxLagFixingCount) {\r\n resetLagFixingState();\r\n return;\r\n }\r\n\r\n // const data = this.state.data as IOHLCData[];\r\n // if (!data || data.length === 0) {\r\n // resetLagFixingState();\r\n // return;\r\n // }\r\n\r\n var chartLeadingSpan = getChartLeadingSpan();\r\n if (chartLeadingSpan > 0) {\r\n // set new interval for last bar checking.\r\n startTimerWithRandDelay(chartLeadingSpan)\r\n }\r\n else {\r\n // 图形滞后,请求数据。\r\n _inLagFixing = true;\r\n // const beginTime = data[data.length - 1].date;\r\n try {\r\n // _fixingBeginTime = _dataSource.GetSystemTime().valueOf();\r\n const lastBarTime = _lastbar.date;\r\n const result = _dataSource.GetLastBars(lastBarTime)\r\n .done((datas: any[]) => {\r\n _lagFixingCount++;\r\n if (datas.length > 1) {\r\n if (lastBarTime.getTime() === datas[0].date.getTime()) {\r\n\r\n for (let index = 0; index < datas.length; index++) {\r\n const bar = datas[index] as IOHLCData;\r\n // const time = bar.date.getTime();\r\n // const { open, high, low, close, volume } = bar;\r\n // const tvBar = {time, open, high, low, close, volume };\r\n updateLastBar(bar);\r\n if (index === datas.length - 1) {\r\n _lastbar = bar;\r\n }\r\n }\r\n resetLagFixingState();\r\n laggingCheck(); // start new check cycle\r\n }\r\n else {\r\n console.log(\"GetLastBars got no expected data.\", { lastBarTime, _lastbar, datasGot: datas });\r\n }\r\n } else {\r\n startTimerWithRandDelay(0);\r\n }\r\n })\r\n .fail((error: any) => {\r\n console.log(\"GetLastBars failed\", error);\r\n startTimerWithRandDelay(0);\r\n })\r\n // .always(() => { // equal to finally\r\n // console.log(\"Call GetLastBars completed.\");\r\n // })\r\n ;\r\n // const temp: IAsyncResult[] = [];\r\n // this.pendingCalls.map((r) => {\r\n // if (r.finished()) {\r\n // temp.push(r);\r\n // }\r\n // });\r\n // this.pendingCalls = temp;\r\n // this.pendingCalls.push(result);\r\n } catch (err) {\r\n console.log(\"Call GetLastBars error.\", err);\r\n // startTimerWithRandDelay(0);\r\n }\r\n }\r\n };\r\n\r\n function startTimerWithRandDelay(interval: number) {\r\n const intMax = 2147483647;\r\n if (interval > intMax) { // 月线、年线溢出\r\n interval = intMax;\r\n }\r\n interval += 1000 + 3000 * Math.random(); // 延迟 1秒 + 0-3000毫秒\r\n _timeoutId = window.setTimeout(laggingCheck, interval);\r\n }\r\n \r\n function resetLagFixingState() {\r\n _inLagFixing = false;\r\n _lagFixingCount = 0;\r\n }\r\n\r\n lastbarUpdater.onRealPrice = (bid: number, ask: number, timestamp: Date) => {\r\n // console.log(\"barsUpdater received real price\", { bid, ask, timestamp });\r\n if (!_lastbar) return;\r\n\r\n let { date: cycleBeingTime, close, high, low, open, volume } = _lastbar;\r\n const cycleEndTime = new Date(cycleBeingTime.getTime() + _dataSource.chartType() * 60 * 1_000);\r\n const priceTime = timestamp.getTime();\r\n if (priceTime >= cycleBeingTime.getTime() && priceTime <= cycleEndTime.getTime()) {\r\n close = bid;\r\n if (high < close) high = close;\r\n if (low > close) low = close;\r\n const date = cycleBeingTime;\r\n _lastbar = { date, close, high, low, open, volume };\r\n updateLastBar(_lastbar, ask);\r\n }\r\n else if (priceTime > cycleEndTime.getTime()) {\r\n // // next cycle price data received, should fix last bars' datas.\r\n // const delay = _dataSource.GetSystemTime().valueOf() - _fixingBeginTime;\r\n // if (delay > 30_000) {\r\n // resetLagFixingState();\r\n // }\r\n if (!_inLagFixing && getChartLeadingSpan() < 0) {\r\n // startTimerWithRandDelay(0);\r\n laggingCheck();\r\n }\r\n }\r\n else {\r\n console.warn(`Outdated price received: priceTime:${timeFormaterWithMs(timestamp)},cycleBeingTime:${timeFormaterWithMs(new Date(cycleBeingTime))}`);\r\n }\r\n }\r\n\r\n return lastbarUpdater as ILastbarUpdater;\r\n}","import { sum, zip } from \"d3-array\";\r\nimport { slidingWindow } from \"react-financial-charts\";\r\nimport { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { sma } from \"@react-financial-charts/indicators/lib/calculator\";\r\n\r\nconst ALGORITHM_TYPE = \"SD\"; // StandardDeviation\r\n\r\nexport const SD_DefaultOptions = {\r\n sourcePath: \"close\",\r\n windowSize: 7,\r\n multiplier: 2\r\n};\r\n\r\nexport interface SDOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n readonly multiplier: number;\r\n}\r\n\r\n// calculator\r\nfunction sd_calculator() {\r\n let options = SD_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize, sourcePath, multiplier } = options;\r\n\r\n const sma_ = sma().options({ sourcePath, windowSize })(data);\r\n\r\n const sd_calc = slidingWindow()\r\n .windowSize(windowSize)\r\n .accumulator((values: any[]) => {\r\n let result;\r\n if (values[0][1]) { // values[0][0] close value,always has value; values[0][1] -> sma value, is undefined before windowSize.\r\n const lastSmaValue = values[values.length - 1][1];\r\n const total = sum(values.map((d) => Math.pow(d[0] - lastSmaValue, 2)));\r\n result = Math.sqrt(total / windowSize) * multiplier;\r\n }\r\n return result;\r\n });\r\n\r\n const sourceDatas = data.map((d) => d[sourcePath]);\r\n const zipped = zip(sourceDatas, sma_);\r\n const sdResult = sd_calc(zipped);\r\n return sdResult;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: SDOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...SD_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface SDIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): SDIndicator;\r\n accessor(): any;\r\n accessor(x: any): SDIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): SDIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): SDIndicator;\r\n echo(): any;\r\n echo(x: any): SDIndicator;\r\n type(): string;\r\n type(x: string): SDIndicator;\r\n merge(): any;\r\n merge(newMerge: any): SDIndicator;\r\n options(): SDOptions;\r\n options(newOptions: SDOptions): SDIndicator;\r\n}\r\n\r\nexport function sd() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = sd_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.sd = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as SDIndicator;\r\n}\r\n","export function linearRegression(pSource: number[], Periods: number) {\r\n\r\n let Y: number[] = new Array(); //Value\r\n let X: number = 0; //Period\r\n let N: number = 0;\r\n let q1: number = 0;\r\n let q2: number = 0;\r\n let q3: number = 0;\r\n // let XY: number = 0;\r\n // let XSquared: number = 0;\r\n // let YSquared: number = 0;\r\n let XSum: number = 0;\r\n let YSum: number = 0;\r\n let XSquaredSum: number = 0;\r\n let YSquaredSum: number = 0;\r\n let XYSum: number = 0;\r\n let Slope: number = 0;\r\n let Intercept: number = 0;\r\n let Forecast: number = 0;\r\n let RSquared: number = 0;\r\n\r\n // const Results: CRecordset;\r\n let Value: number = 0;\r\n let Record: number = 0;\r\n let RecordCount: number = 0;\r\n let Period: number = 0;\r\n let Position: number = 0;\r\n\r\n // RecordCount = pData.getRecordCount();\r\n RecordCount = pSource.length;\r\n\r\n const Field1: number[] = new Array(RecordCount);\r\n const Field2: number[] = new Array(RecordCount);\r\n const Field3: number[] = new Array(RecordCount);\r\n const Field4: number[] = new Array(RecordCount);\r\n\r\n // pData.MoveFirst();\r\n let pos = 1; // 1 based according to C++\r\n\r\n for (Record = Periods; Record < RecordCount + 1; Record++) {\r\n\r\n X = Periods;\r\n // Y.resize(X + 1);\r\n\r\n //Move back n periods\r\n Position = Record;\r\n // pData.setPosition(Record - Periods + 1);\r\n pos = Record - Periods + 1;\r\n\r\n for (Period = 1; Period < Periods + 1; Period++) {\r\n // Value = pSource.getValue(pData.getPosition());\r\n Value = pSource[pos - 1];\r\n Y[Period] = Value;\r\n // pData.MoveNext();\r\n pos++;\r\n } //Period\r\n\r\n //Return to original position and reset\r\n // pData.setPosition(Position);\r\n pos = Position;\r\n XSum = 0;\r\n YSum = 0;\r\n XSquaredSum = 0;\r\n YSquaredSum = 0;\r\n XYSum = 0;\r\n\r\n //Square\r\n for (N = 1; N < X + 1; N++) {\r\n XSum += N;\r\n YSum += Y[N];\r\n XSquaredSum += (N * N);\r\n YSquaredSum += (Y[N] * Y[N]);\r\n XYSum += (Y[N] * N);\r\n }//N\r\n\r\n N = X; //Number of periods in calculation\r\n q1 = (XYSum - ((XSum * YSum) / N));\r\n q2 = (XSquaredSum - ((XSum * XSum) / N));\r\n q3 = (YSquaredSum - ((YSum * YSum) / N));\r\n\r\n Slope = (q1 / q2); //Slope\r\n // Intercept = (((1 / (double)N) * YSum) - (((int)((double)N / 2)) * Slope)); //Intercept\r\n // @ts-ignore\r\n Intercept = (((1 / N) * YSum) - ((parseInt(N / 2)) * Slope)); //Intercept\r\n Forecast = ((N * Slope) + Intercept); //Forecast\r\n \r\n\t\t\r\n if ((q1 * q1) !== 0 && (q2 * q3) !== 0) {\r\n RSquared = (q1 * q1) / (q2 * q3); //Coefficient of determination (R-Squared)\r\n }\r\n\r\n if (Record > Periods) {\r\n // Field1.setValue(Record, Slope);\r\n // Field2.setValue(Record, Intercept);\r\n // Field3.setValue(Record, Forecast);\r\n // Field4.setValue(Record, RSquared);\r\n Field1[Record - 1] = Slope;\r\n Field2[Record - 1] = Intercept;\r\n Field3[Record - 1] = Forecast;\r\n Field4[Record - 1] = RSquared;\r\n }\r\n\r\n // pData.MoveNext();\r\n pos++;\r\n }//Record\r\n\r\n\r\n return {\r\n Slope: Field1,\r\n Intercept: Field2,\r\n Forecast: Field3,\r\n RSquared: Field4\r\n };\r\n}\r\n","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { linearRegression } from \"./linearRegression\";\r\n\r\nconst ALGORITHM_TYPE = \"VIDYA\";\r\n\r\nexport const VIDYA_DefaultOptions = {\r\n sourcePath: \"close\",\r\n windowSize: 7,\r\n R2Scale: 2\r\n};\r\n\r\nexport interface VIDYAOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n readonly R2Scale: number;\r\n}\r\n\r\n// calculator\r\nfunction VIDYA_calculator() {\r\n let options = VIDYA_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize, sourcePath, R2Scale } = options;\r\n\r\n const sourceDatas = data.map((d) => d[sourcePath]);\r\n const results = linearRegression(sourceDatas, windowSize);\r\n\r\n const start = 1;\r\n let pos = start;\r\n let previousValue: number;\r\n let R2Scaled: number;\r\n let result: number[] = new Array(sourceDatas.length);\r\n for(let record = start; record < sourceDatas.length; record++){\r\n previousValue = sourceDatas[pos - 1];\r\n R2Scaled = results.RSquared[pos] * R2Scale;\r\n result[pos] = R2Scaled * sourceDatas[pos] + (1 - R2Scaled) * previousValue;\r\n pos++;\r\n }\r\n \r\n return result;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: VIDYAOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...VIDYA_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface VIDYAIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): VIDYAIndicator;\r\n accessor(): any;\r\n accessor(x: any): VIDYAIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): VIDYAIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): VIDYAIndicator;\r\n echo(): any;\r\n echo(x: any): VIDYAIndicator;\r\n type(): string;\r\n type(x: string): VIDYAIndicator;\r\n merge(): any;\r\n merge(newMerge: any): VIDYAIndicator;\r\n options(): VIDYAOptions;\r\n options(newOptions: VIDYAOptions): VIDYAIndicator;\r\n}\r\n\r\nexport function VIDYA() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = VIDYA_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.VIDYA = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as VIDYAIndicator;\r\n}\r\n","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\n\r\nconst ALGORITHM_TYPE = \"AO\";\r\n\r\nexport const AO_DefaultOptions = {\r\n windowSize: 14,\r\n};\r\n\r\nexport interface AOOptions {\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction Aroon_calculator() {\r\n let options = AO_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize } = options;\r\n\r\n const recordCount: number = data.length;\r\n let record: number = 0;\r\n let period: number = 0;\r\n \r\n let highestHigh: number = 0;\r\n let lowestLow: number = 0;\r\n let highPeriod: number = 0;\r\n let lowPeriod: number = 0;\r\n let up: number, down: number;\r\n \r\n let Aroon: any[] = new Array(recordCount);\r\n \r\n for (record = 0; record < windowSize; ++record) {\r\n Aroon[record] = {};\r\n }\r\n for(record = windowSize; record < recordCount; ++record){\r\n highestHigh = data[record][\"high\"];\r\n lowestLow = data[record][\"low\"];\r\n highPeriod = record;\r\n lowPeriod = record;\r\n \r\n for (period = record - windowSize; period <= record; ++period) {\r\n \r\n if (data[period][\"high\"] > highestHigh) {\r\n highestHigh = data[period][\"high\"];\r\n highPeriod = period;\r\n }\r\n \r\n if (data[period][\"low\"] < lowestLow) {\r\n lowestLow = data[period][\"low\"];\r\n lowPeriod = period;\r\n }\r\n }\r\n \r\n up = ((windowSize - (record - highPeriod)) / windowSize) * 100;\r\n down = ((windowSize - (record - lowPeriod)) / windowSize) * 100;\r\n\r\n Aroon[record] = { up, down, os: up - down };\r\n }\r\n \r\n return Aroon;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: AOOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...AO_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface AOIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): AOIndicator;\r\n accessor(): any;\r\n accessor(x: any): AOIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): AOIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): AOIndicator;\r\n echo(): any;\r\n echo(x: any): AOIndicator;\r\n type(): string;\r\n type(x: string): AOIndicator;\r\n merge(): any;\r\n merge(newMerge: any): AOIndicator;\r\n options(): AOOptions;\r\n options(newOptions: AOOptions): AOIndicator;\r\n}\r\n\r\nexport function Aroon() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = Aroon_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.Aroon = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as AOIndicator;\r\n}\r\n","import React from \"react\";\r\n\r\nexport class ToolTipText extends React.PureComponent> {\r\n public static defaultProps = {\r\n className: \"react-financial-charts-tooltip\",\r\n fontFamily: \"-apple-system, system-ui, 'Helvetica Neue', Ubuntu, sans-serif\",\r\n fontSize: 11,\r\n };\r\n\r\n public render() {\r\n const { children, ...rest } = this.props;\r\n\r\n return {children};\r\n }\r\n}\r\n","import React from \"react\";\r\n\r\nexport class ToolTipTSpanLabel extends React.PureComponent> {\r\n public static defaultProps = {\r\n className: \"react-financial-charts-tooltip-label\",\r\n fill: \"#4682B4\",\r\n };\r\n\r\n public render() {\r\n const { children, ...rest } = this.props;\r\n\r\n return {children};\r\n }\r\n}\r\n","import { functor, GenericChartComponent } from \"@react-financial-charts/core\";\r\nimport { format } from \"d3-format\";\r\nimport * as React from \"react\";\r\nimport { ToolTipText } from \"./ToolTipText\";\r\nimport { ToolTipTSpanLabel } from \"./ToolTipTSpanLabel\";\r\n\r\nexport interface AroonTooltipProps {\r\n readonly origin: number[] | ((width: number, height: number) => [number, number]);\r\n readonly className?: string;\r\n readonly fontFamily?: string;\r\n readonly fontSize?: number;\r\n readonly fontWeight?: number;\r\n readonly labelFill?: string;\r\n readonly onClick?: (event: React.MouseEvent) => void;\r\n readonly yAccessor: (currentItem: any) => { up: number; down: number };\r\n readonly options: {\r\n windowSize: number;\r\n };\r\n readonly appearance: {\r\n stroke: {\r\n upLIne: string;\r\n downLine: string;\r\n };\r\n };\r\n readonly displayFormat: (value: number) => string;\r\n readonly displayInit?: string;\r\n readonly displayValuesFor?: (props: AroonTooltipProps, moreProps: any) => any;\r\n readonly label?: string;\r\n}\r\n\r\nexport class AroonTooltip extends React.Component {\r\n public static defaultProps = {\r\n className: \"react-financial-charts-tooltip\",\r\n displayFormat: format(\".2f\"),\r\n displayInit: \"n/a\",\r\n displayValuesFor: (_: any, props: any) => props.currentItem,\r\n label: \"Aroon\",\r\n origin: [0, 0],\r\n };\r\n\r\n public render() {\r\n return ;\r\n }\r\n\r\n private readonly renderSVG = (moreProps: any) => {\r\n const {\r\n onClick,\r\n fontFamily,\r\n fontSize,\r\n fontWeight,\r\n yAccessor,\r\n displayFormat,\r\n origin: originProp,\r\n label,\r\n className,\r\n displayInit,\r\n displayValuesFor = AroonTooltip.defaultProps.displayValuesFor,\r\n options,\r\n appearance,\r\n labelFill,\r\n } = this.props;\r\n const {\r\n chartConfig: { width, height },\r\n fullData,\r\n } = moreProps;\r\n\r\n const currentItem = displayValuesFor(this.props, moreProps) ?? fullData[fullData.length - 1];\r\n\r\n const aroon = currentItem && yAccessor(currentItem);\r\n\r\n const up = (aroon?.up && displayFormat(aroon.up)) ?? displayInit;\r\n const down = (aroon?.down && displayFormat(aroon.down)) ?? displayInit;\r\n\r\n const origin = functor(originProp);\r\n\r\n const [x, y] = origin(width, height);\r\n\r\n const { stroke } = appearance;\r\n\r\n return (\r\n \r\n \r\n {`${label}(${options.windowSize}) Up: `}\r\n {up}\r\n Down: \r\n {down}\r\n \r\n \r\n );\r\n };\r\n}\r\n","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { slidingWindow } from \"react-financial-charts\";\r\nimport { mean } from \"d3-array\";\r\n\r\nconst ALGORITHM_TYPE = \"CV\"; // ChaikinVolatility\r\n\r\nexport const CV_DefaultOptions = {\r\n windowSize: 14,\r\n rateOfChange: 2\r\n};\r\n\r\nexport interface CVOptions {\r\n readonly windowSize: number;\r\n readonly rateOfChange: number;\r\n}\r\n\r\n// calculator\r\nfunction cv_calculator() {\r\n let options = CV_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize, rateOfChange } = options;\r\n\r\n const recordCount: number = data.length;\r\n\r\n let cv = new Array(recordCount);\r\n\r\n let HL = new Array(recordCount);\r\n let record:number = 0;\r\n let start:number = 0;\r\n let value:number = 0;\r\n let ma1:number = 0;\r\n let ma2:number = 0;\r\n \r\n let pos: number;\r\n \r\n for (pos = 0; pos < recordCount; pos++) {\r\n HL[pos] = data[pos][\"high\"] - data[pos][\"low\"];\r\n }\r\n \r\n const average = slidingWindow()\r\n .windowSize(windowSize)\r\n .source((d: any) => d)\r\n .accumulator((values: any[]) => mean(values));\r\n const HLma = average(HL);\r\n \r\n start = rateOfChange;\r\n pos = start;\r\n for (record = start; record < recordCount + 1; record++) {\r\n ma1 = HLma[pos - rateOfChange];\r\n ma2 = HLma[pos];\r\n if (ma1 !== 0 && ma2 !== 0) {\r\n value = ((ma1 - ma2) / ma1) * -100;\r\n }\r\n cv[record] = value;\r\n pos++;\r\n }\r\n\r\n return cv;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: CVOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...CV_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface CVIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): CVIndicator;\r\n accessor(): any;\r\n accessor(x: any): CVIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): CVIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): CVIndicator;\r\n echo(): any;\r\n echo(x: any): CVIndicator;\r\n type(): string;\r\n type(x: string): CVIndicator;\r\n merge(): any;\r\n merge(newMerge: any): CVIndicator;\r\n options(): CVOptions;\r\n options(newOptions: CVOptions): CVIndicator;\r\n}\r\n\r\nexport function cv() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = cv_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.cv = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as CVIndicator;\r\n}\r\n","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\n\r\nconst ALGORITHM_TYPE = \"CMO\"; // ChandeMomentumOscillator\r\n\r\nexport const CMO_DefaultOptions = {\r\n sourcePath: \"close\",\r\n windowSize: 7,\r\n};\r\n\r\nexport interface CMOOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction cmo_calculator() {\r\n let options = CMO_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize, sourcePath } = options;\r\n\r\n let record: number = 0;\r\n let recordCount: number = data.length;\r\n let period: number = 0;\r\n let today: number = 0;\r\n let yesterday: number = 0;\r\n let upSum: number = 0;\r\n let downSum: number = 0;\r\n let value: number | undefined = 0;\r\n \r\n const cmo = new Array(recordCount);\r\n \r\n let pos = 0;\r\n \r\n for (record = windowSize + 1; record < recordCount + 1; record++) {\r\n pos = record - windowSize;\r\n upSum = 0;\r\n downSum = 0;\r\n \r\n for (period = 1; period < windowSize + 1; period++) {\r\n yesterday = data[pos - 1][sourcePath];\r\n today = data[pos][sourcePath];\r\n \r\n if (today > yesterday) {\r\n upSum += (today - yesterday);\r\n }\r\n else if (today < yesterday) {\r\n downSum += (yesterday - today);\r\n }\r\n \r\n pos++;\r\n }\r\n \r\n if (upSum + downSum !== 0) {\r\n value = 100 * (upSum - downSum) / (upSum + downSum);\r\n }\r\n else {\r\n value = void 0;\r\n }\r\n cmo[pos - 1] = value;\r\n }\r\n \r\n return cmo;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: CMOOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...CMO_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface CMOIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): CMOIndicator;\r\n accessor(): any;\r\n accessor(x: any): CMOIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): CMOIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): CMOIndicator;\r\n echo(): any;\r\n echo(x: any): CMOIndicator;\r\n type(): string;\r\n type(x: string): CMOIndicator;\r\n merge(): any;\r\n merge(newMerge: any): CMOIndicator;\r\n options(): CMOOptions;\r\n options(newOptions: CMOOptions): CMOIndicator;\r\n}\r\n\r\nexport function cmo() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = cmo_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.cmo = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as CMOIndicator;\r\n}","import { mean } from \"d3-array\";\r\nimport { slidingWindow } from \"react-financial-charts\";\r\nimport { IOHLCData } from \"../../data\";\r\n\r\nexport function convertNaN(value: any) {\r\n return typeof value === 'number' && isNaN(value) ? undefined : value;\r\n}\r\n\r\nexport function TypicalPrice(datas: IOHLCData[]) {\r\n return datas.map((d) => (d.high + d.low + d.close) / 3);\r\n}\r\n\r\nexport function sma(datas: number[], windowSize: number) {\r\n const average = slidingWindow()\r\n .windowSize(windowSize)\r\n .source((d: any) => d)\r\n .accumulator((values: any[]) => mean(values));\r\n return average(datas);\r\n}\r\n\r\nexport function OHLCData_sma(datas: IOHLCData[], windowSize: number, sourcePath: string) {\r\n const average = slidingWindow()\r\n .windowSize(windowSize)\r\n .sourcePath(sourcePath)\r\n .accumulator((values: any[]) => mean(values));\r\n return average(datas);\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { TypicalPrice, sma } from \"./utils\";\r\n\r\nconst ALGORITHM_TYPE = \"CCI\"; // CommodityChannelIndex\r\n\r\nexport const CCI_DefaultOptions = {\r\n windowSize: 7,\r\n};\r\n\r\nexport interface CCIOptions {\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction cci_calculator() {\r\n let options = CCI_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize } = options;\r\n \r\n let meanDeviation = 0;\r\n let count = 0;\r\n let recordCount = data.length;\r\n let index = 0;\r\n \r\n const cci = new Array(recordCount);\r\n \r\n const tp = TypicalPrice(data);\r\n const tpsma = sma(tp, windowSize);\r\n\r\n for (index = (2 * windowSize) - 1; index < recordCount; ++index) {\r\n meanDeviation = 0;\r\n for (count = (index - windowSize); count < index + 1; ++count) {\r\n meanDeviation = meanDeviation + Math.abs(tp[count] - tpsma[count]);\r\n }\r\n meanDeviation = meanDeviation / windowSize;\r\n cci[index] = (tp[index] - tpsma[index]) / (meanDeviation * 0.015);\r\n }\r\n \r\n return cci;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: CCIOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...CCI_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface CCIIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): CCIIndicator;\r\n accessor(): any;\r\n accessor(x: any): CCIIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): CCIIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): CCIIndicator;\r\n echo(): any;\r\n echo(x: any): CCIIndicator;\r\n type(): string;\r\n type(x: string): CCIIndicator;\r\n merge(): any;\r\n merge(newMerge: any): CCIIndicator;\r\n options(): CCIOptions;\r\n options(newOptions: CCIOptions): CCIIndicator;\r\n}\r\n\r\nexport function cci() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = cci_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.cci = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as CCIIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { OHLCData_sma } from \"./utils\";\r\n\r\nconst ALGORITHM_TYPE = \"DPO\"; // DetrendedPriceOscillator\r\n\r\nexport const DPO_DefaultOptions = {\r\n sourcePath: \"close\",\r\n windowSize: 14,\r\n};\r\n\r\nexport interface DPOOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction dpo_calculator() {\r\n let options = DPO_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize, sourcePath } = options;\r\n let length = data.length;\r\n const dpo = new Array(length);\r\n \r\n const dpo_ma = OHLCData_sma(data, windowSize, sourcePath);\r\n \r\n for (let pos = windowSize; pos < length; pos++) {\r\n dpo[pos] = data[pos][sourcePath] - dpo_ma[pos - ((windowSize / 2) + 1)]\r\n }\r\n\r\n return dpo;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: DPOOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...DPO_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface DPOIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): DPOIndicator;\r\n accessor(): any;\r\n accessor(x: any): DPOIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): DPOIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): DPOIndicator;\r\n echo(): any;\r\n echo(x: any): DPOIndicator;\r\n type(): string;\r\n type(x: string): DPOIndicator;\r\n merge(): any;\r\n merge(newMerge: any): DPOIndicator;\r\n options(): DPOOptions;\r\n options(newOptions: DPOOptions): DPOIndicator;\r\n}\r\n\r\nexport function dpo() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = dpo_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.dpo = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as DPOIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\n\r\nconst ALGORITHM_TYPE = \"FCO\"; // FractalChaosOscillator\r\n\r\nexport const FCO_DefaultOptions = {\r\n sourcePath: \"close\",\r\n windowSize: 14,\r\n};\r\n\r\nexport interface FCOOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction fco_calculator() {\r\n let options = FCO_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n // let { windowSize, sourcePath } = options;\r\n let length = data.length;\r\n const fco = new Array(length);\r\n \r\n let index = 0;\r\n \r\n const fH = data.map((d: any) => d.high);\r\n const fL = data.map((d: any) => d.low);\r\n \r\n const fH1 = new Array(length);\r\n const fH2 = new Array(length);\r\n const fH3 = new Array(length);\r\n const fH4 = new Array(length);\r\n const fL1 = new Array(length);\r\n const fL2 = new Array(length);\r\n const fL3 = new Array(length);\r\n const fL4 = new Array(length);\r\n \r\n for (index = 4; index < length; ++index) {\r\n fH1[index] = fH[index - 4];\r\n fL1[index] = fL[index - 4];\r\n fH2[index] = fH[index - 3];\r\n fL2[index] = fL[index - 3];\r\n fH3[index] = fH[index - 2];\r\n fL3[index] = fL[index - 2];\r\n fH4[index] = fH[index - 1];\r\n fL4[index] = fL[index - 1];\r\n }\r\n \r\n for (index = 1; index < length; ++index) {\r\n fco[index] = 0;\r\n if (fH3[index] > fH1[index] &&\r\n fH3[index] > fH2[index] &&\r\n fH3[index] >= fH4[index] &&\r\n fH3[index] >= fH[index]) {\r\n fco[index] = 1;\r\n }\r\n if (fL3[index] < fL1[index] &&\r\n fL3[index] < fL2[index] &&\r\n fL3[index] <= fL4[index] &&\r\n fL3[index] <= fL[index]) {\r\n fco[index] = -1;\r\n }\r\n }\r\n \r\n return fco;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: FCOOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...FCO_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface FCOIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): FCOIndicator;\r\n accessor(): any;\r\n accessor(x: any): FCOIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): FCOIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): FCOIndicator;\r\n echo(): any;\r\n echo(x: any): FCOIndicator;\r\n type(): string;\r\n type(x: string): FCOIndicator;\r\n merge(): any;\r\n merge(newMerge: any): FCOIndicator;\r\n options(): FCOOptions;\r\n options(newOptions: FCOOptions): FCOIndicator;\r\n}\r\n\r\nexport function fco() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = fco_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.fco = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as FCOIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\n\r\nconst ALGORITHM_TYPE = \"MO\"; // MomentumOscillator\r\n\r\nexport const MO_DefaultOptions = {\r\n sourcePath: \"close\",\r\n windowSize: 7,\r\n};\r\n\r\nexport interface MOOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction mo_calculator() {\r\n let options = MO_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize, sourcePath } = options;\r\n\r\n let length = data.length;\r\n let value = 0;\r\n \r\n const mo = new Array(length);\r\n \r\n for (let pos = windowSize + 1; pos < length; pos++) {\r\n value = data[pos - windowSize][sourcePath];\r\n value = 100 + ((data[pos][sourcePath] - value) / value) * 100;\r\n mo[pos] = value;\r\n }\r\n \r\n return mo;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: MOOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...MO_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface MOIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): MOIndicator;\r\n accessor(): any;\r\n accessor(x: any): MOIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): MOIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): MOIndicator;\r\n echo(): any;\r\n echo(x: any): MOIndicator;\r\n type(): string;\r\n type(x: string): MOIndicator;\r\n merge(): any;\r\n merge(newMerge: any): MOIndicator;\r\n options(): MOOptions;\r\n options(newOptions: MOOptions): MOIndicator;\r\n}\r\n\r\nexport function mo() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = mo_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.mo = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as MOIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { OHLCData_sma } from \"./utils\";\r\n\r\nconst ALGORITHM_TYPE = \"PO\"; // PriceOscillator\r\n\r\nexport const PO_DefaultOptions = {\r\n sourcePath: \"close\",\r\n longCycle: 22,\r\n shortCycle: 14\r\n};\r\n\r\nexport interface POOptions {\r\n readonly sourcePath?: string;\r\n readonly longCycle: number,\r\n readonly shortCycle: number\r\n}\r\n\r\n// calculator\r\nfunction po_calculator() {\r\n let options = PO_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { longCycle, shortCycle, sourcePath } = options;\r\n let length = data.length;\r\n const po = new Array(length);\r\n \r\n const LongMA = OHLCData_sma(data, longCycle, sourcePath);\r\n const ShortMA = OHLCData_sma(data, shortCycle, sourcePath);\r\n \r\n const start = Math.max(longCycle, shortCycle);\r\n for (let pos = start; pos < length; pos++) {\r\n po[pos] = ((ShortMA[pos] - LongMA[pos]) / LongMA[pos]) * 100;\r\n }\r\n \r\n return po;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { longCycle } = options;\r\n\r\n return longCycle - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: POOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...PO_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface POIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): POIndicator;\r\n accessor(): any;\r\n accessor(x: any): POIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): POIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): POIndicator;\r\n echo(): any;\r\n echo(x: any): POIndicator;\r\n type(): string;\r\n type(x: string): POIndicator;\r\n merge(): any;\r\n merge(newMerge: any): POIndicator;\r\n options(): POOptions;\r\n options(newOptions: POOptions): POIndicator;\r\n}\r\n\r\nexport function po() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = po_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.po = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as POIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { OHLCData_sma } from \"./utils\";\r\n\r\nconst ALGORITHM_TYPE = \"RO\"; // RainbowOscillator\r\n\r\nexport const RO_DefaultOptions = {\r\n sourcePath: \"close\",\r\n Levels: 9,\r\n};\r\n\r\nexport interface ROOptions {\r\n readonly sourcePath?: string;\r\n readonly Levels: number;\r\n}\r\n\r\n// calculator\r\nfunction ro_calculator() {\r\n let options = RO_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { Levels, sourcePath } = options;\r\n\r\n let length = data.length;\r\n \r\n let record = 0;\r\n let value = 0;\r\n \r\n const ro = data.map(() => 0);\r\n const rsMA = OHLCData_sma(data, Levels, sourcePath);\r\n \r\n for (let Level = 1; Level < Levels; ++Level) {\r\n for (record = 0; record < length; ++record) {\r\n value = rsMA[record];\r\n ro[record] = data[record][sourcePath] - value + ro[record];\r\n }\r\n }\r\n \r\n for(record = 0; record < length; ++record){\r\n value = ro[record];\r\n ro[record] = ro[record] / Levels;\r\n }\r\n \r\n return ro;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { Levels } = options;\r\n\r\n return Levels - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: ROOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...RO_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface ROIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): ROIndicator;\r\n accessor(): any;\r\n accessor(x: any): ROIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): ROIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): ROIndicator;\r\n echo(): any;\r\n echo(x: any): ROIndicator;\r\n type(): string;\r\n type(x: string): ROIndicator;\r\n merge(): any;\r\n merge(newMerge: any): ROIndicator;\r\n options(): ROOptions;\r\n options(newOptions: ROOptions): ROIndicator;\r\n}\r\n\r\nexport function ro() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = ro_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.ro = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as ROIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { OHLCData_sma } from \"./utils\";\r\n// import { ema } from \"react-financial-charts\";\r\nimport { ema } from \"@react-financial-charts/indicators/lib/calculator\";\r\n\r\nconst ALGORITHM_TYPE = \"TRIX\"; // DetrendedPriceOscillator\r\n\r\nexport const TRIX_DefaultOptions = {\r\n sourcePath: \"close\",\r\n windowSize: 14,\r\n};\r\n\r\nexport interface TRIXOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction TRIX_calculator() {\r\n let options = TRIX_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize } = options;\r\n const length = data.length;\r\n const TRIX = new Array(length);\r\n\r\n const emafunc = ema().options(options);\r\n const emafunc2 = ema().options({windowSize, sourcePath: undefined});\r\n let EMA = emafunc2(emafunc2(emafunc(data)));\r\n\r\n // let EMA0 = emafunc(data);\r\n // let EMA = emafunc2(EMA0);\r\n // EMA = emafunc2(EMA);\r\n\r\n for (let pos = 1; pos < length; pos++) {\r\n let value = EMA[pos - 1];\r\n let value2 = EMA[pos];\r\n if (value && value2) {\r\n value = ((value2 - value) / value) * 100;\r\n TRIX[pos] = value;\r\n }\r\n }\r\n \r\n return TRIX;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: TRIXOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...TRIX_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface TRIXIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): TRIXIndicator;\r\n accessor(): any;\r\n accessor(x: any): TRIXIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): TRIXIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): TRIXIndicator;\r\n echo(): any;\r\n echo(x: any): TRIXIndicator;\r\n type(): string;\r\n type(x: string): TRIXIndicator;\r\n merge(): any;\r\n merge(newMerge: any): TRIXIndicator;\r\n options(): TRIXOptions;\r\n options(newOptions: TRIXOptions): TRIXIndicator;\r\n}\r\n\r\nexport function TRIX() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = TRIX_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.TRIX = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as TRIXIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { slidingWindow } from \"react-financial-charts\";\r\n\r\nconst ALGORITHM_TYPE = \"TR\"; // TrueRange\r\n\r\n// calculator\r\nfunction ro_calculator() {\r\n let source = (d: any) => ({ open: d.open, high: d.high, low: d.low, close: d.close });\r\n\r\n const calculator = (data: any[]) => {\r\n const trueRangeAlgorithm = slidingWindow()\r\n .windowSize(2)\r\n .source(source)\r\n .undefinedValue((d: any) => d.high - d.low) // the first TR value is simply the High minus the Low\r\n .accumulator((values: any) => {\r\n const prev = values[0];\r\n const d = values[1];\r\n return Math.max(d.high - d.low, d.high - prev.close, d.low - prev.close);\r\n });\r\n \r\n return trueRangeAlgorithm(data);\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface TRIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): TRIndicator;\r\n accessor(): any;\r\n accessor(x: any): TRIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): TRIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): TRIndicator;\r\n echo(): any;\r\n echo(x: any): TRIndicator;\r\n type(): string;\r\n type(x: string): TRIndicator;\r\n merge(): any;\r\n merge(newMerge: any): TRIndicator;\r\n}\r\n\r\nexport function tr() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = ro_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.tr = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as TRIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\n\r\nconst ALGORITHM_TYPE = \"UO\"; // UltimateOscillator\r\n\r\nexport const UO_DefaultOptions = {\r\n Cycle1: 7,\r\n Cycle2: 14,\r\n Cycle3: 28,\r\n};\r\n\r\nexport interface UOOptions {\r\n readonly Cycle1: number;\r\n readonly Cycle2: number;\r\n readonly Cycle3: number;\r\n}\r\n\r\n// calculator\r\nfunction mo_calculator() {\r\n let options = UO_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n const { Cycle1, Cycle2, Cycle3 } = options;\r\n\r\n const length = data.length;\r\n const result = new Array(length);\r\n \r\n let Record = 0;\r\n let Period = 0;\r\n let Periods = 0;\r\n let Start = 0;\r\n let Value = 0;\r\n let TL = 0;\r\n let BP = 0;\r\n let TR = 0;\r\n let BPSum1 = 0;\r\n let BPSum2 = 0;\r\n let BPSum3 = 0;\r\n let TRSum1 = 0;\r\n let TRSum2 = 0;\r\n let TRSum3 = 0;\r\n \r\n Periods = Math.max(Cycle1, Cycle2, Cycle3);\r\n \r\n Start = Periods + 1;\r\n let pos = Start;\r\n \r\n for(Record = Start; Record < length + 1; Record++){\r\n\r\n BPSum1 = 0;\r\n BPSum2 = 0;\r\n BPSum3 = 0;\r\n TRSum1 = 0;\r\n TRSum2 = 0;\r\n TRSum3 = 0;\r\n \r\n pos = Record - Cycle1;\r\n for(Period = 1; Period < Cycle1 + 1; Period++){\r\n if (data[pos][\"low\"] < data[pos - 1][\"close\"]) {\r\n TL = data[pos][\"low\"];\r\n }\r\n else{\r\n TL = data[pos - 1][\"close\"];\r\n }\r\n BP = data[pos][\"close\"] - TL;\r\n TR = data[pos][\"high\"] - data[pos][\"low\"];\r\n if (TR < data[pos][\"high\"] - data[pos - 1][\"close\"]) {\r\n TR = data[pos][\"high\"] - data[pos - 1][\"close\"];\r\n }\r\n if (TR < data[pos - 1][\"close\"] - data[pos][\"low\"]) {\r\n TR = data[pos - 1][\"close\"] - data[pos][\"low\"];\r\n }\r\n BPSum1 += BP;\r\n TRSum1 += TR;\r\n pos++;\r\n }\r\n \r\n pos -= Cycle2;\r\n for (Period = 1; Period < Cycle2 + 1; Period++) {\r\n if (data[pos][\"low\"] < data[pos - 1][\"close\"]) {\r\n TL = data[pos][\"low\"];\r\n }\r\n else {\r\n TL = data[pos - 1][\"close\"];\r\n }\r\n BP = data[pos][\"close\"] - TL;\r\n TR = data[pos][\"high\"] - data[pos][\"low\"];\r\n if (TR < data[pos][\"high\"] - data[pos - 1][\"close\"]) {\r\n TR = data[pos][\"high\"] - data[pos - 1][\"close\"];\r\n }\r\n if (TR < data[pos - 1][\"close\"] - data[pos][\"low\"]) {\r\n TR = data[pos - 1][\"close\"] - data[pos][\"low\"];\r\n }\r\n BPSum2 += BP;\r\n TRSum2 += TR;\r\n pos++;\r\n }\r\n \r\n pos -= Cycle3;\r\n for (Period = 1; Period < Cycle3 + 1; Period++) {\r\n if (data[pos][\"low\"] < data[pos - 1][\"close\"]) {\r\n TL = data[pos][\"low\"];\r\n }\r\n else {\r\n TL = data[pos - 1][\"close\"];\r\n }\r\n BP = data[pos][\"close\"] - TL;\r\n TR = data[pos][\"high\"] - data[pos][\"low\"];\r\n if (TR < data[pos][\"high\"] - data[pos - 1][\"close\"]) {\r\n TR = data[pos][\"high\"] - data[pos - 1][\"close\"];\r\n }\r\n if (TR < data[pos - 1][\"close\"] - data[pos][\"low\"]) {\r\n TR = data[pos - 1][\"close\"] - data[pos][\"low\"];\r\n }\r\n BPSum3 += BP;\r\n TRSum3 += TR;\r\n pos++;\r\n }\r\n \r\n Value = (4 * (BPSum1 / TRSum1) + 2 * (BPSum2 / TRSum2) + (BPSum3 / TRSum3)) / (4 + 2 + 1) * 100;\r\n result[pos-1] = Value;\r\n }\r\n \r\n return result;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { Cycle1, Cycle2, Cycle3 } = options;\r\n\r\n return Math.max(Cycle1, Cycle2, Cycle3);\r\n };\r\n\r\n calculator.options = (newOptions?: UOOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...UO_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface UOIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): UOIndicator;\r\n accessor(): any;\r\n accessor(x: any): UOIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): UOIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): UOIndicator;\r\n echo(): any;\r\n echo(x: any): UOIndicator;\r\n type(): string;\r\n type(x: string): UOIndicator;\r\n merge(): any;\r\n merge(newMerge: any): UOIndicator;\r\n options(): UOOptions;\r\n options(newOptions: UOOptions): UOIndicator;\r\n}\r\n\r\nexport function uo() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = mo_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.uo = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as UOIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\n\r\nconst ALGORITHM_TYPE = \"VHF\"; // VerticalHorizontalFilter\r\n\r\nexport const VHF_DefaultOptions = {\r\n sourcePath: \"close\",\r\n windowSize: 7,\r\n};\r\n\r\nexport interface VHFOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction vhf_calculator() {\r\n let options = VHF_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize, sourcePath } = options;\r\n\r\n let length = data.length;\r\n // let value = 0;\r\n \r\n const vhf = new Array(length);\r\n \r\n let Record = 0;\r\n let Period = 0;\r\n let Start = 0;\r\n let HCP = 0;\r\n let LCP = 0;\r\n let Sum = 0;\r\n let Abs = 0;\r\n \r\n Start = windowSize + 1;\r\n let pos = Start;\r\n \r\n for(Record = Start; Record < length + 1; Record++){\r\n \r\n HCP = 0;\r\n LCP = data[pos][sourcePath];\r\n \r\n pos = Record - windowSize;\r\n \r\n for(Period = 1; Period < windowSize + 1; Period++){\r\n if(data[pos][sourcePath] < LCP){\r\n LCP = data[pos][sourcePath];\r\n }\r\n else if(data[pos][sourcePath] > HCP){\r\n HCP = data[pos][sourcePath];\r\n }\r\n pos++;\r\n }\r\n \r\n Sum = 0;\r\n pos = Record - windowSize;\r\n for(Period = 1; Period < windowSize + 1; Period++){\r\n Abs = data[pos][sourcePath] - data[pos - 1][sourcePath];\r\n Sum += Math.abs(Abs);\r\n pos++;\r\n }\r\n \r\n pos--;\r\n Abs = (HCP - LCP) / Sum;\r\n vhf[pos] = Math.abs(Abs);\r\n pos++;\r\n }\r\n \r\n return vhf;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: VHFOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...VHF_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface VHFIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): VHFIndicator;\r\n accessor(): any;\r\n accessor(x: any): VHFIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): VHFIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): VHFIndicator;\r\n echo(): any;\r\n echo(x: any): VHFIndicator;\r\n type(): string;\r\n type(x: string): VHFIndicator;\r\n merge(): any;\r\n merge(newMerge: any): VHFIndicator;\r\n options(): VHFOptions;\r\n options(newOptions: VHFOptions): VHFIndicator;\r\n}\r\n\r\nexport function vhf() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = vhf_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.vhf = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as VHFIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\n\r\nconst ALGORITHM_TYPE = \"WAD\"; // WilliamsAccumulationDistribution : silverlight,C++, webchart ehe chart are similar, the values don't match.\r\n\r\n\r\n// calculator\r\nfunction wad_calculator() {\r\n\r\n const calculator = (data: any[]) => {\r\n let length = data.length;\r\n let value = 0;\r\n \r\n const wad = new Array(length);\r\n wad[0] = 0; // cause dismatch between different charts\r\n let record = 0;\r\n let Start = 0;\r\n let TRH = 0;\r\n let TRL = 0;\r\n \r\n Start = 1;\r\n let pos = Start;\r\n \r\n for (record = 1; record < length; record++) {\r\n TRH = data[pos - 1][\"close\"];\r\n if (data[pos][\"high\"] > TRH) {\r\n TRH = data[pos][\"high\"];\r\n }\r\n \r\n TRL = data[pos - 1][\"close\"];\r\n if (data[pos][\"low\"] < TRL) {\r\n TRL = data[pos][\"low\"];\r\n }\r\n \r\n if (data[pos][\"close\"] > data[pos - 1][\"close\"]) {\r\n value = data[pos][\"close\"] - TRL;\r\n }\r\n else if (data[pos][\"close\"] < data[pos - 1][\"close\"]) {\r\n value = data[pos][\"close\"] - TRH;\r\n }\r\n else {\r\n value = 0;\r\n }\r\n wad[pos] = value + wad[pos - 1];\r\n pos++;\r\n }\r\n return wad;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n return 0;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface WADIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): WADIndicator;\r\n accessor(): any;\r\n accessor(x: any): WADIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): WADIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): WADIndicator;\r\n echo(): any;\r\n echo(x: any): WADIndicator;\r\n type(): string;\r\n type(x: string): WADIndicator;\r\n merge(): any;\r\n merge(newMerge: any): WADIndicator;\r\n}\r\n\r\nexport function wad() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = wad_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.wad = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as WADIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\n\r\nconst ALGORITHM_TYPE = \"WR\"; // WilliamsPctR\r\n\r\nexport const WR_DefaultOptions = {\r\n windowSize: 7,\r\n};\r\n\r\nexport interface WROptions {\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction wr_calculator() {\r\n let options = WR_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize } = options;\r\n\r\n let length = data.length;\r\n \r\n const wr = new Array(length);\r\n \r\n let record = 0;\r\n let period = 0;\r\n let start = 0;\r\n let HH = 0;\r\n let LL = 0;\r\n\r\n start = windowSize + 1;\r\n let pos = start;\r\n \r\n for (record = start; record < length + 1; record++) {\r\n HH = 0;\r\n LL = data[pos][\"low\"];\r\n pos = record - windowSize;\r\n for (period = 1; period < windowSize + 1; period++) {\r\n if (data[pos][\"high\"] > HH) {\r\n HH = data[pos][\"high\"];\r\n }\r\n if (data[pos][\"low\"] < LL) {\r\n LL = data[pos][\"low\"];\r\n }\r\n pos++;\r\n }\r\n \r\n wr[pos - 1] = (HH - data[pos - 1][\"close\"]) / (HH - LL) * -100;\r\n }\r\n return wr;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: WROptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...WR_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface WRIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): WRIndicator;\r\n accessor(): any;\r\n accessor(x: any): WRIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): WRIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): WRIndicator;\r\n echo(): any;\r\n echo(x: any): WRIndicator;\r\n type(): string;\r\n type(x: string): WRIndicator;\r\n merge(): any;\r\n merge(newMerge: any): WRIndicator;\r\n options(): WROptions;\r\n options(newOptions: WROptions): WRIndicator;\r\n}\r\n\r\nexport function wr() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = wr_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.wr = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as WRIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\n\r\nconst ALGORITHM_TYPE = \"SI\"; // SwingIndex\r\n\r\nexport const SI_DefaultOptions = {\r\n LimitMoveValue: 12,\r\n};\r\n\r\nexport interface SIOptions {\r\n readonly LimitMoveValue: number;\r\n}\r\nexport interface SICalculator {\r\n (data: any[]): any;\r\n undefinedLength(): number;\r\n options(): SIOptions;\r\n options(newOptions: SIOptions): SICalculator;\r\n}\r\n// calculator\r\nexport function si_calculator() {\r\n let options = SI_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n const { LimitMoveValue } = options;\r\n const length = data.length;\r\n const si = new Array(length);\r\n\t\r\n let Cy = 0;\r\n let Ct = 0;\r\n let Oy = 0;\r\n let Ot = 0;\r\n // let Hy = 0;\r\n let Ht = 0;\r\n // let Ly = 0;\r\n let Lt = 0;\r\n let K = 0;\r\n let R = 0;\r\n let A = 0;\r\n let B = 0;\r\n let C = 0;\r\n let value = 0;\r\n \r\n for (let pos = 1; pos < length; pos++) {\r\n Oy = data[pos - 1][\"open\"];\r\n Ot = data[pos][\"open\"];\r\n // Hy = data[pos - 1][\"high\"];\r\n Ht = data[pos][\"high\"];\r\n // Ly = data[pos - 1][\"low\"];\r\n Lt = data[pos][\"low\"];\r\n Cy = data[pos - 1][\"close\"];\r\n Ct = data[pos][\"close\"];\r\n \r\n K = Math.max(Math.abs(Ht - Cy), Math.abs(Lt - Cy));\r\n \r\n A = Math.abs(Ht - Cy);\r\n B = Math.abs(Lt - Cy);\r\n C = Math.abs(Ht - Lt);\r\n \r\n if (A > B && A > C) {\r\n R = Math.abs(Ht - Cy) - 0.5 * Math.abs(Lt - Cy) + 0.25 * Math.abs(Cy - Oy);\r\n }\r\n else if (B > A && B > C) {\r\n R = Math.abs(Lt - Cy) - 0.5 * Math.abs(Ht - Cy) + 0.25 * Math.abs(Cy - Oy);\r\n }\r\n else if (C > A && C > B) {\r\n R = Math.abs(Ht - Lt) + 0.25 * Math.abs(Cy - Oy);\r\n }\r\n \r\n value = 50 * ((Ct - Cy) + 0.5 * (Ct - Ot) + 0.25 * (Cy - Oy)) / R * K / LimitMoveValue;\r\n si[pos] = value;\r\n }\r\n \r\n return si;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { LimitMoveValue } = options;\r\n return LimitMoveValue - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: SIOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...SI_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator as SICalculator;\r\n}\r\n\r\n// indicator\r\ninterface SIIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): SIIndicator;\r\n accessor(): any;\r\n accessor(x: any): SIIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): SIIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): SIIndicator;\r\n echo(): any;\r\n echo(x: any): SIIndicator;\r\n type(): string;\r\n type(x: string): SIIndicator;\r\n merge(): any;\r\n merge(newMerge: any): SIIndicator;\r\n options(): SIOptions;\r\n options(newOptions: SIOptions): SIIndicator;\r\n}\r\n\r\nexport function si() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = si_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.si = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as SIIndicator;\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { si, SI_DefaultOptions } from '../addingIndicator/si';\r\n\r\nexport function siBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = SI_DefaultOptions;\r\n options.LimitMoveValue = settings.args.get(\"LimitMoveValue\")?.value as number;\r\n const calculator = si()\r\n .options(options)\r\n .accessor((d: any) => d.si);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `SI(${options.LimitMoveValue}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { si_calculator, SI_DefaultOptions, SIOptions } from \"./si\";\r\n\r\nconst ALGORITHM_TYPE = \"ASI\"; // AccumulativeSwingIndex, silverlight,C++, webchart ehe chart are similar, the values don't match.\r\n\r\n// calculator\r\nfunction asi_calculator() {\r\n let options = SI_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n const length = data.length;\r\n const asi = new Array(length);\r\n const RawSI = si_calculator().options(options)(data);\r\n \r\n asi[0] = 0; // cause dismatch between different charts\r\n for (let pos = 1; pos < length; pos++) {\r\n asi[pos] = RawSI[pos] + asi[pos - 1];\r\n }\r\n \r\n return asi;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { LimitMoveValue } = options;\r\n return LimitMoveValue - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: SIOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...SI_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface ASIIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): ASIIndicator;\r\n accessor(): any;\r\n accessor(x: any): ASIIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): ASIIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): ASIIndicator;\r\n echo(): any;\r\n echo(x: any): ASIIndicator;\r\n type(): string;\r\n type(x: string): ASIIndicator;\r\n merge(): any;\r\n merge(newMerge: any): ASIIndicator;\r\n options(): SIOptions;\r\n options(newOptions: SIOptions): ASIIndicator;\r\n}\r\n\r\nexport function asi() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = asi_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.asi = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as ASIIndicator;\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { hml } from '../addingIndicator/hml';\r\n\r\nexport function hmlBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const calculator = hml()\r\n .accessor((d: any) => d.hml);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `HML:`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\n\r\nconst ALGORITHM_TYPE = \"HML\"; // HighMinusLow\r\n\r\n// calculator\r\nfunction hml_calculator() {\r\n\r\n const calculator = (data: any[]) => {\r\n return data.map((d) => d.high - d.low);\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n return 0;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface HMLIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): HMLIndicator;\r\n accessor(): any;\r\n accessor(x: any): HMLIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): HMLIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): HMLIndicator;\r\n echo(): any;\r\n echo(x: any): HMLIndicator;\r\n type(): string;\r\n type(x: string): HMLIndicator;\r\n merge(): any;\r\n merge(newMerge: any): HMLIndicator;\r\n}\r\n\r\nexport function hml() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = hml_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.hml = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as HMLIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { linearRegression } from \"./linearRegression\";\r\n\r\nconst ALGORITHM_TYPE = \"LRRS\"; // LinearRegressionRSquared\r\n\r\nexport const LRRS_DefaultOptions = {\r\n sourcePath: \"close\",\r\n windowSize: 14,\r\n};\r\n\r\nexport interface LRRSOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction lrrs_calculator() {\r\n let options = LRRS_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize, sourcePath } = options;\r\n\r\n const sourceDatas = data.map((d) => d[sourcePath]);\r\n const results = linearRegression(sourceDatas, windowSize);\r\n \r\n return results.RSquared;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: LRRSOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...LRRS_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface LRRSIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): LRRSIndicator;\r\n accessor(): any;\r\n accessor(x: any): LRRSIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): LRRSIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): LRRSIndicator;\r\n echo(): any;\r\n echo(x: any): LRRSIndicator;\r\n type(): string;\r\n type(x: string): LRRSIndicator;\r\n merge(): any;\r\n merge(newMerge: any): LRRSIndicator;\r\n options(): LRRSOptions;\r\n options(newOptions: LRRSOptions): LRRSIndicator;\r\n}\r\n\r\nexport function lrrs() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = lrrs_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.lrrs = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as LRRSIndicator;\r\n}\r\n","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { linearRegression } from \"./linearRegression\";\r\n\r\nconst ALGORITHM_TYPE = \"LRS\"; // LinearRegressionSlope\r\n\r\nexport const LRS_DefaultOptions = {\r\n sourcePath: \"close\",\r\n windowSize: 7,\r\n};\r\n\r\nexport interface LRSOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction lrs_calculator() {\r\n let options = LRS_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize, sourcePath } = options;\r\n\r\n const sourceDatas = data.map((d) => d[sourcePath]);\r\n const results = linearRegression(sourceDatas, windowSize);\r\n \r\n return results.Slope;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: LRSOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...LRS_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface LRSIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): LRSIndicator;\r\n accessor(): any;\r\n accessor(x: any): LRSIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): LRSIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): LRSIndicator;\r\n echo(): any;\r\n echo(x: any): LRSIndicator;\r\n type(): string;\r\n type(x: string): LRSIndicator;\r\n merge(): any;\r\n merge(newMerge: any): LRSIndicator;\r\n options(): LRSOptions;\r\n options(newOptions: LRSOptions): LRSIndicator;\r\n}\r\n\r\nexport function lrs() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = lrs_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.lrs = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as LRSIndicator;\r\n}\r\n","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { ema } from \"@react-financial-charts/indicators/lib/calculator\";\r\n\r\nconst ALGORITHM_TYPE = \"MI\"; // MassIndex\r\n\r\nexport const MI_DefaultOptions = {\r\n windowSize: 7,\r\n};\r\n\r\nexport interface MIOptions {\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction mi_calculator() {\r\n let options = MI_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize } = options;\r\n\r\n let length = data.length;\r\n \r\n const mi = new Array(length);\r\n \r\n let record = 0;\r\n let rtart = 0;\r\n let reriod = 0;\r\n let sum = 0;\r\n \r\n if(windowSize < 1 || windowSize > length){\r\n return mi;\r\n }\r\n \r\n const hml = data.map((d) => d.high - d.low);\r\n const emafunc = ema().options({ windowSize: 9, sourcePath: undefined });\r\n const ema1 = emafunc(hml);\r\n const ema2 = emafunc(ema1);\r\n\r\n rtart = (windowSize * 2) + 1;\r\n let pos = rtart;\r\n \r\n for (record = rtart; record < length + 2; record++) {\r\n sum = 0;\r\n pos = record - windowSize;\r\n for (reriod = 1; reriod < windowSize + 1; reriod++) {\r\n let val1 = ema1[pos];\r\n let val2 = ema2[pos];\r\n if (val1 && val2 && val2 !== 0) {\r\n sum = sum + (val1 / val2); \r\n }\r\n pos++;\r\n }\r\n mi[pos - 1] = sum;\r\n }\r\n \r\n return mi;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: MIOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...MI_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface MIIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): MIIndicator;\r\n accessor(): any;\r\n accessor(x: any): MIIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): MIIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): MIIndicator;\r\n echo(): any;\r\n echo(x: any): MIIndicator;\r\n type(): string;\r\n type(x: string): MIIndicator;\r\n merge(): any;\r\n merge(newMerge: any): MIIndicator;\r\n options(): MIOptions;\r\n options(newOptions: MIOptions): MIIndicator;\r\n}\r\n\r\nexport function mi() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = mi_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.mi = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as MIIndicator;\r\n}","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\n\r\nconst ALGORITHM_TYPE = \"PI\"; // PerformanceIndex\r\n\r\nexport const PI_DefaultOptions = {\r\n sourcePath: \"close\",\r\n};\r\n\r\nexport interface PIOptions {\r\n readonly sourcePath?: string;\r\n}\r\n\r\n// calculator\r\nfunction pi_calculator() {\r\n let options = PI_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { sourcePath } = options;\r\n\r\n const firstPirce = data[0][sourcePath] as number;\r\n const results = data.map((d) => (d[sourcePath] - firstPirce) / firstPirce * 100);\r\n \r\n return results;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n return 1;\r\n };\r\n\r\n calculator.options = (newOptions?: PIOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...PI_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface PIIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): PIIndicator;\r\n accessor(): any;\r\n accessor(x: any): PIIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): PIIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): PIIndicator;\r\n echo(): any;\r\n echo(x: any): PIIndicator;\r\n type(): string;\r\n type(x: string): PIIndicator;\r\n merge(): any;\r\n merge(newMerge: any): PIIndicator;\r\n options(): PIOptions;\r\n options(newOptions: PIOptions): PIIndicator;\r\n}\r\n\r\nexport function pi() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = pi_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.pi = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as PIIndicator;\r\n}\r\n","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\n\r\nconst ALGORITHM_TYPE = \"PROC\"; // PriceROC\r\n\r\nexport const PROC_DefaultOptions = {\r\n sourcePath: \"close\",\r\n windowSize: 12,\r\n};\r\n\r\nexport interface PROCOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction proc_calculator() {\r\n let options = PROC_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize, sourcePath } = options;\r\n let length = data.length;\r\n const proc = new Array(length);\r\n let record = 0;\r\n let value = 0;\r\n let start = 0;\r\n let prevPrice = 0;\r\n \r\n start = windowSize;\r\n let pos = start; \r\n for(record = start; record < length; record++){\r\n prevPrice = data[pos - windowSize][sourcePath];\r\n value = ((data[pos][sourcePath] - prevPrice) / prevPrice) * 100;\r\n proc[record]= value;\r\n pos++;\r\n }\r\n \r\n return proc;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: PROCOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...PROC_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface PROCIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): PROCIndicator;\r\n accessor(): any;\r\n accessor(x: any): PROCIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): PROCIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): PROCIndicator;\r\n echo(): any;\r\n echo(x: any): PROCIndicator;\r\n type(): string;\r\n type(x: string): PROCIndicator;\r\n merge(): any;\r\n merge(newMerge: any): PROCIndicator;\r\n options(): PROCOptions;\r\n options(newOptions: PROCOptions): PROCIndicator;\r\n}\r\n\r\nexport function proc() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = proc_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.proc = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as PROCIndicator;\r\n}","import React from \"react\";\r\nimport { LineSeries } from \"react-financial-charts\";\r\n\r\nexport interface BBSeriesProps {\r\n readonly className?: string;\r\n readonly strokeStyle?: {\r\n top: string;\r\n middle: string;\r\n bottom: string;\r\n };\r\n}\r\n\r\nexport class BBSeries extends React.Component {\r\n public static defaultProps = {\r\n strokeStyle: {\r\n top: \"#26a69a\",\r\n middle: \"#812828\",\r\n bottom: \"#4682B4\"\r\n },\r\n };\r\n\r\n public render() {\r\n const { className, strokeStyle = BBSeries.defaultProps.strokeStyle } = this.props;\r\n \r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n\r\n private readonly yAccessorForTop = (d: any) => {\r\n return d.bb?.top;\r\n };\r\n\r\n private readonly yAccessorForBottom = (d: any) => {\r\n return d.bb?.bottom;\r\n };\r\n\r\n private readonly yAccessorForMiddle = (d: any) => {\r\n return d.bb?.middle;\r\n };\r\n // private readonly yAccessorForScaledLower = (scale: ScaleContinuousNumeric, d: any) => {\r\n // return scale(d.bb?.bottom);\r\n // };\r\n}\r\n","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { sma } from \"./utils\";\r\n\r\nconst ALGORITHM_TYPE = \"BB\"; // BollingerBands\r\n\r\nexport const BB_DefaultOptions = {\r\n windowSize: 20,\r\n // source: d => d.close, // \"high\", \"low\", \"open\", \"close\"\r\n sourcePath: \"close\",\r\n multiplier: 2,\r\n movingAverageType: \"sma\",\r\n};\r\n\r\nexport interface BBOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n readonly multiplier: number;\r\n readonly movingAverageType: string;\r\n}\r\n\r\n// calculator\r\nfunction bb_calculator() {\r\n let options = BB_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize, sourcePath, multiplier } = options;\r\n let results: any[] = new Array(data.length);\r\n let pos = 0;\r\n let middle = 0;\r\n const mediansma = sma(data.map(item => item[sourcePath]), windowSize);\r\n for (pos = windowSize; pos < data.length; pos++) {\r\n\r\n let sum = 0;\r\n middle = mediansma[pos];\r\n for (let period = 0; period < windowSize; period++) {\r\n sum += Math.pow(data[pos - period][sourcePath] - middle, 2);\r\n }\r\n let temp = multiplier * Math.sqrt(sum / windowSize);\r\n results[pos] = { middle, top: middle + temp, bottom: middle - temp };\r\n }\r\n\t\r\n return results;\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: BBOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...BB_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface BBIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): BBIndicator;\r\n accessor(): any;\r\n accessor(x: any): BBIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): BBIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): BBIndicator;\r\n echo(): any;\r\n echo(x: any): BBIndicator;\r\n type(): string;\r\n type(x: string): BBIndicator;\r\n merge(): any;\r\n merge(newMerge: any): BBIndicator;\r\n options(): BBOptions;\r\n options(newOptions: BBOptions): BBIndicator;\r\n}\r\n\r\nexport function bb() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = bb_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.bb = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as BBIndicator;\r\n}\r\n","import React from 'react';\r\nimport { IOHLCData } from '../../data'\r\nimport { IIndicatorSettings } from '../../typeDefine';\r\nimport { BBSeries } from '../series/BBSeries';\r\nimport { bb, BBOptions, BB_DefaultOptions } from '../addingIndicator/bb';\r\n\r\ninterface IbbStrokeStyle {\r\n top: string;\r\n middle: string;\r\n bottom: string;\r\n};\r\n\r\nfunction caculate_bb(data: IOHLCData[], options: BBOptions) {\r\n const bbc = bb ()\r\n .merge((d: any, c: any) => {\r\n d.bb = c;\r\n })\r\n .accessor((d: any) => d.bb)\r\n .options(options);\r\n\r\n return bbc(data);\r\n}\r\nexport function bbBuilder(initialData: IOHLCData[], settings: IIndicatorSettings) {\r\n let elements: any[] = [];\r\n\r\n const options = BB_DefaultOptions; // BBDefaultOptions;\r\n options.multiplier = settings.args.get(\"multiplier\")?.value as number;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n options.movingAverageType = 'sma'; // The value can be set to 'ema' otherwise calculated as 'sma'\r\n options.sourcePath = 'close';\r\n let data = caculate_bb(initialData, options);\r\n\r\n const strokes: IbbStrokeStyle = {\r\n top: \"#964B00\",\r\n middle: \"yellow\",\r\n bottom: \"#964B00\",\r\n };\r\n settings.lineSettings.entries().forEach((line) => {\r\n if (line.key === \"top\")\r\n strokes.top = line.value.color;\r\n else if (line.key === \"middle\")\r\n strokes.middle = line.value.color;\r\n else if (line.key === \"bottom\")\r\n strokes.bottom = line.value.color;\r\n else\r\n console.warn(line.key);\r\n });\r\n\r\n elements.push();\r\n\r\n return [data, elements];\r\n}\r\n","// import { ScaleContinuousNumeric } from \"d3-scale\";\r\nimport React from \"react\";\r\nimport { LineSeries, CurrentCoordinate } from \"react-financial-charts\";\r\n// import { ChartContext } from './chartContext'\r\n\r\nexport interface MASeriesProps {\r\n readonly className?: string;\r\n readonly strokeStyle?: {\r\n ma1: string;\r\n ma2: string;\r\n ma3: string;\r\n };\r\n}\r\n\r\nexport class MASeries extends React.Component {\r\n public static defaultProps = {\r\n strokeStyle: {\r\n ma1: \"#26a69a\",\r\n ma2: \"#812828\",\r\n ma3: \"#26a69a\",\r\n },\r\n };\r\n\r\n // static contextType = ChartContext;\r\n\r\n public render() {\r\n const { className, strokeStyle = MASeries.defaultProps.strokeStyle } = this.props;\r\n \r\n return (\r\n \r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n private readonly yAccessorForMa1 = (d: any) => {\r\n return d.ma1;\r\n };\r\n\r\n private readonly yAccessorForMa2 = (d: any) => {\r\n return d.ma2;\r\n };\r\n\r\n private readonly yAccessorForMa3 = (d: any) => {\r\n return d.ma3;\r\n };\r\n}\r\n","import React from 'react';\r\nimport { IOHLCData } from '../../data'\r\nimport { sma } from \"react-financial-charts\";\r\nimport { MASeries } from '../series/MASeries';\r\nimport { IIndicatorSettings } from '../../typeDefine';\r\n\r\nfunction caculate_ma(data: IOHLCData[], wss: number[]) {\r\n const ma1 = sma()\r\n .id(1)\r\n .options({ windowSize: wss[0] })\r\n .merge((d: any, c: any) => {\r\n d.ma1 = c;\r\n })\r\n .accessor((d: any) => d.ma1);\r\n const ma2 = sma()\r\n .id(2)\r\n .options({ windowSize: wss[1] })\r\n .merge((d: any, c: any) => {\r\n d.ma2 = c;\r\n })\r\n .accessor((d: any) => d.ma1);\r\n const ma3 = sma()\r\n .id(3)\r\n .options({ windowSize: wss[2] })\r\n .merge((d: any, c: any) => {\r\n d.ma3 = c;\r\n })\r\n .accessor((d: any) => d.ma1);\r\n \r\n return ma3(ma2(ma1(data))) as IOHLCData[];\r\n}\r\n\r\ninterface IMAStrokeStyle {\r\n ma1: string;\r\n ma2: string;\r\n ma3: string;\r\n};\r\n\r\nexport function maBuilder(initialData: IOHLCData[], settings: IIndicatorSettings) {\r\n let data = initialData;\r\n let elements: any[] = [];\r\n const { args, lineSettings } = settings;\r\n let windowSizes = [args.get(\"ma1\")?.value, args.get(\"ma2\")?.value, args.get(\"ma3\")?.value] as number[];\r\n data = caculate_ma(data, windowSizes);\r\n\r\n let strokes: IMAStrokeStyle | undefined;\r\n\r\n if (lineSettings.size() > 0) {\r\n strokes = { ma1: '#26a69a', ma2: \"#812828\", ma3: \"#26a69a\" };\r\n lineSettings.entries().forEach((line, index) => {\r\n if (line.key === \"ma1\")\r\n (strokes as IMAStrokeStyle).ma1 = line.value.color;\r\n else if (line.key === \"ma2\")\r\n (strokes as IMAStrokeStyle).ma2 = line.value.color;\r\n else if (line.key === \"ma3\")\r\n (strokes as IMAStrokeStyle).ma3 = line.value.color;\r\n });\r\n }\r\n elements.push();\r\n\r\n return [data, elements];\r\n}","import React from 'react';\r\nimport { IOHLCData } from '../../data'\r\nimport { sar, SARSeries } from \"react-financial-charts\";\r\nimport { SAROptions } from \"@react-financial-charts/indicators/src/calculator/sar\"\r\nimport { IIndicatorSettings } from '../../typeDefine';\r\n\r\ninterface ISARStrokeStyle {\r\n falling: string;\r\n rising: string;\r\n};\r\n\r\nfunction caculate_sar(data: IOHLCData[], options: SAROptions) {\r\n const calc = sar()\r\n .merge((d: any, c: any) => {\r\n d.sar = c;\r\n })\r\n .accessor((d: any) => d.sar)\r\n .options(options);\r\n \r\n return calc(data);\r\n}\r\n\r\nexport function sarBuilder(initialData: IOHLCData[], settings: IIndicatorSettings) {\r\n let elements: any[] = [];\r\n\r\n const accelerationFactor = settings.args.get(\"accelerationFactor\")?.value as number;\r\n const maxAccelerationFactor = settings.args.get(\"maxAccelerationFactor\")?.value as number;\r\n let data = caculate_sar(initialData, { accelerationFactor, maxAccelerationFactor });\r\n \r\n const yAccessor = (d: any) => {\r\n return d.sar;\r\n };\r\n\r\n let falling: string, rising: string;\r\n falling = rising = 'gray';\r\n settings.lineSettings.entries().forEach((line) => {\r\n if (line.key === \"falling\")\r\n falling = line.value.color;\r\n else if (line.key === \"rising\")\r\n rising = line.value.color;\r\n });\r\n const strokes: ISARStrokeStyle = { falling, rising };\r\n\r\n elements.push();\r\n\r\n return [data, elements];\r\n}\r\n","import { mean } from \"d3-array\";\r\nimport { slidingWindow } from \"react-financial-charts\";\r\nimport { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\nimport { convertNaN } from \"./utils\";\r\n\r\nconst ALGORITHM_TYPE = \"MAE\"; // MovingAverageEnvelope\r\n\r\nexport const MAE_DefaultOptions = {\r\n sourcePath: \"close\",\r\n windowSize: 10,\r\n shift: 0.5\r\n};\r\n\r\nexport interface MAEOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n readonly shift: number;\r\n}\r\n\r\n// calculator\r\nfunction mae_calculator() {\r\n let options = MAE_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize, sourcePath, shift } = options;\r\n shift = shift / 100; // according to algorithm of C++\r\n\r\n const mae_calc = slidingWindow()\r\n .windowSize(windowSize)\r\n .sourcePath(sourcePath)\r\n .accumulator((values: any[]) => {\r\n const avg = mean(values) as any;\r\n const lower = convertNaN(avg * (1.0 - shift)); // undefined * 10 : NaN, typeof(undefined * 10): number\r\n const upper = convertNaN(avg * (1.0 + shift));\r\n return { lower, upper };\r\n });\r\n\r\n return mae_calc(data);\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: MAEOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...MAE_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface MAEIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): MAEIndicator;\r\n accessor(): any;\r\n accessor(x: any): MAEIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): MAEIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): MAEIndicator;\r\n echo(): any;\r\n echo(x: any): MAEIndicator;\r\n type(): string;\r\n type(x: string): MAEIndicator;\r\n merge(): any;\r\n merge(newMerge: any): MAEIndicator;\r\n options(): MAEOptions;\r\n options(newOptions: MAEOptions): MAEIndicator;\r\n}\r\n\r\nexport function mae() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = mae_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.mae = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as MAEIndicator;\r\n}\r\n","import React from \"react\";\r\nimport { ScaleContinuousNumeric } from \"d3-scale\";\r\nimport { AreaOnlySeries, LineSeries } from \"react-financial-charts\";\r\n\r\n// from https://www.html-code-generator.com/javascript/color-converter-script\r\nfunction HEXtoRGB(hex: string) {\r\n hex = hex.replace(/#/g, '');\r\n if (hex.length === 3) {\r\n hex = hex.split('').map(function (hex) {\r\n return hex + hex;\r\n }).join('');\r\n }\r\n var result = /^([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})[\\da-z]{0,0}$/i.exec(hex);\r\n if (result) {\r\n var red = parseInt(result[1], 16);\r\n var green = parseInt(result[2], 16);\r\n var blue = parseInt(result[3], 16);\r\n\r\n return [red, green, blue];\r\n } else {\r\n return null;\r\n }\r\n}\r\n\r\nexport interface MAESeriesProps {\r\n readonly className?: string;\r\n readonly strokeStyle?: {\r\n upper: string;\r\n lower: string;\r\n fillStyle: string;\r\n };\r\n}\r\n\r\nexport class MAESeries extends React.Component {\r\n public static defaultProps = {\r\n strokeStyle: {\r\n upper: \"#26a69a\",\r\n lower: \"#812828\",\r\n fillStyle: \"#4682B4\"\r\n },\r\n };\r\n\r\n public render() {\r\n const { className, strokeStyle = MAESeries.defaultProps.strokeStyle } = this.props;\r\n const rgb = HEXtoRGB(strokeStyle.fillStyle);\r\n const fillStyle = rgb ? `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, 0.05)` : \"rgba(38, 166, 153, 0.05)\";\r\n \r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n\r\n private readonly yAccessorForUpper = (d: any) => {\r\n return d.mae?.upper;\r\n };\r\n\r\n private readonly yAccessorForLower = (d: any) => {\r\n return d.mae?.lower;\r\n };\r\n private readonly yAccessorForScaledLower = (scale: ScaleContinuousNumeric, d: any) => {\r\n return scale(d.mae?.lower);\r\n };\r\n}\r\n","import { merge, rebind } from \"@react-financial-charts/indicators/lib/utils\";\r\nimport baseIndicator from \"@react-financial-charts/indicators/lib/indicator/baseIndicator\";\r\n\r\nconst ALGORITHM_TYPE = \"WWS\"; // WellesWilderSmoothing\r\n\r\nexport const WWS_DefaultOptions = {\r\n sourcePath: \"close\",\r\n windowSize: 14,\r\n};\r\n\r\nexport interface WWSOptions {\r\n readonly sourcePath?: string;\r\n readonly windowSize: number;\r\n}\r\n\r\n// calculator\r\nfunction wws_calculator() {\r\n let options = WWS_DefaultOptions;\r\n\r\n const calculator = (data: any[]) => {\r\n let { windowSize, sourcePath } = options;\r\n let prevWWS: number;\r\n\r\n return data.map((d, i) => {\r\n if (i === 1) {\r\n prevWWS = d[sourcePath];\r\n return prevWWS;\r\n }\r\n else if (i > 1) {\r\n let curr = prevWWS + 1 / windowSize * (d[sourcePath] - prevWWS);\r\n prevWWS = curr;\r\n return curr;\r\n }\r\n else {\r\n return void 0;\r\n }\r\n });\r\n };\r\n\r\n calculator.undefinedLength = () => {\r\n const { windowSize } = options;\r\n\r\n return windowSize - 1;\r\n };\r\n\r\n calculator.options = (newOptions?: WWSOptions) => {\r\n if (newOptions === undefined) {\r\n return options;\r\n }\r\n\r\n options = { ...WWS_DefaultOptions, ...newOptions };\r\n\r\n return calculator;\r\n };\r\n\r\n return calculator;\r\n}\r\n\r\n// indicator\r\ninterface WWSIndicator {\r\n (data: any[], options?: { merge: boolean }): any;\r\n id(): number;\r\n id(x: number): WWSIndicator;\r\n accessor(): any;\r\n accessor(x: any): WWSIndicator;\r\n stroke(): string | any;\r\n stroke(x: string | any): WWSIndicator;\r\n fill(): string | any;\r\n fill(x: string | any): WWSIndicator;\r\n echo(): any;\r\n echo(x: any): WWSIndicator;\r\n type(): string;\r\n type(x: string): WWSIndicator;\r\n merge(): any;\r\n merge(newMerge: any): WWSIndicator;\r\n options(): WWSOptions;\r\n options(newOptions: WWSOptions): WWSIndicator;\r\n}\r\n\r\nexport function wws() {\r\n const base = baseIndicator()\r\n .type(ALGORITHM_TYPE);\r\n\r\n const underlyingAlgorithm = wws_calculator();\r\n\r\n const mergedAlgorithm = merge()\r\n .algorithm(underlyingAlgorithm)\r\n .merge((datum: any, c: any) => {\r\n datum.wws = c;\r\n });\r\n\r\n const indicator = (data: any[]) => {\r\n return mergedAlgorithm(data);\r\n };\r\n rebind(indicator, base, \"id\", \"accessor\", \"stroke\", \"fill\", \"echo\", \"type\");\r\n rebind(indicator, underlyingAlgorithm, \"options\", \"undefinedLength\");\r\n rebind(indicator, mergedAlgorithm, \"merge\", \"skipUndefined\");\r\n\r\n return indicator as WWSIndicator;\r\n}\r\n","import { Map as Imap, map, Map } from 'd3-collection';\r\nimport { IOHLCData } from './data';\r\nimport { ChartType, IChartConfig, IIndicatorSettings } from './typeDefine';\r\nimport {\r\n macdBuilder, rsiBuilder, stoBuilder, atrBuilder, sdBuilder, VIDYABuilder,\r\n AroonBuilder, AroonOscillatorBuilder, cvBuilder, cmoBuilder, cciBuilder,\r\n dpoBuilder, fcoBuilder, moBuilder, poBuilder, roBuilder, TRIXBuilder,\r\n trBuilder, uoBuilder, vhfBuilder, wadBuilder, wrBuilder, siBuilder, asiBuilder,\r\n hmlBuilder, lrrsBuilder, lrsBuilder, miBuilder, piBuilder, procBuilder\r\n} from './Indicator/builderForAux';\r\nimport { maBuilder, bbBuilder, sarBuilder, maeBuilder, wwsBuilder } from './Indicator/builderForMain';\r\nimport { customAlphabet } from 'nanoid';\r\nexport const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz1234567890', 8);\r\n\r\nexport function createMainIndicators(initialData: IOHLCData[], settings: Imap) {\r\n let data = initialData;\r\n let elements: any[] = [];\r\n let temp: any[];\r\n\r\n settings.each((value, key) => {\r\n if (key === \"MA\") {\r\n [data, temp] = maBuilder(data, value as IIndicatorSettings);\r\n elements = elements.concat(temp);\r\n }\r\n else if (key === \"BB\") {\r\n [data, temp] = bbBuilder(data, value as IIndicatorSettings);\r\n elements = elements.concat(temp);\r\n }\r\n else if (key === \"SAR\") {\r\n [data, temp] = sarBuilder(data, value as IIndicatorSettings);\r\n elements = elements.concat(temp);\r\n }\r\n else if (key === \"MAE\") {\r\n [data, temp] = maeBuilder(data, value as IIndicatorSettings);\r\n elements = elements.concat(temp);\r\n }\r\n else if (key === \"WWS\") {\r\n [data, temp] = wwsBuilder(data, value as IIndicatorSettings);\r\n elements = elements.concat(temp);\r\n }\r\n });\r\n return { data, elements };\r\n}\r\n\r\nexport function createAuxIndicator(initialData: IOHLCData[], settings: IIndicatorSettings|null, auxHeight: number, axisProps: object) {\r\n let data = initialData;\r\n let auxElement: any = null;\r\n if (settings && settings.indicatorName !== \"\") {\r\n if (settings.indicatorName === \"MACD\") {\r\n [data, auxElement] = macdBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"RSI\") {\r\n [data, auxElement] = rsiBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"STO\") {\r\n [data, auxElement] = stoBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"ATR\") {\r\n [data, auxElement] = atrBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"SD\") {\r\n [data, auxElement] = sdBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"VIDYA\") {\r\n [data, auxElement] = VIDYABuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"AN\") {\r\n [data, auxElement] = AroonBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"AO\") {\r\n [data, auxElement] = AroonOscillatorBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"CV\") {\r\n [data, auxElement] = cvBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"CMO\") {\r\n [data, auxElement] = cmoBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"CCI\") {\r\n [data, auxElement] = cciBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"DPO\") {\r\n [data, auxElement] = dpoBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"FCO\") {\r\n [data, auxElement] = fcoBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"MO\") {\r\n [data, auxElement] = moBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"PO\") {\r\n [data, auxElement] = poBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"RO\") {\r\n [data, auxElement] = roBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"TRIX\") {\r\n [data, auxElement] = TRIXBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"TR\") {\r\n [data, auxElement] = trBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"UO\") {\r\n [data, auxElement] = uoBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"VHF\") {\r\n [data, auxElement] = vhfBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"WAD\") {\r\n [data, auxElement] = wadBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"WR\") {\r\n [data, auxElement] = wrBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"SI\") {\r\n [data, auxElement] = siBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"ASI\") {\r\n [data, auxElement] = asiBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"HML\") {\r\n [data, auxElement] = hmlBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"LRRS\") {\r\n [data, auxElement] = lrrsBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"LRS\") {\r\n [data, auxElement] = lrsBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"MI\") {\r\n [data, auxElement] = miBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"PI\") {\r\n [data, auxElement] = piBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n else if (settings.indicatorName === \"PROC\") {\r\n [data, auxElement] = procBuilder(data, auxHeight, settings, axisProps);\r\n }\r\n }\r\n \r\n return { data, auxElement, hasAux: auxElement != null };\r\n}\r\n\r\nconst TvChartStyleProperties: Map = map();\r\nexport function getTvChartStyleProperties(symbol: string) {\r\n if (!TvChartStyleProperties.has(symbol)) {\r\n TvChartStyleProperties.set(symbol, [null, null, null]);\r\n }\r\n return TvChartStyleProperties.get(symbol) as any[];\r\n}\r\n\r\nconst TvChartConfigs: Map<(object | null)[]> = map();\r\nexport function getTvChartConfigs(symbol: string) {\r\n if (!TvChartConfigs.has(symbol)) {\r\n TvChartConfigs.set(symbol, [null, null, null]);\r\n }\r\n return TvChartConfigs.get(symbol) as (object | null)[];\r\n}\r\n\r\nexport const ChartConfigs: Map = map();\r\nexport function getChartConfigs(instrumentId: string) {\r\n if (!ChartConfigs.has(instrumentId)) {\r\n ChartConfigs.set(instrumentId, [\r\n {\r\n chartType: ChartType.Minute1,\r\n generalSettings: {\r\n riseBarColor: \"#26a69a\",\r\n fallBarColor: \"#ef5350\"\r\n },\r\n indictorsSettings: {\r\n configId: nanoid(),\r\n mainIndictorsSettings: map(),\r\n auxIndicatorSettings: {\r\n indicatorName: \"\",\r\n args: map(),\r\n lineSettings: map()\r\n },\r\n }\r\n },\r\n {\r\n chartType: ChartType.Minute1,\r\n generalSettings: {\r\n riseBarColor: \"#26a69a\",\r\n fallBarColor: \"#ef5350\"\r\n },\r\n indictorsSettings: {\r\n configId: nanoid(),\r\n mainIndictorsSettings: map(),\r\n auxIndicatorSettings: {\r\n indicatorName: \"\",\r\n args: map(),\r\n lineSettings: map()\r\n },\r\n }\r\n },\r\n {\r\n chartType: ChartType.Minute1,\r\n generalSettings: {\r\n riseBarColor: \"#26a69a\",\r\n fallBarColor: \"#ef5350\"\r\n },\r\n indictorsSettings: {\r\n configId: nanoid(),\r\n mainIndictorsSettings: map(),\r\n auxIndicatorSettings: {\r\n indicatorName: \"\",\r\n args: map(),\r\n lineSettings: map()\r\n },\r\n }\r\n }\r\n ]); \r\n }\r\n return ChartConfigs.get(instrumentId) as IChartConfig[];\r\n}\r\n","import React from 'react';\r\nimport { IOHLCData } from '../../data'\r\nimport { IIndicatorSettings } from '../../typeDefine';\r\nimport { mae, MAEOptions, MAE_DefaultOptions } from '../addingIndicator/mae';\r\nimport { MAESeries } from '../series/MAESeries';\r\n\r\nexport function maeBuilder(initialData: IOHLCData[], settings: IIndicatorSettings) {\r\n let elements: any[] = [];\r\n\r\n const windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const shift = settings.args.get(\"shift\")?.value as number;\r\n\r\n let options: MAEOptions = { windowSize, shift, sourcePath: MAE_DefaultOptions.sourcePath };\r\n const calc = mae().options(options);\r\n let data = calc(initialData);\r\n \r\n let { upper, lower, fillStyle } = MAESeries.defaultProps.strokeStyle;\r\n settings.lineSettings.entries().forEach((pair) => {\r\n if (pair.key === \"upper\")\r\n upper = pair.value.color;\r\n else if (pair.key === \"lower\")\r\n lower = pair.value.color;\r\n else if (pair.key === \"fillStyle\")\r\n fillStyle = pair.value.color;\r\n });\r\n const strokes = { upper, lower, fillStyle };\r\n\r\n elements.push();\r\n\r\n return [data, elements];\r\n}\r\n","import React from 'react';\r\nimport { LineSeries } from 'react-financial-charts';\r\nimport { IOHLCData } from '../../data'\r\nimport { IIndicatorSettings } from '../../typeDefine';\r\nimport { wws, WWSOptions, WWS_DefaultOptions } from '../addingIndicator/wws';\r\n\r\nexport function wwsBuilder(initialData: IOHLCData[], settings: IIndicatorSettings) {\r\n let elements: any[] = [];\r\n\r\n const windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n let options: WWSOptions = { windowSize, sourcePath: WWS_DefaultOptions.sourcePath };\r\n const calc = wws().options(options);\r\n let data = calc(initialData);\r\n \r\n const strokes = settings.lineSettings.entries()[0].value.color;\r\n\r\n elements.push( d.wws} />);\r\n\r\n return [data, elements];\r\n}\r\n","import React from \"react\";\r\nimport {\r\n macd,\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n MACDSeries,\r\n MACDTooltip,\r\n} from \"react-financial-charts\";\r\nimport { MACD as MACDOptions } from \"@react-financial-charts/indicators/src/calculator/defaultOptionsForComputation\"\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\n\r\nexport function macdBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n\r\n const options = MACDOptions;\r\n options.fast = settings.args.get(\"fast\")?.value as number;\r\n options.signal = settings.args.get(\"signal\")?.value as number;\r\n options.slow = settings.args.get(\"slow\")?.value as number;\r\n\r\n const macdAppearance = {\r\n fillStyle: {\r\n divergence: \"#4682B4\",\r\n },\r\n strokeStyle: {\r\n macd: \"#0093FF\",\r\n signal: \"#D84315\",\r\n zero: \"rgba(0, 0, 0, 0.3)\",\r\n },\r\n };\r\n settings.lineSettings.entries().forEach((pair) => {\r\n if (pair.key === \"divergence\")\r\n macdAppearance.fillStyle.divergence = pair.value.color;\r\n else if (pair.key === \"macd\")\r\n macdAppearance.strokeStyle.macd = pair.value.color;\r\n else if (pair.key === \"signal\")\r\n macdAppearance.strokeStyle.signal = pair.value.color;\r\n });\r\n\r\n const macdCalculator = macd()\r\n .options(options)\r\n .merge((d: any, c: any) => {\r\n d.macd = c;\r\n })\r\n .accessor((d: any) => d.macd);\r\n \r\n let data = macdCalculator(initialData);\r\n \r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from \"react\";\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n rsi,\r\n RSISeries,\r\n RSITooltip\r\n} from \"react-financial-charts\";\r\nimport { RSI as RsiDefaultOptions } from \"@react-financial-charts/indicators/src/calculator/defaultOptionsForComputation\"\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\n\r\nexport function rsiBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = RsiDefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = rsi().options(options);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let strokes = RSISeries.defaultProps.strokeStyle;\r\n settings.lineSettings.entries().forEach((line) => {\r\n if (line.key === \"top\")\r\n strokes.top = line.value.color;\r\n else if (line.key === \"middle\")\r\n strokes.middle = line.value.color;\r\n else if (line.key === \"bottom\")\r\n strokes.bottom = line.value.color;\r\n else if (line.key === \"insideThreshold\")\r\n strokes.insideThreshold = line.value.color;\r\n else if (line.key === \"outsideThreshold\")\r\n strokes.outsideThreshold = line.value.color;\r\n });\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from \"react\";\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n stochasticOscillator,\r\n StochasticSeries,\r\n StochasticTooltip\r\n} from \"react-financial-charts\";\r\nimport { FullStochasticOscillator } from \"@react-financial-charts/indicators/src/calculator/defaultOptionsForComputation\"\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\n\r\nexport function stoBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = FullStochasticOscillator;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n options.kWindowSize = settings.args.get(\"k\")?.value as number;\r\n options.dWindowSize = settings.args.get(\"d\")?.value as number;\r\n const calculator = stochasticOscillator()\r\n .options(options)\r\n .accessor((d: any) => d.sto);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let strokes = StochasticSeries.defaultProps.strokeStyle;\r\n settings.lineSettings.entries().forEach((pair) => {\r\n if (pair.key === \"k\")\r\n strokes.kLine = pair.value.color;\r\n else if (pair.key === \"d\")\r\n strokes.dLine = pair.value.color;\r\n });\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n atr,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { ATR as ATRDefaultOptions } from \"@react-financial-charts/indicators/src/calculator/defaultOptionsForComputation\"\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\n\r\nexport function atrBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = ATRDefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = atr()\r\n .options(options)\r\n .accessor((d: any) => d.atr);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let strokes = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `ATR(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { sd, SD_DefaultOptions } from '../addingIndicator/sd';\r\n\r\nexport function sdBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = SD_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n options.multiplier = settings.args.get(\"multiplier\")?.value as number;\r\n const calculator = sd()\r\n .options(options)\r\n .accessor((d: any) => d.sd);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `SD(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { VIDYA, VIDYA_DefaultOptions } from '../addingIndicator/VIDYA';\r\n\r\nexport function VIDYABuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = VIDYA_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n options.R2Scale = settings.args.get(\"R2Scale\")?.value as number;\r\n const calculator = VIDYA()\r\n .options(options)\r\n .accessor((d: any) => d.VIDYA);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let strokes = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `VIDYA(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings, ILineSettings } from \"../../typeDefine\";\r\nimport { Aroon, AO_DefaultOptions } from '../addingIndicator/Aroon';\r\nimport { AroonTooltip } from '../tooltip/AroonTooltip';\r\n\r\nexport function AroonBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = AO_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = Aroon()\r\n .options(options)\r\n .accessor((d: any) => d.Aroon);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let upstroke = (settings.lineSettings.get(\"up\") as ILineSettings).color;\r\n let downstroke = (settings.lineSettings.get(\"down\") as ILineSettings).color;\r\n const strokes = {stroke: {\r\n upLIne: upstroke,\r\n downLine: downstroke,\r\n }};\r\n\r\n const upAccesssor = (d: any) => {\r\n return d.Aroon.up;\r\n };\r\n const downAccesssor = (d: any) => {\r\n return d.Aroon.down;\r\n };\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n\r\n d.Aroon}\r\n appearance={strokes}\r\n options={options}\r\n />\r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip,\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings, ILineSettings } from \"../../typeDefine\";\r\nimport { Aroon, AO_DefaultOptions } from '../addingIndicator/Aroon';\r\nimport { format } from \"d3-format\";\r\n\r\nexport function AroonOscillatorBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = AO_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = Aroon()\r\n .options(options)\r\n .accessor((d: any) => d.Aroon);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n const data = calculator(initialData);\r\n\r\n const yLabel = `SD(${options.windowSize}):`;\r\n const stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yAccesssor = (d: any) => {\r\n try {\r\n const val = d && d.Aroon ? d.Aroon.os : void 0;\r\n return val;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n return undefined;\r\n };\r\n\r\n\r\n const auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { cv, CV_DefaultOptions } from '../addingIndicator/cv';\r\n\r\nexport function cvBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = CV_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n options.rateOfChange = settings.args.get(\"rateOfChange\")?.value as number;\r\n const calculator = cv()\r\n .options(options)\r\n .accessor((d: any) => d.cv);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `CV(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { cmo, CMO_DefaultOptions } from '../addingIndicator/cmo';\r\n\r\nexport function cmoBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = CMO_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = cmo()\r\n .options(options)\r\n .accessor((d: any) => d.cmo);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `CMO(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { cci, CCI_DefaultOptions } from '../addingIndicator/cci';\r\n\r\nexport function cciBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = CCI_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = cci()\r\n .options(options)\r\n .accessor((d: any) => d.cci);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `CCI(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { dpo, DPO_DefaultOptions } from '../addingIndicator/dpo';\r\n\r\nexport function dpoBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = DPO_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = dpo()\r\n .options(options)\r\n .accessor((d: any) => d.dpo);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `DPO(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { fco, FCO_DefaultOptions } from '../addingIndicator/fco';\r\n\r\nexport function fcoBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = FCO_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = fco()\r\n .options(options)\r\n .accessor((d: any) => d.fco);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `FCO(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { mo, MO_DefaultOptions } from '../addingIndicator/mo';\r\n\r\nexport function moBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = MO_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = mo()\r\n .options(options)\r\n .accessor((d: any) => d.mo);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `MO(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { po, PO_DefaultOptions } from '../addingIndicator/po';\r\n\r\nexport function poBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = PO_DefaultOptions;\r\n options.longCycle = settings.args.get(\"longCycle\")?.value as number;\r\n options.shortCycle = settings.args.get(\"shortCycle\")?.value as number;\r\n const calculator = po()\r\n .options(options)\r\n .accessor((d: any) => d.po);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `PO(${options.shortCycle},${options.longCycle}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { ro, RO_DefaultOptions } from '../addingIndicator/ro';\r\n\r\nexport function roBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = RO_DefaultOptions;\r\n options.Levels = settings.args.get(\"Levels\")?.value as number;\r\n const calculator = ro()\r\n .options(options)\r\n .accessor((d: any) => d.ro);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `RO(${options.Levels}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { TRIX, TRIX_DefaultOptions } from '../addingIndicator/TRIX';\r\n\r\nexport function TRIXBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = TRIX_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = TRIX()\r\n .options(options)\r\n .accessor((d: any) => d.TRIX);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `TRIX(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { tr } from '../addingIndicator/tr';\r\n\r\nexport function trBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const calculator = tr()\r\n .accessor((d: any) => d.tr);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let strokes = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = \"TR:\";\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { uo, UO_DefaultOptions } from '../addingIndicator/uo';\r\n\r\nexport function uoBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = UO_DefaultOptions;\r\n options.Cycle1 = settings.args.get(\"Cycle1\")?.value as number;\r\n options.Cycle2 = settings.args.get(\"Cycle2\")?.value as number;\r\n options.Cycle3 = settings.args.get(\"Cycle3\")?.value as number;\r\n const calculator = uo()\r\n .options(options)\r\n .accessor((d: any) => d.uo);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `UO(${options.Cycle1, options.Cycle2, options.Cycle3}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { vhf, VHF_DefaultOptions } from '../addingIndicator/vhf';\r\n\r\nexport function vhfBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = VHF_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = vhf()\r\n .options(options)\r\n .accessor((d: any) => d.vhf);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `VHF(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { wad } from '../addingIndicator/wad';\r\n\r\nexport function wadBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const calculator = wad()\r\n .accessor((d: any) => d.wad);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `WAD:`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { wr, WR_DefaultOptions } from '../addingIndicator/wr';\r\n\r\nexport function wrBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = WR_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = wr()\r\n .options(options)\r\n .accessor((d: any) => d.wr);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `W&R(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { asi } from '../addingIndicator/asi';\r\nimport { SI_DefaultOptions } from '../addingIndicator/si';\r\n\r\nexport function asiBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = SI_DefaultOptions;\r\n options.LimitMoveValue = settings.args.get(\"LimitMoveValue\")?.value as number;\r\n const calculator = asi()\r\n .options(options)\r\n .accessor((d: any) => d.asi);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `ASI(${options.LimitMoveValue}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { lrrs, LRRS_DefaultOptions } from '../addingIndicator/lrrs';\r\n\r\nexport function lrrsBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = LRRS_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = lrrs()\r\n .options(options)\r\n .accessor((d: any) => d.lrrs);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let strokes = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `LRRS(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { lrs, LRS_DefaultOptions } from '../addingIndicator/lrs';\r\n\r\nexport function lrsBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = LRS_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = lrs()\r\n .options(options)\r\n .accessor((d: any) => d.lrs);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let strokes = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `LRS(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { mi, MI_DefaultOptions } from '../addingIndicator/mi';\r\n\r\nexport function miBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = MI_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = mi()\r\n .options(options)\r\n .accessor((d: any) => d.mi);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `MI(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { pi, PI_DefaultOptions } from '../addingIndicator/pi';\r\n\r\nexport function piBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = PI_DefaultOptions;\r\n const calculator = pi()\r\n .options(options)\r\n .accessor((d: any) => d.pi);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let strokes = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `PI:`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import React from 'react';\r\nimport {\r\n Chart,\r\n XAxis,\r\n YAxis,\r\n MouseCoordinateX,\r\n LineSeries,\r\n SingleValueTooltip\r\n} from \"react-financial-charts\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport { IOHLCData } from '../../data';\r\nimport { IIndicatorSettings } from \"../../typeDefine\";\r\nimport { format } from \"d3-format\";\r\nimport { proc, PROC_DefaultOptions } from '../addingIndicator/proc';\r\n\r\nexport function procBuilder(initialData: IOHLCData[], auxHeight: number, settings: IIndicatorSettings, axisProps: object) {\r\n const timeDisplayFormat = timeFormat(\"%d %b\");\r\n const options = PROC_DefaultOptions;\r\n options.windowSize = settings.args.get(\"windowSize\")?.value as number;\r\n const calculator = proc()\r\n .options(options)\r\n .accessor((d: any) => d.proc);\r\n const origin = (_: number, h: number) => [0, h - auxHeight];\r\n let data = calculator(initialData);\r\n\r\n let stroke = settings.lineSettings.entries()[0].value.color;\r\n\r\n const yLabel = `PROC(${options.windowSize}):`;\r\n\r\n let auxElement = (\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n );\r\n\r\n return [data, auxElement];\r\n}","import { GenericChartComponent } from \"@react-financial-charts/core\";\r\nimport React from \"react\";\r\nimport { timeFormater } from './typeDefine'\r\n\r\ninterface IEventsDispatcherProps{\r\n readonly onCurrentBarChanged: (barDatas: any) => void;\r\n readonly onGetMoreData: (endTime: Date, xExtents: number[]) => void;\r\n}\r\ninterface IEventsDispatcherState{\r\n readonly barIndex: number;\r\n}\r\n\r\nexport class EventDispatcher extends React.Component {\r\n\r\n private barIndex: number;\r\n constructor(props: IEventsDispatcherProps){\r\n super(props);\r\n // this.state = {barIndex: -1}; // render() will called after each this.setState, so change to using class private member.\r\n this.barIndex = -1;\r\n }\r\n\r\n private readonly onPanEnd = (e: any, moreProps: any) => {\r\n const { fullData, plotData, xAccessor } = moreProps;\r\n //const firstItem = fullData.find(el => el.date === plotData[0].date);\r\n const startIndex = xAccessor(plotData[0]);\r\n const endIndex = xAccessor(plotData[plotData.length - 1]);\r\n if (startIndex < 500) {\r\n console.log(`EventsDispatcher call onGetMoreData time=[${timeFormater(fullData[0].date)}]`);\r\n this.props.onGetMoreData(fullData[0].date, [startIndex, endIndex]);\r\n }\r\n}\r\n private readonly onMouseMove = (e: any, moreProps: any) => {\r\n if (moreProps.currentItem && moreProps.currentItem.idx) {\r\n let index = moreProps.currentItem.idx.index;\r\n if (this.barIndex != index) { // performance optimization\r\n // this.setState({ barIndex: index });\r\n this.barIndex = index;\r\n // console.log(\"TooltipHelper call onCurrentBarChanged\");\r\n this.props.onCurrentBarChanged(moreProps.currentItem); // currentItem: current data item, should include all indicator's current data value.\r\n }\r\n }\r\n }\r\n\r\n public render() {\r\n // console.log(\"before render TooltipHelper\");\r\n //return ;\r\n return ;\r\n }\r\n\r\n // private readonly renderSVG = (drawProps: any) => {\r\n // // debugger;\r\n // if (drawProps.currentItem && drawProps.currentItem.idx) {\r\n // let index = drawProps.currentItem.idx.index;\r\n // if (this.barIndex != index) { // performance optimization\r\n // // this.setState({ barIndex: index });\r\n // this.barIndex = index;\r\n // console.log(\"TooltipHelper call onCurrentBarChanged\");\r\n // this.props.onCurrentBarChanged(drawProps.currentItem); // currentItem: current data item, should include all indicator's current data value.\r\n\r\n // const { fullData, plotData } = drawProps;\r\n // if (fullData.indexOf(plotData[0]) < 500) {\r\n // this.props.onGetMoreData(plotData[0].date);\r\n // }\r\n // }\r\n // }\r\n // return (<>);\r\n // };\r\n}\r\n","import exp from \"constants\";\r\n\r\nexport function getForeColor(theme: string) {\r\n return theme === \"white\" ? \"#000\" : \"#fff\";\r\n}\r\n\r\nexport function getToolbarbackColor(theme: string) {\r\n return theme === \"white\" ? \"#e0e0e0\" : \"#131722\";\r\n}\r\n\r\nexport function getOHLCTooltipTextColor(theme: string) {\r\n return theme === \"white\" ? \"#333\" : \"#eee\";\r\n}\r\n\r\nexport function getThemedAxisProps(theme: string) {\r\n let props = theme === \"white\" ? {} : { strokeStyle: \"white\", tickStrokeStyle: \"white\", tickLabelFill: \"white\", gridLinesStrokeStyle: \"white\" };\r\n return { gridLinesStrokeWidth: 0.2, strokeWidth: 0.8, ...props };\r\n}\r\n\r\n// binan base version:\r\n// export const bearColor = \"#F6465D\"\r\n// export const bullColor = \"#0ECB81\"\r\n\r\nexport const bullColor = \"#26a69a\";\r\nexport const bearColor = \"#ef5350\";\r\n\r\nexport function getChartColor(open: number, close: number) {\r\n return close > open ? bullColor : bearColor;\r\n}","import { GenericChartComponent } from \"@react-financial-charts/core\";\r\nimport React from \"react\";\r\nimport * as PropTypes from \"prop-types\";\r\nimport { first, last } from \"@react-financial-charts/core\";\r\nimport { interpolateNumber } from \"d3-interpolate\";\r\nimport { TEventBus } from \"./chartContext\";\r\n\r\nconst drawOnCanvas = (\r\n ctx: CanvasRenderingContext2D,\r\n props: ZoomHintProps,\r\n context: any,\r\n centerX: number[],\r\n barWidth: any,\r\n height: number,\r\n beginY: number,\r\n mouseY: number,\r\n) => {\r\n const { margin, ratio } = context;\r\n const { background } = props;\r\n\r\n const originX = 0.5 * ratio + margin.left;\r\n const originY = 0.5 * ratio + margin.top;\r\n\r\n ctx.save();\r\n\r\n ctx.setTransform(1, 0, 0, 1, 0, 0);\r\n ctx.scale(ratio, ratio);\r\n\r\n ctx.translate(originX, originY);\r\n\r\n\r\n if (background?.fillStyle !== undefined) {\r\n ctx.fillStyle = background.fillStyle;\r\n ctx.strokeStyle = '#155BAA';\r\n }\r\n ctx.beginPath();\r\n\r\n const [pos1, pos2] = centerX;\r\n if (pos2) {\r\n // ctx.rect(pos1, 0, pos2 - pos1, height);\r\n ctx.rect(pos1, beginY, pos2 - pos1, mouseY-beginY);\r\n }\r\n else {\r\n ctx.rect(centerX[0] - barWidth / 2, 0, barWidth, height); \r\n }\r\n ctx.fill();\r\n ctx.stroke();\r\n\r\n ctx.restore();\r\n};\r\n\r\ninterface IZoomHintState{\r\n readonly isInZoomIn: boolean;\r\n readonly beginBarIndex?: number;\r\n readonly beginY?: number;\r\n}\r\n\r\nexport interface ZoomHintProps {\r\n readonly background?: {\r\n fillStyle?: string;\r\n // height?: number;\r\n strokeStyle?: string;\r\n // width?: number;\r\n };\r\n // readonly chartId?: number | string;\r\n // readonly origin?: (\r\n // props: ZoomHintProps,\r\n // moreProps: any,\r\n // bgSize: { width: number; height: number },\r\n // pointWidth: number,\r\n // ) => [number, number];\r\n readonly zoomMultiplier: number;\r\n readonly zoomInStateChanged: (inZoomIn: boolean) => void;\r\n readonly eventBus: TEventBus;\r\n}\r\n\r\nexport class ZoomHelper extends React.Component {\r\n public static defaultProps = {\r\n background: {\r\n fillStyle: \"rgba(33, 148, 243, 0.2)\",\r\n strokeStyle: \"#155BAA\",\r\n },\r\n zoomMultiplier: 1.5,\r\n };\r\n\r\n public static contextTypes = {\r\n margin: PropTypes.object.isRequired,\r\n ratio: PropTypes.number.isRequired,\r\n\r\n xAxisZoom: PropTypes.func.isRequired,\r\n xScale: PropTypes.func.isRequired,\r\n plotData: PropTypes.array.isRequired,\r\n fullData: PropTypes.array.isRequired,\r\n xAccessor: PropTypes.func.isRequired,\r\n chartConfig: PropTypes.object.isRequired,\r\n };\r\n\r\n private interval?: number;\r\n private zoomRangeStack: number[][];\r\n\r\n constructor(props: ZoomHintProps) {\r\n super(props);\r\n this.state = { isInZoomIn: false, beginBarIndex: undefined, beginY: undefined };\r\n this.zoomRangeStack = [];\r\n\r\n // console.log(\"eventBus\", props.eventBus);\r\n props.eventBus?.on(\"cmd.zoom_out\", this.zoomOut);\r\n props.eventBus?.on(\"cmd.begin_zoomin\", this.beginZoomIn);\r\n props.eventBus?.on(\"cmd.stop_zoomin\", this.stopZoomIn);\r\n }\r\n\r\n private readonly beginZoomIn = () => {\r\n this.setState({ isInZoomIn: true });\r\n this.props.zoomInStateChanged(true);\r\n }\r\n\r\n private readonly stopZoomIn = () => {\r\n this.setState({ isInZoomIn: false, beginBarIndex: undefined });\r\n this.props.zoomInStateChanged(false);\r\n }\r\n\r\n // private readonly resetZoomlevel = () => {\r\n // this.setState({ isInZoomIn: false, beginBarIndex: undefined });\r\n // }\r\n private readonly onClick = (e: any, moreProps: any) => {\r\n if (this.state.isInZoomIn && moreProps.currentItem) {\r\n const { currentItem, xAccessor } = moreProps;\r\n const xValue = xAccessor(currentItem);\r\n if (!this.state.beginBarIndex) {\r\n this.setState({ beginBarIndex: xValue, beginY: moreProps.mouseXY[1] });\r\n }\r\n else {\r\n this.zoomIn(xValue, moreProps);\r\n this.stopZoomIn();\r\n this.props.eventBus?.emit(\"cmd.zoomin_finish\");\r\n }\r\n }\r\n }\r\n\r\n public render() {\r\n return ;\r\n }\r\n\r\n private readonly drawOnCanvas = (ctx: CanvasRenderingContext2D, moreProps: any) => {\r\n if (this.state.isInZoomIn) {\r\n const pointer = this.helper(ctx, moreProps);\r\n if (pointer) {\r\n const { height, xScale } = moreProps;\r\n let centerX: number[] = [];\r\n if (this.state.beginBarIndex) {\r\n centerX.push(xScale(this.state.beginBarIndex));\r\n }\r\n centerX.push(pointer.centerX);\r\n drawOnCanvas(ctx, this.props, this.context, centerX, pointer.pointWidth, height, this.state.beginY as number, moreProps.mouseXY[1]);\r\n }\r\n }\r\n };\r\n\r\n private readonly helper = (ctx: CanvasRenderingContext2D, moreProps: any) => {\r\n const { show, xScale, currentItem, plotData, xAccessor } = moreProps;\r\n\r\n if (!show || currentItem === undefined) {\r\n return;\r\n }\r\n\r\n const xValue = xAccessor(currentItem);\r\n if (xValue === undefined) {\r\n return;\r\n }\r\n\r\n const centerX = xScale(xValue);\r\n const pointWidth =\r\n Math.abs(xScale(xAccessor(last(plotData))) - xScale(xAccessor(first(plotData)))) / (plotData.length - 1);\r\n\r\n return { centerX, pointWidth };\r\n };\r\n\r\n private readonly zoomIn = (endIndex: number, moreProps: any) => {\r\n const { xScale } = moreProps;\r\n const { xAxisZoom } = this.context;\r\n\r\n let [start, end] = xScale.domain();\r\n start = Math.round(start);\r\n end = Math.round(end);\r\n let newStart = this.state.beginBarIndex as number;\r\n let newEnd = endIndex;\r\n if (newEnd < newStart) {\r\n let temp = newEnd;\r\n newEnd = newStart;\r\n newStart = temp;\r\n }\r\n if (start === newStart && end === newEnd) {\r\n return;\r\n }\r\n\r\n let pushOldRange = true;\r\n if (this.zoomRangeStack.length > 0) {\r\n var lastRange = this.zoomRangeStack[this.zoomRangeStack.length - 1];\r\n if (lastRange[0] === start && lastRange[1] === end) {\r\n pushOldRange = false;\r\n }\r\n }\r\n if (pushOldRange) {\r\n this.zoomRangeStack.push([start, end]);\r\n }\r\n this.zoomRangeStack.push([newStart, newEnd]);\r\n\r\n let foo: any = [[newStart, newEnd]];\r\n if (moreProps.fullData.length < 5000) {\r\n const left = interpolateNumber(start, newStart);\r\n const right = interpolateNumber(end, newEnd);\r\n foo = [0.25, 0.3, 0.5, 0.6, 0.75, 1].map((i) => {\r\n return [left(i), right(i)];\r\n });\r\n }\r\n\r\n // console.log(\"zoomIn\", foo);\r\n this.interval = window.setInterval(() => {\r\n if (foo.length === 0) {\r\n clearInterval(this.interval);\r\n delete this.interval;\r\n }\r\n else {\r\n xAxisZoom(foo.shift());\r\n }\r\n }, 10);\r\n };\r\n\r\n private readonly zoomOut = () => {\r\n console.log(\"ZOOMOUT STARTED\");\r\n if (this.interval)\r\n return;\r\n\r\n if (!this.context)\r\n return;\r\n\r\n const { xAxisZoom, xScale, plotData, fullData, xAccessor, chartConfig: { width, height } } = this.context;\r\n const cx = xScale(xAccessor(last(plotData)));\r\n const { zoomMultiplier } = this.props;\r\n const c = zoomMultiplier;\r\n\r\n let [start, end] = xScale.domain();\r\n start = Math.round(start);\r\n end = Math.round(end);\r\n let newStart: number = 0;\r\n let newEnd: number = 0;\r\n let gotRange: boolean = false;\r\n\r\n // console.log(\"ZOOMOUT\", {start, end, stack:this.zoomRangeStack});\r\n if (this.zoomRangeStack.length > 0) {\r\n [newStart, newEnd] = this.zoomRangeStack.pop() as number[];\r\n if (start === newStart && end === newEnd) {\r\n if (this.zoomRangeStack.length > 0) {\r\n [newStart, newEnd] = this.zoomRangeStack.pop() as number[];\r\n gotRange = true;\r\n }\r\n }\r\n }\r\n if (!gotRange) {\r\n [newStart, newEnd] = xScale\r\n .range()\r\n .map((x: number) => cx + (x - cx) * c)\r\n .map(xScale.invert);\r\n\r\n if (newStart < 0) {\r\n newEnd -= newStart;\r\n newStart = 0;\r\n }\r\n }\r\n // console.log(\"ZOOMOUT\", {gotRange, newStart, newEnd});\r\n \r\n let foo: any = [[newStart, newEnd]];\r\n if (fullData.length < 5000) {\r\n const left = interpolateNumber(start, newStart);\r\n const right = interpolateNumber(end, newEnd);\r\n foo = [0.25, 0.3, 0.5, 0.6, 0.75, 1].map((i) => {\r\n return [left(i), right(i)];\r\n });\r\n }\r\n\r\n this.interval = window.setInterval(() => {\r\n if (foo.length === 0) {\r\n clearInterval(this.interval);\r\n delete this.interval;\r\n }\r\n else {\r\n xAxisZoom(foo.shift());\r\n }\r\n }, 10);\r\n };\r\n}\r\n","import { select } from \"d3-selection\";\r\nimport * as PropTypes from \"prop-types\";\r\nimport * as React from \"react\";\r\nimport { getForeColor } from \"./theme\";\r\n\r\nexport interface ChartSplitterProps {\r\n readonly id: number | string;\r\n readonly height?: number;\r\n readonly onContextMenu?: (event: React.MouseEvent, moreProps: any) => void;\r\n readonly onDoubleClick?: (event: React.MouseEvent, moreProps: any) => void;\r\n readonly origin?: number[] | ((width: number, height: number) => number[]);\r\n\r\n readonly yExtents?: number[] | ((data: any) => number) | ((data: any) => number[]);\r\n readonly onResize: (dy: number) => void;\r\n readonly theme: string;\r\n}\r\n\r\nexport const MOUSEMOVE = \"mousemove.vsplit\";\r\nexport const MOUSEUP = \"mouseup.vsplit\";\r\nexport const TOUCHMOVE = \"touchmove.vsplit\";\r\nexport const TOUCHEND = \"touchend.vsplit touchcancel.vsplit\";\r\n\r\nexport class ChartSplitter extends React.Component {\r\n public static defaultProps = {\r\n id: 0,\r\n origin: [0, 0],\r\n };\r\n\r\n public static contextTypes = {\r\n chartConfig: PropTypes.array,\r\n xScale: PropTypes.func.isRequired,\r\n };\r\n\r\n private touchCurrentY: number = 0;\r\n\r\n public render() {\r\n const width = this.context.xScale.range()[1];\r\n const { origin } = this.context.chartConfig.find(({ id }: any) => id === this.props.id);\r\n\r\n const [x, y] = origin;\r\n\r\n const height = this.props.height ?? 4;\r\n const lineY = height / 2;\r\n const foreColor = getForeColor(this.props.theme);\r\n\r\n return \r\n {/* \r\n */}\r\n\r\n \r\n \r\n \r\n ;\r\n }\r\n private handleTouchStart = (e: React.TouchEvent) => {\r\n this.touchCurrentY = e.touches[0].screenY;\r\n // @ts-ignore\r\n const win = e.target.ownerDocument.defaultView;\r\n select(win).on(TOUCHMOVE, this.handleTouchMove).on(TOUCHEND, this.handleTouchEnd);\r\n // console.log(\"handleTouchStart startY:\" + this.touchCurrentY);\r\n }\r\n\r\n private handleTouchMove = (e: React.TouchEvent) => {\r\n const newY = e.touches[0].screenY;\r\n const movementY = newY - this.touchCurrentY;\r\n this.touchCurrentY = newY;\r\n this.props.onResize(movementY);\r\n // console.log(\"handleTouchMove movementY:\" + movementY, newY);\r\n }\r\n\r\n private handleTouchEnd = (e: React.TouchEvent) => {\r\n // @ts-ignore\r\n const win = e.target.ownerDocument.defaultView;\r\n select(win).on(TOUCHMOVE, null).on(TOUCHEND, null);\r\n } \r\n\r\n private handleMouseDown = (e: React.MouseEvent) => {\r\n if (e.buttons === 1) {\r\n // @ts-ignore\r\n const win = e.target.ownerDocument.defaultView;\r\n select(win).on(MOUSEMOVE, this.resize).on(MOUSEUP, this.endResize);\r\n }\r\n }\r\n private endResize = (e: React.MouseEvent) => {\r\n // @ts-ignore\r\n const win = e.target.ownerDocument.defaultView;\r\n select(win).on(MOUSEMOVE, null).on(MOUSEUP, null);\r\n }\r\n \r\n private resize = (e: React.MouseEvent) => {\r\n if (e.buttons === 1) {\r\n this.props.onResize(e.movementY);\r\n }\r\n }\r\n}\r\n","import * as React from \"react\";\r\n\r\nimport { getStrokeDasharray, getStrokeDasharrayCanvas, isDefined } from \"@react-financial-charts/core\";\r\n\r\n// export const renderSVG = (props: any) => {\r\n// const { className } = props;\r\n\r\n// const edge = helper(props);\r\n// if (edge === null) {\r\n// return null;\r\n// }\r\n\r\n// let line;\r\n// let coordinateBase;\r\n// let coordinate;\r\n\r\n// if (edge.line !== undefined) {\r\n// line = (\r\n// \r\n// );\r\n// }\r\n// if (edge.coordinate !== undefined && edge.coordinateBase !== undefined) {\r\n// const { rectWidth, rectHeight, arrowWidth } = edge.coordinateBase;\r\n\r\n// const path =\r\n// edge.orient === \"left\"\r\n// ? `M0,0L0,${rectHeight}L${rectWidth},${rectHeight}L${rectWidth + arrowWidth},10L${rectWidth},0L0,0L0,0`\r\n// : `M0,${arrowWidth}L${arrowWidth},${rectHeight}L${rectWidth + arrowWidth},${rectHeight}L${\r\n// rectWidth + arrowWidth\r\n// },0L${arrowWidth},0L0,${arrowWidth}`;\r\n\r\n// coordinateBase =\r\n// edge.orient === \"left\" || edge.orient === \"right\" ? (\r\n// \r\n// \r\n// \r\n// ) : (\r\n// \r\n// );\r\n\r\n// coordinate = (\r\n// \r\n// {edge.coordinate.displayCoordinate}\r\n// \r\n// );\r\n// }\r\n// return (\r\n// \r\n// {line}\r\n// {coordinateBase}\r\n// {coordinate}\r\n// \r\n// );\r\n// };\r\n\r\nconst helper = (props: any) => {\r\n const {\r\n coordinate: displayCoordinate,\r\n show,\r\n type,\r\n orient,\r\n edgeAt,\r\n hideLine,\r\n lineStrokeDasharray,\r\n fill,\r\n fontFamily,\r\n fontSize,\r\n textFill,\r\n lineStroke,\r\n stroke,\r\n strokeWidth,\r\n arrowWidth,\r\n rectWidth,\r\n rectHeight,\r\n rectRadius,\r\n x1,\r\n y1,\r\n x2,\r\n y2,\r\n dx,\r\n } = props;\r\n\r\n if (!show) {\r\n return null;\r\n }\r\n\r\n let coordinateBase;\r\n let coordinate;\r\n if (displayCoordinate !== undefined) {\r\n const textAnchor = \"middle\";\r\n\r\n let edgeXRect;\r\n let edgeYRect;\r\n let edgeXText;\r\n let edgeYText;\r\n\r\n if (type === \"horizontal\") {\r\n edgeXRect = dx + (orient === \"right\" ? edgeAt + 1 : edgeAt - rectWidth - 1);\r\n edgeYRect = y1 - rectHeight / 2 - strokeWidth;\r\n edgeXText = dx + (orient === \"right\" ? edgeAt + rectWidth / 2 : edgeAt - rectWidth / 2);\r\n edgeYText = y1;\r\n } else {\r\n const dy = orient === \"bottom\" ? strokeWidth - 1 : -strokeWidth + 1;\r\n edgeXRect = x1 - rectWidth / 2;\r\n edgeYRect = (orient === \"bottom\" ? edgeAt : edgeAt - rectHeight) + dy;\r\n edgeXText = x1;\r\n edgeYText = (orient === \"bottom\" ? edgeAt + rectHeight / 2 : edgeAt - rectHeight / 2) + dy;\r\n }\r\n\r\n coordinateBase = {\r\n edgeXRect,\r\n edgeYRect,\r\n rectHeight: rectHeight + strokeWidth,\r\n rectWidth,\r\n rectRadius,\r\n fill,\r\n arrowWidth,\r\n stroke,\r\n strokeWidth,\r\n };\r\n coordinate = {\r\n edgeXText,\r\n edgeYText,\r\n textAnchor,\r\n fontFamily,\r\n fontSize,\r\n textFill,\r\n displayCoordinate,\r\n };\r\n }\r\n\r\n const line = hideLine\r\n ? undefined\r\n : {\r\n stroke: lineStroke,\r\n strokeDasharray: lineStrokeDasharray,\r\n x1,\r\n y1,\r\n x2,\r\n y2,\r\n };\r\n\r\n return {\r\n coordinateBase,\r\n coordinate,\r\n line,\r\n orient,\r\n };\r\n};\r\n\r\nexport const drawOnCanvas = (ctx: CanvasRenderingContext2D, props: any) => {\r\n const { coordinate, fitToText, fontSize, fontFamily, rectWidth } = props;\r\n\r\n ctx.font = `${fontSize}px ${fontFamily}`;\r\n ctx.textBaseline = \"middle\";\r\n\r\n let width = rectWidth;\r\n if (fitToText) {\r\n width = Math.round(ctx.measureText(coordinate).width + 10);\r\n }\r\n\r\n const edge = helper({ ...props, rectWidth: width });\r\n if (edge === null) {\r\n return;\r\n }\r\n\r\n if (edge.line !== undefined && isDefined(edge.line)) {\r\n const dashArray = getStrokeDasharrayCanvas(edge.line.strokeDasharray);\r\n ctx.setLineDash(dashArray);\r\n ctx.strokeStyle = edge.line.stroke;\r\n ctx.lineWidth = 1;\r\n ctx.beginPath();\r\n ctx.moveTo(edge.line.x1, edge.line.y1);\r\n ctx.lineTo(edge.line.x2, edge.line.y2);\r\n ctx.stroke();\r\n }\r\n\r\n ctx.setLineDash([]);\r\n\r\n if (edge.coordinateBase !== undefined) {\r\n const { arrowWidth, rectWidth, rectHeight, rectRadius } = edge.coordinateBase;\r\n\r\n ctx.fillStyle = edge.coordinateBase.fill;\r\n if (edge.coordinateBase.stroke !== undefined) {\r\n ctx.strokeStyle = edge.coordinateBase.stroke;\r\n ctx.lineWidth = edge.coordinateBase.strokeWidth;\r\n }\r\n\r\n let x = edge.coordinateBase.edgeXRect;\r\n const y = edge.coordinateBase.edgeYRect;\r\n const halfHeight = rectHeight / 2;\r\n\r\n ctx.beginPath();\r\n\r\n if (arrowWidth > 0 && edge.orient === \"right\") {\r\n x -= arrowWidth;\r\n ctx.moveTo(x, y + halfHeight);\r\n ctx.lineTo(x + arrowWidth, y);\r\n ctx.lineTo(x + rectWidth + arrowWidth, y);\r\n ctx.lineTo(x + rectWidth + arrowWidth, y + rectHeight);\r\n ctx.lineTo(x + arrowWidth, y + rectHeight);\r\n ctx.closePath();\r\n } else if (arrowWidth > 0 && edge.orient === \"left\") {\r\n ctx.moveTo(x, y);\r\n ctx.lineTo(x + rectWidth, y);\r\n ctx.lineTo(x + rectWidth + arrowWidth, y + halfHeight);\r\n ctx.lineTo(x + rectWidth, y + rectHeight);\r\n ctx.lineTo(x, y + rectHeight);\r\n ctx.closePath();\r\n } else if (rectRadius) {\r\n roundRect(ctx, x - 0.5, y - 0.5, rectWidth, rectHeight, 3);\r\n } else {\r\n ctx.rect(x - 0.5, y, rectWidth, rectHeight);\r\n }\r\n\r\n ctx.fill();\r\n\r\n if (edge.coordinateBase.stroke !== undefined) {\r\n ctx.stroke();\r\n }\r\n\r\n if (edge.coordinate !== undefined) {\r\n ctx.fillStyle = edge.coordinate.textFill;\r\n ctx.textAlign =\r\n edge.coordinate.textAnchor === \"middle\" ? \"center\" : (edge.coordinate.textAnchor as CanvasTextAlign);\r\n ctx.fillText(edge.coordinate.displayCoordinate, edge.coordinate.edgeXText, edge.coordinate.edgeYText);\r\n }\r\n }\r\n};\r\n\r\nconst roundRect = (\r\n ctx: CanvasRenderingContext2D,\r\n x: number,\r\n y: number,\r\n width: number,\r\n height: number,\r\n radius: number,\r\n) => {\r\n ctx.beginPath();\r\n ctx.moveTo(x + radius, y);\r\n ctx.lineTo(x + width - radius, y);\r\n ctx.quadraticCurveTo(x + width, y, x + width, y + radius);\r\n ctx.lineTo(x + width, y + height - radius);\r\n ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\r\n ctx.lineTo(x + radius, y + height);\r\n ctx.quadraticCurveTo(x, y + height, x, y + height - radius);\r\n ctx.lineTo(x, y + radius);\r\n ctx.quadraticCurveTo(x, y, x + radius, y);\r\n ctx.closePath();\r\n};\r\n","import { format } from \"d3-format\";\r\nimport * as React from \"react\";\r\nimport {\r\n first,\r\n functor,\r\n getAxisCanvas,\r\n GenericChartComponent,\r\n last,\r\n noop,\r\n strokeDashTypes,\r\n} from \"@react-financial-charts/core\";\r\nimport { drawOnCanvas } from \"./EdgeHelper\";\r\nimport { bearColor, bullColor } from \"../theme\";\r\n\r\n\r\nexport interface BaEdgeIndicatorProps {\r\n readonly arrowWidth?: number;\r\n readonly displayFormat?: (n: number) => string;\r\n readonly edgeAt?: \"left\" | \"right\";\r\n readonly fill?: string | ((datum: any) => string);\r\n readonly fitToText?: boolean;\r\n readonly fontFamily?: string;\r\n readonly fontSize?: number;\r\n readonly fullWidth?: boolean;\r\n readonly itemType: \"first\" | \"last\";\r\n readonly lineStroke?: string | ((datum: any) => string);\r\n readonly lineStrokeDasharray?: strokeDashTypes;\r\n readonly orient?: \"left\" | \"right\";\r\n readonly rectHeight?: number;\r\n readonly rectWidth?: number;\r\n readonly stroke?: string | ((datum: any) => string);\r\n readonly textFill?: string | ((datum: any) => string);\r\n readonly type?: \"horizontal\";\r\n readonly yAccessor: (data: any) => number | undefined;\r\n readonly yAxisPad?: number;\r\n readonly ask?: number;\r\n}\r\n\r\nexport class BaEdgeIndicator extends React.Component {\r\n public static defaultProps = {\r\n fitToText: false,\r\n lineStroke: \"#000000\",\r\n lineOpacity: 1,\r\n lineStrokeDasharray: \"ShortDot\",\r\n orient: \"right\",\r\n displayFormat: format(\".2f\"),\r\n edgeAt: \"right\",\r\n yAxisPad: 0,\r\n rectHeight: 20,\r\n rectWidth: 50,\r\n arrowWidth: 0,\r\n fontFamily: \"-apple-system, system-ui, Roboto, 'Helvetica Neue', Ubuntu, sans-serif\",\r\n fontSize: 13,\r\n dx: 0,\r\n hideLine: false,\r\n fill: \"#8a8a8a\",\r\n opacity: 1,\r\n stroke: noop,\r\n strokeOpacity: 1,\r\n strokeWidth: 1,\r\n textFill: \"#FFFFFF\",\r\n type: \"horizontal\",\r\n };\r\n\r\n public render() {\r\n return (\r\n \r\n );\r\n }\r\n\r\n private readonly drawOnCanvas = (ctx: CanvasRenderingContext2D, moreProps: any) => {\r\n const edge = this.helper(this.props, moreProps);\r\n if (edge === undefined) {\r\n return;\r\n }\r\n\r\n const props = {\r\n ...this.props,\r\n ...edge,\r\n };\r\n\r\n props.fill = bullColor;\r\n props.lineStroke = bullColor;\r\n\r\n drawOnCanvas(ctx, props);\r\n\r\n if (props.ask) {\r\n const { displayFormat = BaEdgeIndicator.defaultProps.displayFormat, } = this.props;\r\n props.coordinate = displayFormat(props.ask);\r\n props.y1 = props.y2 = edge.y_ask as number;\r\n props.fill = bearColor;\r\n props.lineStroke = bearColor;\r\n drawOnCanvas(ctx, props);\r\n }\r\n };\r\n\r\n private readonly helper = (props: BaEdgeIndicatorProps, moreProps: any) => {\r\n const { itemType, yAccessor } = props;\r\n\r\n const { plotData } = moreProps;\r\n\r\n const item = itemType === \"first\" ? first(plotData, yAccessor) : last(plotData, yAccessor);\r\n\r\n const edge = item !== undefined ? this.getEdge(moreProps, item, props.ask) : undefined;\r\n\r\n return edge;\r\n };\r\n\r\n private readonly getEdge = (moreProps: any, item: any, ask?: number) => {\r\n const {\r\n fontFamily,\r\n fontSize,\r\n type: edgeType,\r\n displayFormat = BaEdgeIndicator.defaultProps.displayFormat,\r\n edgeAt,\r\n yAxisPad = BaEdgeIndicator.defaultProps.yAxisPad,\r\n orient,\r\n lineStroke,\r\n yAccessor,\r\n fill,\r\n fullWidth,\r\n textFill,\r\n rectHeight,\r\n rectWidth,\r\n arrowWidth,\r\n stroke,\r\n } = this.props;\r\n\r\n const {\r\n xScale,\r\n chartConfig: { yScale },\r\n xAccessor,\r\n width,\r\n } = moreProps;\r\n\r\n const yValue = yAccessor(item);\r\n if (yValue === undefined) {\r\n return undefined;\r\n }\r\n\r\n const xValue = xAccessor(item);\r\n\r\n const x1 = fullWidth ? 0 : Math.round(xScale(xValue));\r\n const y1 = Math.round(yScale(yValue));\r\n\r\n const [left, right] = [0, width];\r\n const edgeX = edgeAt === \"left\" ? left - yAxisPad : right + yAxisPad;\r\n\r\n let y_ask: number | undefined;\r\n if (ask) {\r\n y_ask = yScale(ask);\r\n }\r\n return {\r\n coordinate: displayFormat(yValue),\r\n show: true,\r\n type: edgeType,\r\n orient,\r\n edgeAt: edgeX,\r\n fill: functor(fill)(item),\r\n lineStroke: functor(lineStroke)(item),\r\n stroke: functor(stroke)(item),\r\n fontFamily,\r\n fontSize,\r\n textFill: functor(textFill)(item),\r\n rectHeight,\r\n rectWidth,\r\n arrowWidth,\r\n x1,\r\n y1,\r\n x2: right,\r\n y2: y1,\r\n y_ask,\r\n };\r\n };\r\n}\r\n","import { IIndicatorSettings } from './typeDefine'\r\nimport { map as d3Map } from 'd3-collection'\r\n\r\ntype RawIndicatorSetting = Omit;\r\n\r\nconst MainIndicators = [\"MA\", \"BB\", \"SAR\", \"MAE\", \"WWS\"] as const;\r\nconst AuxIndicators = [\"MACD\", \"RSI\", \"STO\", \"ATR\", \"SD\",\r\n \"VIDYA\", \"AN\", \"AO\", \"CV\", \"CMO\", \"CCI\", \"DPO\", \"FCO\",\r\n \"MO\", \"PO\", \"RO\", \"TRIX\", \"TR\", \"UO\", \"VHF\", \"WAD\", \"WR\",\r\n \"SI\", \"ASI\", \"HML\", \"LRRS\", \"LRS\", \"MI\", \"PI\", \"PROC\"] as const;\r\n\r\ntype MainIndicatorNames = typeof MainIndicators[number];\r\ntype AuxIndicatorNames = typeof AuxIndicators[number];\r\n\r\ntype IMainIndicatorSettings = {\r\n [key in MainIndicatorNames]: RawIndicatorSetting;\r\n};\r\n\r\ntype IAuxIndicatorSettings = {\r\n [key in AuxIndicatorNames]: RawIndicatorSetting\r\n};\r\n\r\ninterface IMainSettingCategory extends IMainIndicatorSettings {\r\n [key: string]: RawIndicatorSetting\r\n}\r\n\r\ninterface IAuxSettingCategory extends IAuxIndicatorSettings {\r\n [key: string]: RawIndicatorSetting\r\n}\r\n\r\ninterface IDefaultSetings {\r\n main: IMainSettingCategory;\r\n aux: IAuxSettingCategory\r\n}\r\n\r\n// Main indicaotr settings\r\nconst MASettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n ma1: { decimals: 0, min: 1, value: 5 },\r\n ma2: { decimals: 0, min: 1, value: 10 },\r\n ma3: { decimals: 0, min: 1, value: 30 }\r\n }),\r\n lineSettings: d3Map({\r\n ma1: { color: \"#964B00\", width: 1 },\r\n ma2: { color: \"#673AB7\", width: 1 },\r\n ma3: { color: \"#00796B\", width: 1 }\r\n })\r\n}\r\nexport const BBSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 20 },\r\n multiplier: { decimals: 0, min: 1, value: 2 }\r\n }),\r\n lineSettings: d3Map({\r\n top: { color: \"#964B00\", width: 1 },\r\n middle: { color: \"yellow\", width: 1 },\r\n bottom: { color: \"#964B00\", width: 1 }\r\n })\r\n}\r\nconst SARSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n accelerationFactor: { decimals: 6, min: 0.000_001, value: 0.02 },\r\n maxAccelerationFactor: { decimals: 6, min: 0.000_001, value: 0.2 }\r\n }),\r\n lineSettings: d3Map({\r\n falling: { color: \"#964B00\", width: 1 },\r\n rising: { color: \"#00796B\", width: 1 }\r\n })\r\n}\r\n\r\n// Aux indicator settings\r\nconst MACDSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n fast: { decimals: 0, min: 1, value: 12 },\r\n slow: { decimals: 0, min: 1, value: 26 },\r\n signal: { decimals: 0, min: 1, value: 9 }\r\n }),\r\n lineSettings: d3Map({\r\n divergence: { color: \"#4682B4\", width: 1 },\r\n macd: { color: \"#0093FF\", width: 1 },\r\n signal: { color: \"#D84315\", width: 1 }\r\n })\r\n}\r\nconst RSISettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 14 }\r\n }),\r\n lineSettings: d3Map({\r\n top: { color: \"#B8C2CC\", width: 1 },\r\n middle: { color: \"#8795A1\", width: 1 },\r\n bottom: { color: \"#B8C2CC\", width: 1 },\r\n outsideThreshold: { color: \"#b300b3\", width: 1 },\r\n insideThreshold: { color: \"#ffccff\", width: 1 },\r\n })\r\n}\r\nconst STOSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 10 },\r\n k: { decimals: 0, min: 1, value: 10 },\r\n d: { decimals: 0, min: 1, value: 12 }\r\n }),\r\n lineSettings: d3Map({\r\n k: { color: \"#4682B4\", width: 1 },\r\n d: { color: \"#0093FF\", width: 1 }\r\n })\r\n}\r\nconst ATRSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 14 }\r\n }),\r\n lineSettings: d3Map({\r\n atr: { color: \"#0093FF\", width: 1 },\r\n })\r\n}\r\nconst MAESettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 10 },\r\n shift: { decimals: 6, min: 0.000_001, value: 0.05 },\r\n }),\r\n lineSettings: d3Map({\r\n upper: { color: \"#4682B4\", width: 1 },\r\n lower: { color: \"#0093FF\", width: 1 },\r\n fillStyle: { color: \"#4682B4\", width: 1_000 },\r\n })\r\n}\r\nconst WWSSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 14 },\r\n }),\r\n lineSettings: d3Map({\r\n wws: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst SDSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 7 },\r\n multiplier: { decimals: 0, min: 1, value: 2 },\r\n }),\r\n lineSettings: d3Map({\r\n sd: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst VIDYASettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 7 },\r\n R2Scale: { decimals: 6, min: 0.000_001, value: 0.65 },\r\n }),\r\n lineSettings: d3Map({\r\n VIDYA: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst ANSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 14 },\r\n }),\r\n lineSettings: d3Map({\r\n up: { color: \"red\", width: 1 },\r\n down: { color: \"green\", width: 1 },\r\n })\r\n}\r\nconst AOSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 3 },\r\n }),\r\n lineSettings: d3Map({\r\n ao: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst CVSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 14 },\r\n rateOfChange: { decimals: 0, min: 1, value: 2 },\r\n }),\r\n lineSettings: d3Map({\r\n sd: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst CMOSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 7 },\r\n }),\r\n lineSettings: d3Map({\r\n cmo: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst CCISettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 7 },\r\n }),\r\n lineSettings: d3Map({\r\n cci: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst DPOSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 14 },\r\n }),\r\n lineSettings: d3Map({\r\n dpo: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst FCOSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 14 },\r\n }),\r\n lineSettings: d3Map({\r\n fco: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst MOSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 7 },\r\n }),\r\n lineSettings: d3Map({\r\n cmo: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst POSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n longCycle: { decimals: 0, min: 1, value: 22 },\r\n shortCycle: { decimals: 0, min: 1, value: 14 },\r\n }),\r\n lineSettings: d3Map({\r\n po: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst ROSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n Levels: { decimals: 0, min: 1, value: 9 },\r\n }),\r\n lineSettings: d3Map({\r\n cmo: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst TRIXSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 7 },\r\n }),\r\n lineSettings: d3Map({\r\n cmo: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst TRSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n }),\r\n lineSettings: d3Map({\r\n tr: { color: \"#0093FF\", width: 1 },\r\n })\r\n}\r\nconst UOSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n Cycle1: { decimals: 0, min: 1, value: 7 },\r\n Cycle2: { decimals: 0, min: 1, value: 14 },\r\n Cycle3: { decimals: 0, min: 1, value: 28 },\r\n }),\r\n lineSettings: d3Map({\r\n uo: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst VHFSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 14 },\r\n }),\r\n lineSettings: d3Map({\r\n vhf: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst WADSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n }),\r\n lineSettings: d3Map({\r\n wad: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst WRSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 7 },\r\n }),\r\n lineSettings: d3Map({\r\n wr: { color: \"#0093FF\", width: 1 },\r\n })\r\n}\r\nconst SISettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n LimitMoveValue: { decimals: 0, min: 1, value: 12 },\r\n }),\r\n lineSettings: d3Map({\r\n si: { color: \"#0093FF\", width: 1 },\r\n })\r\n}\r\nconst ASISettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n LimitMoveValue: { decimals: 0, min: 1, value: 12 },\r\n }),\r\n lineSettings: d3Map({\r\n si: { color: \"#0093FF\", width: 1 },\r\n })\r\n}\r\nconst HMLSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n }),\r\n lineSettings: d3Map({\r\n hml: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst LRRSSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 14 },\r\n }),\r\n lineSettings: d3Map({\r\n lrrs: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst LRSSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 7 },\r\n }),\r\n lineSettings: d3Map({\r\n lrs: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst MISettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 8 },\r\n }),\r\n lineSettings: d3Map({\r\n mi: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst PISettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n }),\r\n lineSettings: d3Map({\r\n pi: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nconst PROCSettings: RawIndicatorSetting = {\r\n args: d3Map({\r\n windowSize: { decimals: 0, min: 1, value: 12 },\r\n }),\r\n lineSettings: d3Map({\r\n mi: { color: \"#4682B4\", width: 1 },\r\n })\r\n}\r\nexport const DefaultSetings: IDefaultSetings = {\r\n main: {\r\n MA: MASettings,\r\n BB: BBSettings,\r\n SAR: SARSettings,\r\n MAE: MAESettings,\r\n WWS: WWSSettings,\r\n },\r\n aux: {\r\n MACD: MACDSettings,\r\n RSI: RSISettings,\r\n STO: STOSettings,\r\n ATR: ATRSettings,\r\n SD: SDSettings,\r\n VIDYA: VIDYASettings,\r\n AN: ANSettings,\r\n AO: AOSettings,\r\n CV: CVSettings,\r\n CMO: CMOSettings,\r\n CCI: CCISettings,\r\n DPO: DPOSettings,\r\n FCO: FCOSettings,\r\n MO: MOSettings,\r\n PO: POSettings,\r\n RO: ROSettings,\r\n TRIX: TRIXSettings,\r\n TR: TRSettings,\r\n UO: UOSettings,\r\n VHF: VHFSettings,\r\n WAD: WADSettings,\r\n WR: WRSettings,\r\n SI: SISettings,\r\n ASI: ASISettings,\r\n HML: HMLSettings,\r\n LRRS: LRRSSettings,\r\n LRS: LRSSettings,\r\n MI: MISettings,\r\n PI: PISettings,\r\n PROC: PROCSettings,\r\n }\r\n} as const;\r\n\r\nexport function GetDefaultSettings(isMain: boolean, indName: string) {\r\n const rawSetting = isMain ? DefaultSetings.main[indName] : DefaultSetings.aux[indName];\r\n let settings: IIndicatorSettings = { indicatorName: indName, ...rawSetting };\r\n return settings;\r\n}","import React from 'react';\r\nimport {\r\n IChartConfig, IChartIndicatorSettings, IIndicatorSettings, actionType, IAction,\r\n IChangeIndiLineColorArgs, ILineSettings, IIndicatorArg, IInfoItem\r\n} from './typeDefine';\r\nimport { GetDefaultSettings } from './indicatorDefaultSettings'\r\nimport { Emitter, EventType } from 'mitt';\r\n\r\ntype TChartContext = React.Dispatch | null\r\nexport const ChartContext = React.createContext(null);\r\n\r\nexport const reducer = (state: IChartConfig, action: IAction) => {\r\n const { chartType, generalSettings, indictorsSettings } = state;\r\n const { mainIndictorsSettings, auxIndicatorSettings } = indictorsSettings;\r\n const newIndicatorSettings: IChartIndicatorSettings = { configId: \"1\", mainIndictorsSettings, auxIndicatorSettings };\r\n const newConfig = { chartType, generalSettings, indictorsSettings: newIndicatorSettings };\r\n let { isMain, indiName } = action.args;\r\n isMain = isMain || mainIndictorsSettings.has(indiName);\r\n\r\n let settings: IIndicatorSettings;\r\n // debugger;\r\n switch (action.type) {\r\n case actionType.AddIndicator:\r\n settings = GetDefaultSettings(isMain, indiName);\r\n if (isMain) {\r\n mainIndictorsSettings.set(indiName, settings);\r\n }\r\n else {\r\n newIndicatorSettings.auxIndicatorSettings.indicatorName = settings.indicatorName;\r\n newIndicatorSettings.auxIndicatorSettings.args = settings.args;\r\n newIndicatorSettings.auxIndicatorSettings.lineSettings = settings.lineSettings;\r\n }\r\n return newConfig;\r\n\r\n case actionType.RemoveIndicator:\r\n if (isMain) {\r\n mainIndictorsSettings.remove(indiName);\r\n }\r\n else {\r\n newIndicatorSettings.auxIndicatorSettings.indicatorName = \"\";\r\n }\r\n return newConfig;\r\n \r\n case actionType.ChangeArg:\r\n settings = (isMain ? mainIndictorsSettings.get(indiName) : auxIndicatorSettings) as IIndicatorSettings;\r\n (settings.args.get(action.args.key) as IIndicatorArg).value = action.args.value;\r\n\r\n console.clear();\r\n console.log({ key: action.args.key, value: settings.args.get(action.args.key) });\r\n return newConfig;\r\n\r\n case actionType.ChangeLineColor:\r\n settings = (isMain ? mainIndictorsSettings.get(indiName) : auxIndicatorSettings) as IIndicatorSettings;\r\n const args = action.args as IChangeIndiLineColorArgs;\r\n\r\n var line = settings.lineSettings.get(args.lineName) as ILineSettings;\r\n line.color = args.color;\r\n \r\n console.clear();\r\n console.log(args.color);\r\n return newConfig;\r\n \r\n case actionType.ReplaceSettings:\r\n const config = action.args as IChartConfig;\r\n newConfig.chartType = config.chartType;\r\n newConfig.generalSettings = config.generalSettings;\r\n newConfig.indictorsSettings = config.indictorsSettings;\r\n return newConfig;\r\n \r\n case actionType.ChangeBarColor:\r\n const item = action.args as IInfoItem;\r\n // @ts-ignore\r\n newConfig.generalSettings[item.name] = item.value;\r\n return newConfig;\r\n }\r\n return state;\r\n};\r\n\r\nexport type TEventBus = Emitter> | null;\r\nexport const FrameContext = React.createContext(null);","import React from \"react\";\r\nimport {\r\n discontinuousTimeScaleProviderBuilder,\r\n Chart,\r\n ChartCanvas,\r\n CandlestickSeries,\r\n XAxis,\r\n YAxis,\r\n CrossHairCursor,\r\n MouseCoordinateY,\r\n withDeviceRatio,\r\n withSize,\r\n IZoomAnchorOptions,\r\n} from \"react-financial-charts\";\r\n\r\nimport { IOHLCData } from './data'\r\n// import { S_IFBLK } from \"node:constants\";\r\nimport { createMainIndicators, createAuxIndicator } from './chartHelper';\r\nimport { EventDispatcher } from './EventDispatcher';\r\nimport { IMap, IIndicatorSettings, IChartGeneralSettings } from './typeDefine';\r\nimport { getThemedAxisProps } from \"./theme\";\r\nimport { ZoomHelper } from \"./ZoomHelper\";\r\nimport { ChartSplitter } from \"./ChartSplitter\";\r\nimport { BaEdgeIndicator } from \"./core/BaEdgeIndicator\";\r\nimport { FrameContext } from \"./chartContext\";\r\n\r\n\r\nexport const leftDomainBasedZoomAnchor = (\r\n options: IZoomAnchorOptions,\r\n) => {\r\n const { xScale } = options;\r\n const [start,] = xScale.domain();\r\n return start as TXAxis;\r\n};\r\n\r\n\r\ninterface ChartCoreProps {\r\n readonly data: IOHLCData[];\r\n readonly height: number;\r\n readonly dateTimeFormat?: string;\r\n readonly width: number;\r\n readonly ratio: number;\r\n readonly xExtents?: number[];\r\n readonly plotFull: boolean;\r\n mainIndictorsSettings: IMap;\r\n auxIndicatorSettings: IIndicatorSettings | null;\r\n readonly onCurrentBarChanged: (barDatas: any) => void;\r\n readonly onGetMoreData: (endTime: Date, xExtents: number[]) => void;\r\n readonly pricesDisplayFormat: (n: number | { valueOf(): number; }) => string;\r\n readonly theme?: string;\r\n readonly ask?: number;\r\n readonly generalSettings: IChartGeneralSettings;\r\n}\r\n\r\ninterface IChartState{\r\n enableInteractiveObject: boolean;\r\n channels_1: any[];\r\n auxHeight: number;\r\n isInZoomIn: boolean;\r\n}\r\n\r\nconst splitterHeight = 6;\r\n\r\nclass ChartCore extends React.Component {\r\n private readonly margin = { left: 0, right: 55, top: 0, bottom: 24 };\r\n private readonly xScaleProvider = discontinuousTimeScaleProviderBuilder().inputDateAccessor(\r\n (d: IOHLCData) => d.date,\r\n );\r\n\r\n private onDrawComplete(e: React.MouseEvent, newChannels: any[], moreProps: any) {\r\n\t\t// this gets called on\r\n\t\t// 1. draw complete of drawing object\r\n\t\t// 2. drag complete of drawing object\r\n\t\tthis.setState({\r\n\t\t\tenableInteractiveObject: false,\r\n\t\t\tchannels_1: newChannels\r\n\t\t});\r\n\t}\r\n\r\n constructor(props: ChartCoreProps) {\r\n super(props);\r\n\t\tthis.state = {\r\n\t\t\tenableInteractiveObject: true,\r\n channels_1: [],\r\n auxHeight: 150,\r\n isInZoomIn: false,\r\n };\r\n this.onDrawComplete = this.onDrawComplete.bind(this);\r\n }\r\n\r\n public render() {\r\n // console.log(\"ChartCore, props:\", this.props);\r\n const { data: initialData, height, ratio, width,\r\n mainIndictorsSettings, auxIndicatorSettings, pricesDisplayFormat } = this.props;\r\n // debugger;\r\n let { elements: mainIndicatorsElements, data: calculatedData } = createMainIndicators(initialData, mainIndictorsSettings);\r\n //const hasMainIndicator: boolean = mainIndicatorsElements.length > 0;\r\n \r\n const toolbarHeight = 0;\r\n const origin = (_: number, h: number) => [0, toolbarHeight];\r\n\r\n const theme = this.props.theme ?? \"white\";\r\n const axisProps = getThemedAxisProps(theme);\r\n\r\n let auxHeight = this.state.auxHeight;\r\n const result = createAuxIndicator(calculatedData, auxIndicatorSettings, auxHeight, axisProps);\r\n const auxIndicatorElement = result.auxElement;\r\n if (!result.hasAux) {\r\n auxHeight = 0;\r\n }\r\n const isShowXAxisLabel = !result.hasAux;\r\n calculatedData = result.data;\r\n\r\n const { margin, xScaleProvider } = this;\r\n\r\n // gen xScale(base on scaleLinear), and merge idx property to data: idx{date, index, level...}\r\n const { data, xScale, xAccessor, displayXAccessor } = xScaleProvider(calculatedData);\r\n //let xScale = scaleTime();\r\n\r\n const max = xAccessor(data[data.length - 1]);\r\n const min = xAccessor(data[Math.max(0, data.length - 200)]);\r\n let xExtents = this.props.xExtents ?? [min, max + 5];\r\n\r\n const gridHeight = height - margin.top - margin.bottom;\r\n const chartHeight = gridHeight - auxHeight - splitterHeight;\r\n\r\n // const start = data.length - 300;\r\n // const end = data.length - 1;\r\n // console.log(\"set domain:\", {start, end});\r\n // xScale.domain([start, end]);\r\n // let schar = \"🍊\";\r\n // console.log(\"before render ChartCore\", { pExtents: this.props.xExtents, newExtens: xExtents, DataLentgh: data.length });\r\n\r\n const className = this.state.isInZoomIn ? \"zoom-in\" : void 0;\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {isShowXAxisLabel && }\r\n \r\n \r\n\r\n \r\n \r\n\r\n {mainIndicatorsElements}\r\n \r\n \r\n {eventBus => }\r\n \r\n {/* */}\r\n \r\n\r\n {result.hasAux && }\r\n\r\n {auxIndicatorElement}\r\n \r\n\r\n \r\n );\r\n }\r\n\r\n private readonly zoomInStateChanged = (inZoomIn: boolean) => {\r\n this.setState({ isInZoomIn: inZoomIn });\r\n }\r\n\r\n private readonly onResize = (dy: number) => {\r\n const { auxHeight } = this.state;\r\n const newAuxHeight = auxHeight - dy;\r\n const minChartHeight = 50;\r\n const minAuxHeight = 20;\r\n const chartHeight = this.props.height - splitterHeight - newAuxHeight;\r\n if (newAuxHeight >= minAuxHeight && chartHeight >= minChartHeight) {\r\n this.setState({ auxHeight: newAuxHeight });\r\n }\r\n // console.log(\"new auxHeight: \" + newAuxHeight, this.props.height);\r\n };\r\n\r\n private readonly candleChartExtents = (data: IOHLCData) => {\r\n return [data.high, data.low];\r\n };\r\n\r\n private readonly yEdgeIndicator = (data: IOHLCData) => {\r\n return data.close;\r\n };\r\n\r\n private readonly openCloseColor = (data: IOHLCData) => {\r\n // return data.close >= data.open ? \"#26a69a\" : \"#ef5350\";\r\n return data.close >= data.open ? this.props.generalSettings.riseBarColor : this.props.generalSettings.fallBarColor;\r\n // return data.close >= data.open ? \"#2EBD85\" : \"#E0294A\"; // TradingView colors\r\n };\r\n}\r\n\r\nexport const ChartCoreWrap = withSize({ style: { minHeight: 150 } })(withDeviceRatio()(ChartCore));","import React from \"react\";\r\nimport { IChildRef, DataRangeType, timeParser, ChartTypeToResolution, ChartType } from \"../typeDefine\";\r\nimport { IOHLCData } from \"./iOHLCData\";\r\nimport { timeFormater } from '../typeDefine'\r\nimport { IChartDataSource } from \"./dataSource\";\r\n\r\nimport { IAsyncResult } from \"./asyncResult\";\r\nimport { bisector } from \"d3-array\";\r\nimport { LoadingOutlined } from \"@ant-design/icons\";\r\nimport { Space } from \"antd\";\r\n// import { OrigBarToTvBar, TvBarToOrigBar } from \"./chartDataParser\";\r\n// import { Bar } from \"../../charting_library/datafeed-api\";\r\nimport { nanoid } from \"../chartHelper\";\r\n\r\n\r\ninterface WithOHLCDataProps {\r\n readonly data: IOHLCData[];\r\n readonly plotFull: boolean;\r\n}\r\n\r\ninterface WithOHLCState {\r\n data?: IOHLCData[];\r\n xExtents?: number[];\r\n message: string;\r\n readonly instanceId: string;\r\n isLoadingData: boolean;\r\n ask?: number;\r\n}\r\n\r\nexport function withOHLCData(dataSource: IChartDataSource, childRef: IChildRef, commandDispatcher: any) {\r\n return (OriginalComponent: React.ComponentClass) => {\r\n return class WithOHLCData extends React.Component, WithOHLCState> {\r\n\r\n // private timeoutId: number = 0;\r\n // private inLagFixing: boolean = false;\r\n // private lagFixingCount: number = 0;\r\n // private fixingBeginTime: number = 0;\r\n\r\n // // for controlling instrument session or day close.\r\n // private MaxLagFixingCount: number = 10;\r\n\r\n private pendingCalls: IAsyncResult[] = [];\r\n // private unmounted = false;\r\n private _rangeType: DataRangeType = DataRangeType.Unlimited;\r\n\r\n public constructor(props: Omit) {\r\n super(props);\r\n\r\n this.state = {\r\n message: `Loading data...`, instanceId: nanoid(), isLoadingData: true\r\n };\r\n\r\n childRef.onGetMoreData = this.getMoreData.bind(this);\r\n // dataSource.subscribeRealPrice(this.onRealPrice.bind(this));\r\n // dataSource.OnChartDataNotify = this.onChartDataNotify.bind(this);\r\n\r\n dataSource.OnChartTypeChanged = this.onChartTypeChanged.bind(this);\r\n dataSource.OnPeriodRangeChanged = this.onPeriodRangeChanged.bind(this);\r\n dataSource.registerDataBufferAccessor(this.getDataFromBuffer.bind(this));\r\n }\r\n\r\n private getDataFromBuffer(begin: number, end: number): IOHLCData[] {\r\n const datas = this.state.data;\r\n let result: IOHLCData[] = [];\r\n if (datas) {\r\n // const beginTime = new Date(begin);\r\n // const searchFunc = bisector((d: IOHLCData) => d.date).left;\r\n // const index = searchFunc(datas, beginTime);\r\n // if (index >= 0) {\r\n // if (end === 0) {\r\n // result = datas.slice(index);\r\n // } else {\r\n // const endTime = new Date(end);\r\n // const endIndex = searchFunc(datas, endTime);\r\n // if (endIndex > index) {\r\n // result = datas.slice(index, endIndex + 1);\r\n // }\r\n // }\r\n // }\r\n // return all data to TV, for Tv only reqeust init data once. \r\n // by do this, the problem been solved: no data in TV charts when switched from one chart to multi charts.\r\n result = datas;\r\n }\r\n return result;\r\n }\r\n\r\n public componentDidMount() {\r\n // console.log(\"🍊🍊🍊WithOHLCData componentDidMount triggered.\");\r\n try {\r\n this.setState({ data: void 0, message: \"getting data...\", isLoadingData: true });\r\n\r\n // const chartType = dataSource.chartType();\r\n // if (chartType == ChartType.Minute1) {\r\n // console.log(1);\r\n // }\r\n // console.log(`configDebug: withOHLCData componentDidMount chartType=${chartType}`);\r\n\r\n const result = dataSource.GetInitChartData(500)\r\n .done((chartData: any[]) => {\r\n const resolution = ChartTypeToResolution(dataSource.chartType());\r\n if (chartData && chartData.length > 0) {\r\n this.setState({ data: chartData, xExtents: void 0, isLoadingData: false }, () => {\r\n const lastBar = chartData[chartData.length - 1];\r\n dataSource.registerLastbarUpdateCallback(this.state.instanceId, lastBar, this.updateLastBar.bind(this));\r\n // this.laggingCheck();\r\n });\r\n }\r\n else {\r\n this.setState({ data: void 0, message: \"no chart data\", isLoadingData: false });\r\n }\r\n // set TV resolution after Orig chart got Init Data, so TV can get Init Data from Orig Chart.\r\n commandDispatcher.setResolution(resolution);\r\n })\r\n .fail((error: any) => {\r\n console.log(error);\r\n this.setState({ message: error, isLoadingData: false });\r\n });\r\n this.pendingCalls.push(result);\r\n } catch (err) {\r\n console.log(\"Call GetChartData error.\", err);\r\n }\r\n }\r\n\r\n private updateLastBar(bar: IOHLCData, ask?: number) {\r\n const data = this.state.data as IOHLCData[];\r\n if (data) {\r\n const lastBar = data[data.length - 1];\r\n if (lastBar.date.getTime() === bar.date.getTime()) {\r\n data.pop();\r\n data.push(bar);\r\n if (ask) {\r\n this.setState({ data, ask });\r\n } else {\r\n this.setState({ data });\r\n }\r\n } else if (lastBar.date.getTime() < bar.date.getTime()) {\r\n data.push(bar)\r\n this.setState({ data });\r\n } else {\r\n console.log(\"updateLastBar got not expected data.\", { newBartime: timeFormater(bar.date), lastBarTime: lastBar.date.getTime() });\r\n }\r\n }\r\n }\r\n\r\n public componentWillUnmount() {\r\n console.log(\"💫💫💫 WithOHLCData componentWillUnmount\");\r\n // this.unmounted = true;\r\n // window.clearTimeout(this.timeoutId);\r\n if (this.pendingCalls.length > 0) {\r\n this.pendingCalls.map((r) => r.cancel());\r\n this.pendingCalls = [];\r\n }\r\n }\r\n\r\n // private resetLagFixingState() {\r\n // this.inLagFixing = false;\r\n // this.lagFixingCount = 0;\r\n // }\r\n\r\n private onChartTypeChanged() {\r\n // this.resetLagFixingState();\r\n // window.clearTimeout(this.timeoutId);\r\n // this.setState({ data: void 0, message: \"getting data...\", isGettingData: true });\r\n this.componentDidMount();\r\n }\r\n\r\n private onPeriodRangeChanged(rangeType: DataRangeType) {\r\n let requestServerData = true;\r\n this._rangeType = rangeType;\r\n if (rangeType === DataRangeType.Unlimited) {\r\n if (this.state.data && this.state.data.length > 300) {\r\n requestServerData = false;\r\n this.setState({ xExtents: void 0 });\r\n }\r\n else {\r\n this.componentDidMount();\r\n }\r\n }\r\n else {\r\n const beginTimeString = dataSource.GetRangeBegintTime(rangeType);\r\n if (beginTimeString && this.state.data) {\r\n const beginTime = timeParser(beginTimeString)\r\n if (beginTime && this.state.data[0].date < beginTime) {\r\n const searchFunc = bisector((d: IOHLCData) => d.date).left;\r\n const index = searchFunc(this.state.data, beginTime);\r\n if (index >= 0) {\r\n requestServerData = false;\r\n const newData = this.state.data.slice(index);\r\n this.setState({ data: newData, xExtents: [0, newData.length - 1] });\r\n }\r\n }\r\n }\r\n\r\n if (requestServerData) {\r\n this.requestFixPeriodData(rangeType);\r\n }\r\n }\r\n if (requestServerData) {\r\n // this.resetLagFixingState();\r\n // window.clearTimeout(this.timeoutId);\r\n this.setState({ data: void 0, message: \"getting data...\", isLoadingData: true });\r\n }\r\n }\r\n\r\n private requestFixPeriodData(rangeType: DataRangeType) {\r\n const result = dataSource.BeginGetFixPeriodData(rangeType);\r\n if (result.methodName() === \"GetFixPeriodData\") {\r\n this.handleFixPeriodDataResult(result);\r\n }\r\n else {\r\n result.finally(() => {\r\n this.requestFixPeriodData(rangeType);\r\n });\r\n }\r\n }\r\n\r\n private handleFixPeriodDataResult(result: IAsyncResult) {\r\n result.done((chartData: any[]) => {\r\n if (chartData) {\r\n // this.setState({ data: chartData, xExtents: [0, chartData.length - 1], isLoadingData: false }, this.laggingCheck);\r\n this.setState({ data: chartData, xExtents: [0, chartData.length - 1], isLoadingData: false });\r\n }\r\n else {\r\n this.setState({ data: void 0, message: \"no chart data\", isLoadingData: false });\r\n }\r\n }).fail((error: any) => {\r\n console.log(\"handleFixPeriodDataResult, server error:\", error);\r\n this.setState({ message: error, isLoadingData: false });\r\n });\r\n }\r\n\r\n // private onChartDataNotify(chartData: IOHLCData) {\r\n // const { data } = this.state;\r\n // if (data) {\r\n // const lastItem = data[data.length - 1];\r\n // const { date: lastBarDate } = lastItem;\r\n\r\n // let updateBar = (barIndex: number) => {\r\n // let { date, close, high, low, open, volume } = chartData;\r\n // data[barIndex] = { date, close, high, low, open, volume };\r\n // this.setState({ data });\r\n // };\r\n\r\n // if (chartData.date.getTime() === lastBarDate.getTime()) {\r\n // updateBar(data.length - 1);\r\n // }\r\n // else if (chartData.date.getTime() < lastBarDate.getTime()) {\r\n // let idxBegin = data.length - 1;\r\n // let idxEnd = Math.max(data.length - 31, 0);\r\n // for (let index = idxBegin; index >= idxEnd; index--){\r\n // if (data[index].date.getTime() === chartData.date.getTime()) {\r\n // updateBar(index);\r\n // break;\r\n // }\r\n // }\r\n // }\r\n // else {\r\n // const cycleSpan = dataSource.chartType() * 60 * 1_000; // ms\r\n // if (lastBarDate.getTime() + cycleSpan * 1.5 < chartData.date.getTime()) {\r\n // // gap found, should fix last bars' datas.\r\n // if (!this.inLagFixing) {\r\n // this.startTimerWithRandDelay(0);\r\n // }\r\n // }\r\n // else {\r\n // // this situation should not be happen\r\n // console.warn(`cycleSpan:${cycleSpan},chartData.date > lastItem.date, but less then half cycleSpan.`,\r\n // { chartType: dataSource.chartType, chartData, lastItem });\r\n // }\r\n // }\r\n // }\r\n // };\r\n\r\n // private onRealPrice(bid: number, ask: number, timestamp: Date) {\r\n // const { data } = this.state;\r\n // if (data) {\r\n // const lastItem = data[data.length - 1];\r\n // let { date: cycleBeingTime, close, high, low, open, volume } = lastItem;\r\n // const cycleEndTime = new Date(cycleBeingTime.getTime() + dataSource.chartType() * 60 * 1_000);\r\n // const priceTime = timestamp.getTime();\r\n // if (priceTime >= cycleBeingTime.getTime() && priceTime <= cycleEndTime.getTime()) {\r\n // close = bid;\r\n // if (high < close) high = close;\r\n // if (low > close) low = close;\r\n // data[data.length - 1] = { date: cycleBeingTime, close, high, low, open, volume };\r\n // this.setState({ data, ask });\r\n // }\r\n // else if (priceTime > cycleEndTime.getTime()) {\r\n // // next cycle price data received, should fix last bars' datas.\r\n // const delay = dataSource.GetSystemTime().valueOf() - this.fixingBeginTime;\r\n // if (delay > 30_000) {\r\n // this.resetLagFixingState();\r\n // }\r\n // if (!this.inLagFixing) {\r\n // this.startTimerWithRandDelay(0);\r\n // }\r\n // }\r\n // else {\r\n // console.warn(`priceTime:${timeFormaterWithMs(timestamp)},cycleBeingTime:${timeFormaterWithMs(cycleBeingTime)}`);\r\n // }\r\n // }\r\n // }\r\n\r\n private getMoreData(endTime: Date, xExtents: number[]) {\r\n if (this._rangeType !== DataRangeType.Unlimited) {\r\n return;\r\n }\r\n console.log(`withOHLCData call onGetMoreData endTime=[${timeFormater(endTime)}]`);\r\n try {\r\n const result = dataSource.GetMoreChartData(endTime, 500)\r\n .done((moreData: any[]) => {\r\n if (moreData && moreData.length > 1) {\r\n // const moreData = (moreData as iExChartData[]).map((d) => convertData(d));\r\n const { data } = this.state;\r\n if (data && moreData[moreData.length - 1].date <= data[0].date) {\r\n moreData.pop(); // remove last item\r\n xExtents[0] += moreData.length;\r\n xExtents[1] += moreData.length;\r\n this.setState({ data: moreData.concat(data as []), xExtents: xExtents });\r\n }\r\n console.log(\"moreData end: data size:\" + this.state.data?.length);\r\n }\r\n else {\r\n console.log(\"moreData: no data got\");\r\n }\r\n })\r\n .fail((error: any) => {\r\n console.log(\"getMoreData failed\", error);\r\n this.setState({ message: error });\r\n });\r\n this.pendingCalls.push(result);\r\n } catch (err) {\r\n console.log(\"Call GetMoreChartData error.\", err);\r\n }\r\n }\r\n\r\n // // 图形滞后检查\r\n // private laggingCheck = () => {\r\n // if (this.unmounted) return;\r\n // if (this.lagFixingCount >= this.MaxLagFixingCount) {\r\n // this.resetLagFixingState();\r\n // return;\r\n // }\r\n\r\n // const data = this.state.data as IOHLCData[];\r\n // if (!data || data.length === 0) {\r\n // this.resetLagFixingState();\r\n // return;\r\n // }\r\n\r\n // const now = +dataSource.GetSystemTime();\r\n // let dataLastTime = new Date(data[data.length - 1].date);\r\n // dataLastTime.setMinutes(dataLastTime.getMinutes() + dataSource.chartType());\r\n // var chartLeadingSpan = +dataLastTime - now;\r\n // if (chartLeadingSpan > 0) {\r\n // // set new interval for last bar checking.\r\n // this.startTimerWithRandDelay(chartLeadingSpan)\r\n // }\r\n // else {\r\n // // 图形滞后,请求数据。\r\n // this.inLagFixing = true;\r\n // const beginTime = data[data.length - 1].date;\r\n // try {\r\n // this.fixingBeginTime = dataSource.GetSystemTime().valueOf();\r\n // const result = dataSource.GetLastBars(beginTime)\r\n // .done((datas: any[]) => {\r\n // let isGot = false;\r\n // this.lagFixingCount++;\r\n // if (datas.length > 1) {\r\n // // const datasGot = (datas as iExChartData[]).map((d) => convertData(d));\r\n // const data = this.state.data as IOHLCData[];\r\n // if (data) {\r\n // const lastBar = data[data.length - 1];\r\n // if (lastBar.date.getTime() === datas[0].date.getTime()) {\r\n // data.pop();\r\n // this.setState({ data: data.concat(datas) }, this.laggingCheck);\r\n // isGot = true;\r\n // this.resetLagFixingState();\r\n // // this.laggingCheck(); // start new check cycle\r\n // }\r\n // else {\r\n // console.log(\"GetLastBars got no expected data.\", { beginTime, lastBar, datasGot: datas });\r\n // }\r\n // }\r\n // }\r\n // if (!isGot) {\r\n // this.startTimerWithRandDelay(0);\r\n // }\r\n // })\r\n // .fail((error: any) => {\r\n // console.log(\"GetLastBars failed\", error);\r\n // this.setState({ message: error });\r\n // this.startTimerWithRandDelay(0);\r\n // })\r\n // // .always(() => { // equal to finally\r\n // // console.log(\"Call GetLastBars completed.\");\r\n // // })\r\n // ;\r\n // const temp: IAsyncResult[] = [];\r\n // this.pendingCalls.map((r) => {\r\n // if (r.finished()) {\r\n // temp.push(r);\r\n // }\r\n // });\r\n // this.pendingCalls = temp;\r\n // this.pendingCalls.push(result);\r\n // } catch (err) {\r\n // console.log(\"Call GetLastBars error.\", err);\r\n // // this.startTimerWithRandDelay(0);\r\n // }\r\n // }\r\n // };\r\n\r\n // private startTimerWithRandDelay(interval: number) {\r\n // const intMax = 2147483647;\r\n // if (interval > intMax) { // 月线、年线溢出\r\n // interval = intMax;\r\n // }\r\n // interval += 2000 + 3000 * Math.random(); // 延迟 2秒 + 0-3000毫秒\r\n // this.timeoutId = window.setTimeout(this.laggingCheck, interval);\r\n // }\r\n\r\n public render() {\r\n const { ask, data, message, isLoadingData } = this.state;\r\n childRef.onLoadingData(isLoadingData);\r\n\r\n if (data === void 0) {\r\n const showBusy = message !== 'no data';\r\n return (\r\n \r\n {showBusy &&
}\r\n
{message}
\r\n
\r\n );\r\n }\r\n\r\n return ;\r\n }\r\n };\r\n };\r\n}","import React from 'react';\r\nimport { ITooltipProps } from '../../typeDefine';\r\nimport { Space } from \"antd\";\r\n\r\nexport function BBTooltip(props: ITooltipProps)\r\n{\r\n const { currentBarData, settings, pricesDisplayFormat } = props;\r\n\r\n let displayInit = \"n/a\";\r\n let top = displayInit;\r\n let middle = displayInit;\r\n let bottom = displayInit;\r\n\r\n if (currentBarData) {\r\n const item = currentBarData.bb;\r\n if (item) {\r\n top = pricesDisplayFormat(item.top);\r\n middle = pricesDisplayFormat(item.middle);\r\n bottom = pricesDisplayFormat(item.bottom);\r\n }\r\n }\r\n\r\n const sourcePath = \"close\";\r\n const windowSize = settings.args.get(\"windowSize\")?.value;\r\n const multiplier = settings.args.get(\"multiplier\")?.value;\r\n const movingAverageType = \"sma\";\r\n\r\n const tooltipLabel = `BB(${sourcePath}, ${windowSize}, ${multiplier}, ${movingAverageType}): `;\r\n // const tooltipValue = `${top}, ${middle}, ${bottom}`;\r\n\r\n const t_color = settings.lineSettings.get(\"top\")?.color;\r\n const m_color = settings.lineSettings.get(\"middle\")?.color;\r\n const b_color = settings.lineSettings.get(\"bottom\")?.color;\r\n return (\r\n \r\n
\r\n {tooltipLabel}\r\n
\r\n
\r\n top:{top}\r\n
\r\n
\r\n middle:{middle}\r\n
\r\n
\r\n bottom:{bottom}\r\n
\r\n
\r\n );\r\n}\r\n","import React from 'react';\r\nimport { ITooltipProps } from \"../../typeDefine\";\r\nimport { Space } from \"antd\";\r\n\r\nexport function MATooltip(props: ITooltipProps) {\r\n const { currentBarData, settings, pricesDisplayFormat } = props;\r\n\r\n const getValue = (lineName: string) => {\r\n let value = \"n/a\";\r\n if (currentBarData && currentBarData[lineName]) {\r\n value = pricesDisplayFormat(currentBarData[lineName]);\r\n }\r\n \r\n return value;\r\n };\r\n \r\n return (\r\n \r\n {settings.lineSettings.entries().map(\r\n (pair, index) => {\r\n const value = getValue(pair.key);\r\n const lineDesc = `MA(${settings.args.get(pair.key)?.value}):`;\r\n return (\r\n
\r\n \r\n {lineDesc}\r\n \r\n \r\n {value}\r\n \r\n
\r\n );\r\n }\r\n )}\r\n
\r\n );\r\n}","import React from 'react';\r\nimport { ITooltipProps } from '../../typeDefine';\r\nimport { Space } from \"antd\";\r\n\r\nexport function SARTooltip(props: ITooltipProps)\r\n{\r\n const { currentBarData, settings, pricesDisplayFormat } = props;\r\n\r\n let displayInit = \"n/a\";\r\n let sar = displayInit;\r\n let l_color = settings.lineSettings.get(\"sar\")?.color;\r\n\r\n if (currentBarData) {\r\n sar = pricesDisplayFormat(currentBarData.sar);\r\n const lineName = currentBarData.close < sar ? \"falling\" : \"rising\";\r\n l_color = settings.lineSettings.get(lineName)?.color;\r\n }\r\n\r\n const accelerationFactor = settings.args.get(\"accelerationFactor\")?.value;\r\n const maxAccelerationFactor = settings.args.get(\"maxAccelerationFactor\")?.value;\r\n\r\n const tooltipLabel = `SAR(${accelerationFactor}, ${maxAccelerationFactor}): `;\r\n\r\n \r\n return (\r\n \r\n
\r\n {tooltipLabel}\r\n
\r\n
\r\n {sar}\r\n
\r\n
\r\n );\r\n}\r\n","import React from 'react';\r\nimport { ITooltipProps } from '../../typeDefine';\r\nimport { Space } from \"antd\";\r\n\r\nexport function MAETooltip(props: ITooltipProps)\r\n{\r\n const { currentBarData, settings, pricesDisplayFormat } = props;\r\n\r\n let displayInit = \"n/a\";\r\n let lower = displayInit;\r\n let upper = displayInit;\r\n\r\n if (currentBarData) {\r\n const item = currentBarData.mae;\r\n if (item) {\r\n lower = pricesDisplayFormat(item.lower);\r\n upper = pricesDisplayFormat(item.upper);\r\n }\r\n }\r\n\r\n const sourcePath = \"close\";\r\n const windowSize = settings.args.get(\"windowSize\")?.value;\r\n const multiplier = settings.args.get(\"shift\")?.value;\r\n\r\n const tooltipLabel = `MAE(${sourcePath}, ${windowSize}, ${multiplier}): `;\r\n\r\n const l_color = settings.lineSettings.get(\"lower\")?.color;\r\n const u_color = settings.lineSettings.get(\"upper\")?.color;\r\n return (\r\n \r\n
\r\n {tooltipLabel}\r\n
\r\n
\r\n top:{lower}\r\n
\r\n
\r\n bottom:{upper}\r\n
\r\n
\r\n );\r\n}\r\n","import React from 'react';\r\nimport { ITooltipProps } from '../../typeDefine';\r\nimport { Space } from \"antd\";\r\n\r\nexport function WWSTooltip(props: ITooltipProps)\r\n{\r\n const { currentBarData, settings, pricesDisplayFormat } = props;\r\n\r\n let displayInit = \"n/a\";\r\n let wws = displayInit;\r\n\r\n if (currentBarData) {\r\n const item = currentBarData.wws;\r\n if (item) {\r\n wws = pricesDisplayFormat(item);\r\n }\r\n }\r\n\r\n const sourcePath = \"close\";\r\n const windowSize = settings.args.get(\"windowSize\")?.value;\r\n\r\n const tooltipLabel = `WWS(${sourcePath}, ${windowSize}): `;\r\n\r\n const l_color = settings.lineSettings.get(\"wws\")?.color;\r\n return (\r\n \r\n
\r\n {tooltipLabel}\r\n
\r\n
\r\n {wws}\r\n
\r\n
\r\n );\r\n}\r\n","import { format } from \"d3-format\";\r\nimport { timeFormat } from \"d3-time-format\";\r\nimport * as React from \"react\";\r\nimport { getChartColor } from \"../../theme\";\r\n\r\nconst displayTextsDefault = {\r\n o: \"O: \",\r\n h: \" H: \",\r\n l: \" L: \",\r\n c: \" C: \",\r\n na: \"n/a\",\r\n};\r\n\r\nexport interface BaseTooltipProps {\r\n readonly changeFormat?: (n: number | { valueOf(): number }) => string;\r\n readonly displayTexts?: {\r\n o: string;\r\n h: string;\r\n l: string;\r\n c: string;\r\n na: string;\r\n };\r\n readonly displayValuesFor?: (props: BaseTooltipProps, moreProps: any) => any;\r\n readonly ohlcFormat?: (n: number | { valueOf(): number }) => string;\r\n readonly onClick?: (event: React.MouseEvent) => void;\r\n readonly origin?: [number, number] | ((width: number, height: number) => [number, number]);\r\n readonly percentFormat?: (n: number | { valueOf(): number }) => string;\r\n readonly textFill?: string | ((item: any) => string);\r\n readonly currentBarData: any;\r\n}\r\n\r\nconst defaultProps = {\r\n changeFormat: format(\"+.2f\"),\r\n displayTexts: displayTextsDefault,\r\n displayValuesFor: (_: any, props: any) => props.currentItem,\r\n ohlcFormat: format(\".2f\"),\r\n origin: [0, 0],\r\n percentFormat: format(\"+.2%\"),\r\n};\r\n\r\nconst timeFormater = timeFormat(\"%Y-%m-%d %H:%M\");\r\n\r\nexport function BaseTooltip(props: BaseTooltipProps) {\r\n const {\r\n changeFormat = defaultProps.changeFormat,\r\n displayTexts = defaultProps.displayTexts,\r\n ohlcFormat = defaultProps.ohlcFormat,\r\n percentFormat = defaultProps.percentFormat,\r\n } = props;\r\n\r\n\r\n let open: string = displayTexts.na;\r\n let high: string = displayTexts.na;\r\n let low: string = displayTexts.na;\r\n let close: string = displayTexts.na;\r\n let change: string = displayTexts.na;\r\n let color: string = \"#333\";\r\n let time = \"\";\r\n\r\n const item = props.currentBarData;\r\n if (item) {\r\n open = ohlcFormat(item.open);\r\n high = ohlcFormat(item.high);\r\n low = ohlcFormat(item.low);\r\n close = ohlcFormat(item.close);\r\n change = `${changeFormat(item.close - item.open)} (${percentFormat(\r\n (item.close - item.open) / item.open,\r\n )})`;\r\n color = getChartColor(item.open, item.close);\r\n // time = timeFormater(item.date);\r\n return (\r\n
\r\n \r\n {displayTexts.o}\r\n \r\n \r\n {open}\r\n \r\n \r\n {displayTexts.h}\r\n \r\n \r\n {high}\r\n \r\n \r\n {displayTexts.l}\r\n \r\n \r\n {low}\r\n \r\n \r\n {displayTexts.c}\r\n \r\n \r\n {close}\r\n \r\n \r\n {` ${change}`}\r\n \r\n
\r\n );\r\n } else {\r\n return <>;\r\n }\r\n}\r\n","import React from 'react';\r\nimport { useState } from 'react';\r\nimport { BBTooltip } from './BBTooltip';\r\nimport { IChartIndicatorSettings, IChildRef, timeFormater } from '../../typeDefine';\r\nimport { MATooltip } from './MATooltip';\r\nimport { SARTooltip } from './SARTooltip';\r\nimport { MAETooltip } from './MAETooltip';\r\nimport { WWSTooltip } from './WWSTooltip';\r\nimport { Col, Space } from 'antd';\r\nimport { BaseTooltip } from './BaseTooltip';\r\nimport { window } from 'd3-selection';\r\n\r\ninterface IChartTooltipProps{\r\n readonly indicatorSettings: IChartIndicatorSettings;\r\n readonly myRef: IChildRef;\r\n readonly pricesDisplayFormat: (n: number | { valueOf(): number; }) => string;\r\n}\r\n\r\nexport function ChartTooltip(props: IChartTooltipProps) {\r\n const { indicatorSettings: chartConfig, myRef, pricesDisplayFormat } = props;\r\n let tooltips: any[] = [];\r\n\r\n const [barData, setBarData] = useState();\r\n myRef.setData = (data: any) => {\r\n setBarData(data);\r\n }\r\n\r\n const [expanded, setExpanded] = useState(true);\r\n\r\n if (expanded && chartConfig.mainIndictorsSettings) {\r\n const indiNames = chartConfig.mainIndictorsSettings.keys();\r\n tooltips = indiNames.map((name: string) => {\r\n const settings = chartConfig.mainIndictorsSettings.get(name);\r\n if (settings) {\r\n let tooltip: any;\r\n if (settings.indicatorName === \"MA\") {\r\n tooltip = ;\r\n }\r\n else if (settings.indicatorName === \"BB\") {\r\n tooltip = ;\r\n }\r\n else if (settings.indicatorName === \"SAR\") {\r\n tooltip = ;\r\n }\r\n else if (settings.indicatorName === \"MAE\") {\r\n tooltip = ;\r\n }\r\n else if (settings.indicatorName === \"WWS\") {\r\n tooltip = ;\r\n }\r\n\r\n if (tooltip) {\r\n const key = 'col' + settings.indicatorName;\r\n tooltip = {tooltip};\r\n return tooltip;\r\n }\r\n }\r\n });\r\n }\r\n\r\n const iconStyle: any = {\r\n transition: \"transform 0.3s ease-out\"\r\n };\r\n if (!expanded) {\r\n iconStyle.transform = \"rotate(-90deg)\";\r\n }\r\n\r\n const changeExpendState = () => {\r\n setExpanded(!expanded);\r\n };\r\n\r\n let time;\r\n if (barData)\r\n time = timeFormater(barData.date);\r\n\r\n const base = (\r\n \r\n \r\n
\r\n \r\n \r\n \r\n
\r\n {expanded &&
{time}
}\r\n
\r\n \r\n );\r\n const ohlc = expanded && ;\r\n return <>{[base, ohlc, ...tooltips]};\r\n}","import { Tooltip, Input } from \"antd\";\r\nimport React from \"react\";\r\n\r\ninterface INumericInputProps{\r\n value: number;\r\n decimals: number;\r\n min?: number;\r\n onChange: (value: number) => void;\r\n moreProps?: any;\r\n};\r\n\r\nexport class NumericInput extends React.Component {\r\n //onChange = (e: React.ChangeEvent) => {\r\n\r\n onChange = (e: any) => {\r\n const { decimals, min } = this.props;\r\n const { value } = e.target;\r\n const reg = /^-?\\d*(\\.\\d*)?$/;\r\n if (value !== '' && !isNaN(value) && reg.test(value)) {\r\n if (min && parseFloat(value) < min) {\r\n return;\r\n }\r\n console.log({value});\r\n const newvalue = parseFloat(parseFloat(value).toFixed(decimals));\r\n this.props.onChange(newvalue);\r\n // console.log(\"NumericInput.notify onChange\");\r\n }\r\n // console.log(\"NumericInput.onChange\");\r\n };\r\n \r\n // // '.' at the end or only '-' in the input box.\r\n // onBlur = () => {\r\n // const { value, decimals, onChange } = this.props;\r\n // let valueStr = value.toString();\r\n // let valueTemp = valueStr;\r\n // if (valueStr.charAt(valueStr.length - 1) === '.' || valueStr === '-') {\r\n // valueTemp = valueStr.slice(0, -1);\r\n // }\r\n // let netvalue = parseFloat(valueTemp.replace(/0*(\\d+)/, '$1')).toFixed(decimals);\r\n // onChange(parseFloat(netvalue));\r\n // // console.log(\"NumericInput.onBlur\");\r\n // };\r\n \r\n render() {\r\n const { value } = this.props;\r\n return (\r\n \r\n );\r\n }\r\n}","import { Modal, Button } from 'antd';\r\nimport React, { useState } from 'react';\r\nimport { CirclePicker, ColorChangeHandler, ColorResult, SwatchesPicker } from 'react-color';\r\n\r\ninterface IColorPicker {\r\n color: string;\r\n onColorChanged: (color: string) => void;\r\n};\r\n/*\r\nconst colors = [\"#f44336\", \"#e91e63\", \"#9c27b0\", \"#673ab7\", \"#3f51b5\", \"#2196f3\",\r\n \"#03a9f4\", \"#00bcd4\", \"#009688\", \"#4caf50\", \"#8bc34a\", \"#cddc39\",\r\n \"#ffeb3b\", \"#ffc107\", \"#ff9800\", \"#ff5722\", \"#795548\", \"#607d8b\"];\r\n*/\r\n\r\n// names from color-name lib by: (where aa:from color-name)\r\n// document.getElementById(\"my\").value = Object.keys(aa).map((item)=>{return {key:item, v:aa[item]}}).sort((a,b)=>{return ((a.v[0]*90000 + a.v[1] * 300 + a.v[2]) -(b.v[0]*90000 + b.v[1] * 300 + b.v[2]))}).map((it)=>it.key);\r\n// merge Circle colors and remove some light,similar colors name\r\n\r\nconst colors = [\"#f44336\", \"#e91e63\", \"#9c27b0\", \"#673ab7\", \"#3f51b5\", \"#2196f3\",\r\n \"#03a9f4\", \"#00bcd4\", \"#009688\", \"#4caf50\", \"#8bc34a\", \"#cddc39\",\r\n \"#ffeb3b\", \"#ffc107\", \"#ff9800\", \"#ff5722\", \"#795548\", \"#607d8b\",\r\n \"black\", \"navy\", \"darkblue\", \"mediumblue\", \"blue\", \"darkgreen\", \"green\", \"teal\",\r\n \"deepskyblue\", \"darkturquoise\", \"mediumspringgreen\", \"lime\", \"springgreen\", \"cyan\", \"midnightblue\",\r\n \"dodgerblue\", \"lightseagreen\", \"forestgreen\", \"seagreen\", \"darkslategray\", \"limegreen\",\r\n \"mediumseagreen\", \"turquoise\", \"royalblue\", \"steelblue\", \"darkslateblue\", \"mediumturquoise\", \"indigo\",\r\n \"darkolivegreen\", \"cadetblue\", \"cornflowerblue\", \"rebeccapurple\", \"mediumaquamarine\", \"dimgray\",\r\n \"slateblue\", \"olivedrab\", \"slategrey\", \"lightslategrey\", \"mediumslateblue\", \"lawngreen\",\r\n \"chartreuse\", \"aquamarine\", \"maroon\", \"purple\", \"olive\", \"gray\", \"skyblue\", \"lightskyblue\", \"blueviolet\",\r\n \"darkred\", \"darkmagenta\", \"saddlebrown\", \"darkseagreen\", \"lightgreen\", \"mediumpurple\", \"darkviolet\", \"palegreen\",\r\n \"darkorchid\", \"yellowgreen\", \"sienna\", \"brown\", \"darkgray\", \"lightblue\", \"greenyellow\", \"paleturquoise\",\r\n \"lightsteelblue\", \"powderblue\", \"firebrick\", \"darkgoldenrod\", \"mediumorchid\", \"rosybrown\", \"darkkhaki\", \"silver\",\r\n \"mediumvioletred\", \"indianred\", \"peru\", \"chocolate\", \"tan\", \"lightgray\", \"thistle\", \"orchid\", \"goldenrod\",\r\n \"palevioletred\", \"crimson\",\"plum\", \"burlywood\", \"lightcyan\", \"lavender\", \"darksalmon\", \"violet\",\r\n \"palegoldenrod\", \"lightcoral\", \"khaki\", \"sandybrown\", \"wheat\", \"beige\",\r\n \"salmon\", \"antiquewhite\", \"linen\", \"lightgoldenrodyellow\", \"oldlace\",\r\n \"red\", \"magenta\", \"deeppink\", \"orangered\", \"tomato\", \"hotpink\", \"coral\", \"darkorange\", \"lightsalmon\",\r\n \"orange\", \"lightpink\", \"pink\", \"gold\", \"peachpuff\", \"navajowhite\", \"moccasin\", \"bisque\", \"mistyrose\",\r\n \"blanchedalmond\", \"lavenderblush\", \"yellow\"];\r\n\r\nexport function ColorPicker(props: IColorPicker) {\r\n const [isPickerShown, setisPickerShown] = useState(false);\r\n const showPicker = () => {\r\n setisPickerShown(true);\r\n };\r\n const hidePicker = () => {\r\n setisPickerShown(false);\r\n };\r\n\r\n const handleColorChanged: ColorChangeHandler = (color: ColorResult, event: React.ChangeEvent) => {\r\n hidePicker();\r\n props.onColorChanged(color.hex);\r\n };\r\n\r\n return (\r\n <>\r\n \r\n \r\n {/* */}\r\n \r\n \r\n \r\n );\r\n}","// import 'antd/dist/antd.css';\r\nimport { Radio, Tag, Divider, Row, Col, Select, Button, Input } from 'antd';\r\n// import { SSL_OP_SSLEAY_080_CLIENT_DH_BUG } from 'node:constants';\r\nimport { ChartContext } from './chartContext';\r\nimport React, { useContext, useState } from 'react';\r\nimport { DefaultSetings } from './indicatorDefaultSettings'\r\nimport {\r\n IAction, actionType, IChartConfig, IIndicatorSettings,\r\n IChangeIndiLineColorArgs, SettingType, IInfoItem\r\n} from './typeDefine';\r\nimport { merge } from 'd3-array';\r\nimport { NumericInput } from './NumericInput';\r\nimport { ColorPicker } from './ColorPicker';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nconst { CheckableTag } = Tag;\r\nconst allMainIndicators = Object.keys(DefaultSetings.main);\r\nconst allAuxIndicators = Object.keys(DefaultSetings.aux);\r\n\r\ninterface IndicatorSelectorProps{\r\n chartConfig: IChartConfig;\r\n onClose: () => void;\r\n}\r\n\r\n\r\nexport function IndicatorSelector(props: IndicatorSelectorProps) {\r\n const { t, i18n } = useTranslation();\r\n\r\n const dispatch = useContext(ChartContext) as React.Dispatch;\r\n\r\n const {\r\n mainIndictorsSettings: main,\r\n auxIndicatorSettings: aux,\r\n } = props.chartConfig.indictorsSettings;\r\n const { riseBarColor, fallBarColor } = props.chartConfig.generalSettings;\r\n\r\n const { Option } = Select;\r\n\r\n // const [isSetMain, setIsSetMain] = useState(true);\r\n const [settingType, setSettingType] = useState(SettingType.MainIndicator);\r\n\r\n let settingItem: IIndicatorSettings | null = null;\r\n if (settingType == SettingType.MainIndicator) {\r\n settingItem = main.values()[0];\r\n } else if(settingType == SettingType.AuxIndicator) {\r\n settingItem = aux;\r\n }\r\n // debugger;\r\n const [currentSettingItem, setCurrentSettingItem] = useState(settingItem);\r\n const onCurrentIndicatorChange = (indiName: string) => {\r\n //debugger;\r\n //const settings = (isSetMain ? main.get(indiName) : aux) as IIndicatorSettings; only main indicator select will trigger the even, so:\r\n const settings = main.get(indiName) as IIndicatorSettings;\r\n setCurrentSettingItem(settings);\r\n };\r\n\r\n if (settingType == SettingType.AuxIndicator && aux && aux.indicatorName !== currentSettingItem?.indicatorName) {\r\n setCurrentSettingItem(aux);\r\n }\r\n\r\n const onSetingtypeChanged = (e: any) => {\r\n const isMain = e.target.value === \"main\";\r\n const isAux = e.target.value === \"aux\";\r\n let settingType: SettingType = SettingType.General;\r\n if (isMain) {\r\n settingType = SettingType.MainIndicator;\r\n } else if (isAux) {\r\n settingType = SettingType.AuxIndicator;\r\n }\r\n \r\n let currentSetting: IIndicatorSettings | null = null;\r\n //debugger;\r\n if (isMain) {\r\n if (!main.empty()) {\r\n currentSetting = main.values()[0];\r\n }\r\n } else if (isAux) {\r\n currentSetting = aux;\r\n } else {\r\n currentSetting = null;\r\n }\r\n setCurrentSettingItem(currentSetting);\r\n // setIsSetMain(isMain);\r\n setSettingType(settingType);\r\n };\r\n\r\n const onIndicatorSelectionChange = (indiName: string, isMain: boolean, isSelected: boolean) => {\r\n if (indiName === currentSettingItem?.indicatorName && !isSelected) {\r\n setCurrentSettingItem(null);\r\n }\r\n\r\n const action: IAction = {\r\n type: isSelected ? actionType.AddIndicator : actionType.RemoveIndicator,\r\n args: { isMain: isMain, indiName: indiName }\r\n };\r\n\r\n dispatch(action);\r\n };\r\n\r\n\r\n let options: JSX.Element[] | null = null;\r\n if (settingType == SettingType.MainIndicator) {\r\n if (!main.empty()) {\r\n options = main.values().map((setting, index) => ());\r\n //settingIndName = options[0].props.value;\r\n }\r\n } else if (settingType == SettingType.AuxIndicator) {\r\n if (aux) {\r\n options = [];\r\n }\r\n }\r\n\r\n const onIndiArgChanged = (indiName: any, key: string, value: number) => {\r\n console.log(value);\r\n const action: IAction = {\r\n type: actionType.ChangeArg,\r\n args: { indiName, key, value }\r\n };\r\n dispatch(action);\r\n };\r\n\r\n const onColorChanged = (indiName: string, lineName: string, color: string) => {\r\n const args: IChangeIndiLineColorArgs = { indiName, lineName, color };\r\n const action: IAction = {\r\n type: actionType.ChangeLineColor,\r\n args: args\r\n };\r\n dispatch(action);\r\n }\r\n\r\n const onBarColorChanged = (infoName: string, color: string) => {\r\n const args: IInfoItem = { name: infoName, value: color };\r\n const action: IAction = {\r\n type: actionType.ChangeBarColor,\r\n args: args\r\n };\r\n dispatch(action);\r\n }\r\n\r\n const spanLabel = 5;\r\n const spanValue = 6\r\n const spanRigth = 24 - spanValue - spanLabel;\r\n // const spanSpace = 24 - 2 * (spanValue + spanLabel);\r\n\r\n let cols: JSX.Element[] = [];\r\n\r\n let currentItem = currentSettingItem || settingItem;\r\n // debugger;\r\n let indiName = currentItem?.indicatorName as string;\r\n if (currentItem) {\r\n const { args, lineSettings } = currentItem;\r\n if (args) {\r\n cols = merge(args.entries().map((arg, index) => (\r\n [\r\n {arg.key === \"windowSize\" ? t(\"Chart.Period\") : arg.key},\r\n \r\n { onIndiArgChanged(indiName, arg.key, value); }}\r\n />\r\n ,\r\n \r\n ]\r\n )));\r\n }\r\n\r\n if (cols.length % 2)\r\n cols.push();\r\n\r\n // console.log(\"before render IndicatorSelector, arg.value:\", cols[1]);\r\n if (lineSettings) {\r\n cols = cols.concat(\r\n merge(lineSettings.entries().map((arg, index) => (\r\n [\r\n {arg.key},\r\n \r\n { onColorChanged(indiName, arg.key, color); }}\r\n />\r\n ,\r\n // \r\n ])\r\n )));\r\n }\r\n }\r\n\r\n // console.log(\"before render IndicatorSelector, currentItem.indicatorName:\" + currentItem?.indicatorName);\r\n\r\n const padding = { paddingTop: 10 };\r\n return (\r\n <>\r\n \r\n \r\n \r\n {t('Chart.MainIndicator')}\r\n {t('Chart.AuxIndicator')}\r\n {t('Chart.Colors')}\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n\r\n {settingType != SettingType.General && <>\r\n {t('Chart.IndicatorProperty')}\r\n \r\n {t('Chart.Indicator')}\r\n \r\n \r\n \r\n \r\n\r\n {cols}\r\n \r\n }\r\n\r\n \r\n \r\n );\r\n}","import './style/chart.css';\r\nimport { format } from \"d3-format\";\r\nimport React, { useEffect, useReducer, useRef, useState } from 'react';\r\nimport { ChartCoreWrap } from './ChartCore';\r\nimport { ChartContext, reducer } from './chartContext';\r\nimport { actionType, IAction, IChartConfig, IChildRef, timeFormater, ViewType } from './typeDefine';\r\nimport { withOHLCData } from './data';\r\n// import { HeaderBar } from './HeaderBar';\r\nimport { IChartDataSource } from './data/dataSource';\r\nimport Draggable from 'react-draggable';\r\nimport { ChartTooltip } from './Indicator/tooltip/ChartTooltip';\r\nimport Modal from 'antd/lib/modal/Modal';\r\nimport { IndicatorSelector } from './IndicatorSelector';\r\n// import { customAlphabet } from 'nanoid';\r\n// const nanoid = customAlphabet('abcdef1234567890', 6);\r\n\r\nexport interface IChartProps {\r\n chartConfig: IChartConfig;\r\n dataSource: IChartDataSource;\r\n priceDecimals: number;\r\n isPad: boolean;\r\n theme: string;\r\n company?: string;\r\n\r\n // notify container fullScreen state:\r\n onChartFullSceen: () => void;\r\n onChartExitFullScreen: () => void;\r\n\r\n // setViewType: (viewtype: ViewType) => void;\r\n visible?: boolean;\r\n commandDispatcher: any;\r\n readonly chartIndex: number[]; // [index,count]\r\n}\r\n\r\nexport default function ChartView(props: IChartProps)\r\n{\r\n const instrumentCode = useRef(props.dataSource.instrumentCode());\r\n // console.log(\"instrumentCode\", instrumentCode.current, props.dataSource.instrumentCode());\r\n const isSymbolChanged = instrumentCode.current !== props.dataSource.instrumentCode();\r\n if (isSymbolChanged) instrumentCode.current = props.dataSource.instrumentCode();\r\n\r\n let [chartConfig, dispatch] = useReducer(reducer, props.chartConfig);\r\n const [isFullScreen, setFullScreen] = useState(false);\r\n const [isLoadingData, setisLoadingData] = useState(true);\r\n\r\n if (isSymbolChanged) {\r\n const action: IAction = {\r\n type: actionType.ReplaceSettings,\r\n args: props.chartConfig\r\n };\r\n dispatch(action);\r\n }\r\n\r\n // performance optimization:\r\n const childRef: IChildRef = {\r\n setData: (data: any) => { console.error(\"ChartView.childRef.setData, cannot be called here.\"); },\r\n onGetMoreData: (endTime: Date, xExtents: number[]) => {\r\n console.error(\"ChartView.childRef.onGetMoreData, cannot be called here.\");\r\n },\r\n onLoadingData: (isLoading: boolean) => {\r\n setisLoadingData(isLoading);\r\n }\r\n };\r\n const dataBridgeRef = useRef(childRef);\r\n if (isSymbolChanged) dataBridgeRef.current = childRef;\r\n const dataBridge = dataBridgeRef.current;\r\n\r\n const onCurrentBarChanged = (barDatas: any) => {\r\n //setCurrentBarDatas(barDatas); // will cause ChartView re-render. think to remove the state\r\n dataBridge.setData(barDatas);\r\n }\r\n const onGetMoreData = (endTime: Date, xExtents: number[]) => {\r\n console.log(\"onGetMoreData\", { endTime: timeFormater(endTime), xExtents });\r\n dataBridge.onGetMoreData(endTime, xExtents);\r\n }\r\n\r\n const ChartMain = withOHLCData(props.dataSource, dataBridge, props.commandDispatcher)(ChartCoreWrap);\r\n const CoreRef = useRef(ChartMain);\r\n if (isSymbolChanged) CoreRef.current = ChartMain;\r\n const Core = CoreRef.current;\r\n\r\n const onFullSceen = () => {\r\n setFullScreen(true);\r\n props.onChartFullSceen();\r\n document.documentElement.requestFullscreen();\r\n }\r\n\r\n const onExitFullScreen = () => {\r\n setFullScreen(false);\r\n props.onChartExitFullScreen();\r\n document.exitFullscreen();\r\n }\r\n const pricesDisplayFormat = format(`.${props.priceDecimals}f`);\r\n\r\n // console.log(\"✨ before render ChartView, isFullScreen, theme:\", isFullScreen, props.theme);\r\n const waterMarkColor = props.theme === \"white\" ? \"rgba(60,60,60,0.2)\" : \"rgba(60,60,60,0.5)\";\r\n const yAxisWidth = 55;\r\n\r\n const copyright = props.chartIndex[0] === 0 && props.company && props.visible ? (\r\n
\r\n Power by \r\n {props.company}\r\n
) : undefined;\r\n\r\n\r\n const [isModalVisible, setisModalVisible] = useState(false);\r\n const addIndicator = () => {\r\n setisModalVisible(true);\r\n };\r\n const handleClose = () => {\r\n setisModalVisible(false);\r\n };\r\n\r\n const display = props.visible ? 'block' : 'none';\r\n\r\n useEffect(() => {\r\n props.commandDispatcher.addIndicator = addIndicator;\r\n }, []); // second arg use empty [] to simulate componentDidMount.\r\n \r\n // if (chartConfig && chartConfig.indictorsSettings) {\r\n // if (chartConfig.indictorsSettings.mainIndictorsSettings === undefined) {\r\n // console.log(\"✨ mainIndictorsSettings is undefined!!!!\");\r\n // }\r\n // } else {\r\n // console.log(\"✨ indictorsSettings is undefined!!!!\");\r\n // }\r\n\r\n return (\r\n \r\n
\r\n \r\n
\r\n {props.dataSource.instrumentDescription()}\r\n
\r\n {!isLoadingData && \r\n
\r\n \r\n
\r\n
\r\n }\r\n
\r\n {copyright}\r\n\r\n \r\n document.body.style.overflow = \"auto\"}\r\n >\r\n \r\n \r\n
\r\n );\r\n}","function e(t,i){const n={...t};for(const o in i)\"object\"!=typeof t[o]||null===t[o]||Array.isArray(t[o])?void 0!==i[o]&&(n[o]=i[o]):n[o]=e(t[o],i[o]);return n}const t={mobile:{disabled_features:[\"left_toolbar\",\"header_widget\",\"timeframes_toolbar\",\"edit_buttons_in_legend\",\"context_menus\",\"control_bar\",\"border_around_the_chart\"],enabled_features:[]}},i={width:800,height:500,interval:\"1D\",timezone:\"Etc/UTC\",container:\"\",library_path:\"\",locale:\"en\",widgetbar:{details:!1,watchlist:!1,watchlist_settings:{default_symbols:[]}},overrides:{\"mainSeriesProperties.showCountdown\":!1},studies_overrides:{},trading_customization:{position:{},order:{}},brokerConfig:{configFlags:{}},fullscreen:!1,autosize:!1,disabled_features:[],enabled_features:[],debug:!1,logo:{},time_frames:[{text:\"5y\",resolution:\"1W\"},{text:\"1y\",resolution:\"1W\"},{text:\"6m\",resolution:\"120\"},{text:\"3m\",resolution:\"60\"},{text:\"1m\",resolution:\"30\"},{text:\"5d\",resolution:\"5\"},{text:\"1d\",resolution:\"1\"}],client_id:\"0\",user_id:\"0\",charts_storage_api_version:\"1.0\",favorites:{intervals:[],chartTypes:[]}};let n=!1;function o(){return\"CL v22.032 (internal id e2a841ff @ 2022-07-06T11:53:07.702Z)\"}const s=class{constructor(o){if(this._id=`tradingview_${(1048576*(1+Math.random())|0).toString(16).substring(1)}`,this._ready=!1,this._readyHandlers=[],this._onWindowResize=this._autoResizeChart.bind(this),!o.datafeed)throw new Error(\"Datafeed is not defined\");if(this._options=e(i,o),o.preset){const e=t[o.preset];e?(void 0!==this._options.disabled_features?this._options.disabled_features=this._options.disabled_features.concat(e.disabled_features):this._options.disabled_features=e.disabled_features,void 0!==this._options.enabled_features?this._options.enabled_features=this._options.enabled_features.concat(e.enabled_features):this._options.enabled_features=e.enabled_features):console.warn(\"Unknown preset: `\"+o.preset+\"`\")}\"Dark\"===this._options.theme&&void 0===this._options.loading_screen&&(this._options.loading_screen={backgroundColor:\"#131722\"}),this._options.debug&&(n||(n=!0,console.log(\"Using CL v22.032 (internal id e2a841ff @ 2022-07-06T11:53:07.702Z)\"))),this._create()}onChartReady(e){this._ready?e.call(this):this._readyHandlers.push(e)}headerReady(){return this._innerWindowLoaded.then((()=>this._innerWindow().headerReady()))}onGrayedObjectClicked(e){this._doWhenInnerApiLoaded((t=>{t.onGrayedObjectClicked(e)}))}onShortcut(e,t){this._doWhenInnerWindowLoaded((i=>{i.createShortcutAction(e,t)}))}subscribe(e,t){this._doWhenInnerApiLoaded((i=>{i.subscribe(e,t)}))}unsubscribe(e,t){this._doWhenInnerApiLoaded((i=>{i.unsubscribe(e,t)}))}chart(e){return this._innerAPI().chart(e)}getLanguage(){return this._options.locale}setSymbol(e,t,i){this._innerAPI().changeSymbol(e,t,i)}remove(){window.removeEventListener(\"resize\",this._onWindowResize),this._readyHandlers.splice(0,this._readyHandlers.length),delete window[this._id],this._iFrame.parentNode&&this._iFrame.parentNode.removeChild(this._iFrame)}closePopupsAndDialogs(){this._doWhenInnerApiLoaded((e=>{e.closePopupsAndDialogs()}))}selectLineTool(e){this._innerAPI().selectLineTool(e)}selectedLineTool(){return this._innerAPI().selectedLineTool()}save(e){this._innerAPI().saveChart(e)}load(e,t){this._innerAPI().loadChart({json:e,extendedData:t})}getSavedCharts(e){this._innerAPI().getSavedCharts(e)}loadChartFromServer(e){this._innerAPI().loadChartFromServer(e)}saveChartToServer(e,t,i){this._innerAPI().saveChartToServer(e,t,i)}removeChartFromServer(e,t){this._innerAPI().removeChartFromServer(e,t)}onContextMenu(e){this._doWhenInnerApiLoaded((t=>{t.onContextMenu(e)}))}createButton(e){return this._innerWindow().createButton(e)}createDropdown(e){return this._innerWindow().createDropdown(e)}showNoticeDialog(e){this._doWhenInnerApiLoaded((t=>{t.showNoticeDialog(e)}))}showConfirmDialog(e){this._doWhenInnerApiLoaded((t=>{t.showConfirmDialog(e)}))}showLoadChartDialog(){this._innerAPI().showLoadChartDialog()}showSaveAsChartDialog(){this._innerAPI().showSaveAsChartDialog()}symbolInterval(){return this._innerAPI().getSymbolInterval()}mainSeriesPriceFormatter(){return this._innerAPI().mainSeriesPriceFormatter()}getIntervals(){return this._innerAPI().getIntervals()}getStudiesList(){return this._innerAPI().getStudiesList()}getStudyInputs(e){return this._innerAPI().getStudyInputs(e)}addCustomCSSFile(e){this._innerWindow().addCustomCSSFile(e)}applyOverrides(t){this._options=e(this._options,{overrides:t}),this._doWhenInnerWindowLoaded((e=>{e.applyOverrides(t)}))}applyStudiesOverrides(e){this._doWhenInnerWindowLoaded((t=>{t.applyStudiesOverrides(e)}))}watchList(){return this._innerAPI().watchlist()}news(){return this._innerAPI().news()}widgetbar(){return this._innerAPI().widgetbar()}activeChart(){return this._innerAPI().activeChart()}chartsCount(){return this._innerAPI().chartsCount()}layout(){return this._innerAPI().layout()}setLayout(e){this._innerAPI().setLayout(e)}layoutName(){return this._innerAPI().layoutName()}changeTheme(e,t){return this._innerWindow().changeTheme(e,t)}getTheme(){return this._innerWindow().getTheme()}takeScreenshot(){this._doWhenInnerApiLoaded((e=>{e.takeScreenshot()}))}lockAllDrawingTools(){return this._innerAPI().lockAllDrawingTools()}hideAllDrawingTools(){return this._innerAPI().hideAllDrawingTools()}drawOnAllCharts(e){this._innerAPI().drawOnAllCharts(e)}magnetEnabled(){return this._innerAPI().magnetEnabled()}magnetMode(){return this._innerAPI().magnetMode()}undoRedoState(){return this._innerAPI().undoRedoState()}setIntervalLinkingEnabled(e){this._innerAPI().setIntervalLinkingEnabled(e)}setTimeFrame(e){this._innerAPI().setTimeFrame(e)}symbolSync(){return this._innerAPI().symbolSync()}intervalSync(){return this._innerAPI().intervalSync()}crosshairSync(){return this._innerAPI().crosshairSync()}timeSync(){return this._innerAPI().timeSync()}getAllFeatures(){return this._innerWindow().getAllFeatures()}clearUndoHistory(){return this._innerAPI().clearUndoHistory()}undo(){return this._innerAPI().undo()}redo(){return this._innerAPI().redo()}startFullscreen(){this._innerAPI().startFullscreen()}exitFullscreen(){this._innerAPI().exitFullscreen()}takeClientScreenshot(e){return this._innerAPI().takeClientScreenshot(e)}navigationButtonsVisibility(){return this._innerWindow().getNavigationButtonsVisibility()}paneButtonsVisibility(){return this._innerWindow().getPaneButtonsVisibility()}dateFormat(){return this._innerWindow().getDateFormat()}_innerAPI(){return this._innerWindow().tradingViewApi}_innerWindow(){return this._iFrame.contentWindow}_doWhenInnerWindowLoaded(e){this._ready?e(this._innerWindow()):this._innerWindowLoaded.then((()=>{e(this._innerWindow())}))}_doWhenInnerApiLoaded(e){this._doWhenInnerWindowLoaded((t=>{t.doWhenApiIsReady((()=>e(this._innerAPI())))}))}_autoResizeChart(){this._options.fullscreen&&(this._iFrame.style.height=window.innerHeight+\"px\")}_create(){const e=this._render();this._options.container_id&&console.warn(\"`container_id` is now deprecated. Please use `container` instead to either still pass a string or an `HTMLElement`.\");const t=this._options.container_id||this._options.container,i=\"string\"==typeof t?document.getElementById(t):t;if(null===i)throw new Error(`There is no such element - #${this._options.container}`);i.innerHTML=e,this._iFrame=i.querySelector(`#${this._id}`);const n=this._iFrame;(this._options.autosize||this._options.fullscreen)&&(n.style.width=\"100%\",this._options.fullscreen||(n.style.height=\"100%\")),window.addEventListener(\"resize\",this._onWindowResize),this._onWindowResize(),this._innerWindowLoaded=new Promise((e=>{const t=()=>{n.removeEventListener(\"load\",t,!1),e()};n.addEventListener(\"load\",t,!1)})),this._innerWindowLoaded.then((()=>{this._innerWindow().widgetReady((()=>{this._ready=!0;for(const e of this._readyHandlers)try{e.call(this)}catch(e){console.error(e)}this._innerWindow().initializationFinished()}))}))}_render(){const e=window;if(e[this._id]={datafeed:this._options.datafeed,customFormatters:this._options.custom_formatters||this._options.customFormatters,brokerFactory:this._options.broker_factory||this._options.brokerFactory,overrides:this._options.overrides,studiesOverrides:this._options.studies_overrides,tradingCustomization:this._options.trading_customization,disabledFeatures:this._options.disabled_features,enabledFeatures:this._options.enabled_features,brokerConfig:this._options.broker_config||this._options.brokerConfig,restConfig:this._options.restConfig,favorites:this._options.favorites,logo:this._options.logo,numeric_formatting:this._options.numeric_formatting,rss_news_feed:this._options.rss_news_feed,newsProvider:this._options.news_provider,loadLastChart:this._options.load_last_chart,saveLoadAdapter:this._options.save_load_adapter,loading_screen:this._options.loading_screen,settingsAdapter:this._options.settings_adapter,getCustomIndicators:this._options.custom_indicators_getter,additionalSymbolInfoFields:this._options.additional_symbol_info_fields,headerWidgetButtonsMode:this._options.header_widget_buttons_mode,customTranslateFunction:this._options.custom_translate_function,symbolSearchComplete:this._options.symbol_search_complete,contextMenu:this._options.context_menu,settingsOverrides:this._options.settings_overrides},this._options.saved_data)e[this._id].chartContent={json:this._options.saved_data},this._options.saved_data_meta_info&&(e[this._id].chartContentExtendedData=this._options.saved_data_meta_info);else if(!this._options.load_last_chart&&!this._options.symbol)throw new Error(\"Symbol is not defined: either 'symbol' or 'load_last_chart' option must be set\");const t=(this._options.library_path||\"\")+`${encodeURIComponent(this._options.locale)}-tv-chart.e2a841ff.html#symbol=`+encodeURIComponent(this._options.symbol||\"\")+\"&interval=\"+encodeURIComponent(this._options.interval)+(this._options.timeframe?\"&timeframe=\"+encodeURIComponent(this._options.timeframe):\"\")+(this._options.toolbar_bg?\"&toolbarbg=\"+encodeURIComponent(this._options.toolbar_bg.replace(\"#\",\"\")):\"\")+(this._options.studies_access?\"&studiesAccess=\"+encodeURIComponent(JSON.stringify(this._options.studies_access)):\"\")+\"&widgetbar=\"+encodeURIComponent(JSON.stringify(this._options.widgetbar))+(this._options.drawings_access?\"&drawingsAccess=\"+encodeURIComponent(JSON.stringify(this._options.drawings_access)):\"\")+\"&timeFrames=\"+encodeURIComponent(JSON.stringify(this._options.time_frames))+\"&locale=\"+encodeURIComponent(this._options.locale)+\"&uid=\"+encodeURIComponent(this._id)+\"&clientId=\"+encodeURIComponent(String(this._options.client_id))+\"&userId=\"+encodeURIComponent(String(this._options.user_id))+(this._options.charts_storage_url?\"&chartsStorageUrl=\"+encodeURIComponent(this._options.charts_storage_url):\"\")+(this._options.charts_storage_api_version?\"&chartsStorageVer=\"+encodeURIComponent(this._options.charts_storage_api_version):\"\")+(this._options.custom_css_url?\"&customCSS=\"+encodeURIComponent(this._options.custom_css_url):\"\")+(this._options.custom_font_family?\"&customFontFamily=\"+encodeURIComponent(this._options.custom_font_family):\"\")+(this._options.auto_save_delay?\"&autoSaveDelay=\"+encodeURIComponent(String(this._options.auto_save_delay)):\"\")+\"&debug=\"+encodeURIComponent(String(this._options.debug))+(this._options.snapshot_url?\"&snapshotUrl=\"+encodeURIComponent(this._options.snapshot_url):\"\")+(this._options.timezone?\"&timezone=\"+encodeURIComponent(this._options.timezone):\"\")+(this._options.study_count_limit?\"&studyCountLimit=\"+encodeURIComponent(String(this._options.study_count_limit)):\"\")+(this._options.symbol_search_request_delay?\"&ssreqdelay=\"+encodeURIComponent(String(this._options.symbol_search_request_delay)):\"\")+(this._options.compare_symbols?\"&compareSymbols=\"+encodeURIComponent(JSON.stringify(this._options.compare_symbols)):\"\")+(this._options.theme?\"&theme=\"+encodeURIComponent(String(this._options.theme)):\"\")+(this._options.header_widget_buttons_mode?\"&header_widget_buttons_mode=\"+encodeURIComponent(String(this._options.header_widget_buttons_mode)):\"\")+(this._options.time_scale?\"&time_scale=\"+encodeURIComponent(JSON.stringify(this._options.time_scale)):\"\");return''}};window.TradingView=window.TradingView||{},window.TradingView.version=o;export{o as version,s as widget};\r\n","import { timeParse } from \"d3-time-format\";\r\nimport { Bar } from \"../../charting_library/datafeed-api\";\r\nimport { IOHLCData } from \"./iOHLCData\";\r\nexport const parseDatetime = timeParse(\"%Y%m%d%H%M%S\");\r\n\r\nexport interface iExChartData {\r\n Date: string;\r\n Open: number;\r\n High: number;\r\n Low: number;\r\n Close: number;\r\n}\r\n\r\n// export const convertData = (d: iExChartData) => {\r\n// let date = parseDatetime(d.Date);\r\n// let close = +d.Close;\r\n// let high = +d.High;\r\n// let low = +d.Low;\r\n// let open = +d.Open;\r\n// let volume = 0;\r\n// return { date, close, high, low, open, volume } as IOHLCData;\r\n// }\r\n\r\nexport const convertData = (item: string) => {\r\n const d = item.split(',');\r\n let date = parseDatetime(d[0]) as Date;\r\n let open = +d[1];\r\n let close = +d[2];\r\n let high = +d[3];\r\n let low = +d[4];\r\n let volume = 0;\r\n return { date, close, high, low, open, volume } as IOHLCData;\r\n}\r\n\r\nexport function chartDataParser(result: any) {\r\n //console.log(\"getChartDataReturned:\", result);\r\n try {\r\n const data = JSON.parse(result);\r\n if (data.Result.error) {\r\n return [false, data.Result.error];\r\n }\r\n else {\r\n const quotaions = data.Result.content_result.ChartQuotaions;\r\n if (quotaions === '') {\r\n return [false, 'no data'];\r\n }\r\n else {\r\n const datas = quotaions.split('|');\r\n const chartDatas: IOHLCData[] = datas.map(convertData);\r\n return [true, chartDatas];\r\n }\r\n }\r\n } catch (err) {\r\n console.log({result, err});\r\n return [false, 'chart data parse error'];\r\n }\r\n}\r\n\r\nexport function chartDataParserForTv(resolution: string) {\r\n\r\n return (result: any) => {\r\n\r\n //console.log(\"getChartDataReturned:\", result);\r\n const data = JSON.parse(result);\r\n if (data.Result.error) {\r\n return [false, data.Result.error];\r\n }\r\n else {\r\n const quotaions = data.Result.content_result.ChartQuotaions;\r\n if (quotaions === '') {\r\n return [false, 'no data'];\r\n }\r\n else {\r\n const datas = quotaions.split('|');\r\n const chartDatas = datas.map((item: string) => {\r\n const { date, close, high, low, open, volume } = convertData(item);\r\n if (resolution === '1D' || resolution === '1W' || resolution === '1M') {\r\n const timeOffSet = 8; // +8 时区\r\n return { time: date.getTime() + timeOffSet * 60 * 60 * 1_000, close, high, low, open, volume };\r\n // } else if (resolution === '180') {\r\n // const timeOffSet = 1; // 3H add 1 hour or anthor adjust do not take effect,so remove 3H and add 8H\r\n // return { time: date.getTime() + timeOffSet * 60 * 60 * 1_000, close, high, low, open, volume };\r\n } else {\r\n return { time: date.getTime(), close, high, low, open, volume };\r\n }\r\n });\r\n return [true, chartDatas];\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function periodBeginTimeParser(result: any) {\r\n const data = JSON.parse(result);\r\n if (data.Result.error) {\r\n return [false, data.Result.error];\r\n }\r\n else {\r\n const dates = data.Result.content_result.split(\";\");\r\n return [true, dates];\r\n }\r\n}\r\n\r\nexport function instrumentPeriodBeginTimeParser(result: any) {\r\n const data = JSON.parse(result);\r\n if (data.Result.error) {\r\n return [false, data.Result.error];\r\n }\r\n else {\r\n return [true, data.Result.content_result.FixPeriodBeginTimes];\r\n } \r\n}\r\n\r\nconst chartDate_tv2orig = (resolution: string, date: number) => {\r\n let tv_date = date;\r\n if (resolution === '1D' || resolution === '1W' || resolution === '1M') {\r\n const timeOffSet = 8; // +8 时区\r\n tv_date = date - timeOffSet * 60 * 60 * 1_000;\r\n }\r\n return new Date(tv_date);\r\n}\r\nconst chartDate_orig2tv = (resolution: string, date: Date) => {\r\n if (resolution === '1D' || resolution === '1W' || resolution === '1M') {\r\n const timeOffSet = 8; // +8 时区\r\n return date.getTime() + timeOffSet * 60 * 60 * 1_000;\r\n } else {\r\n return date.getTime();\r\n }\r\n}\r\n\r\nexport function TvBarToOrigBar(resolution: string): (tvBar: Bar) => IOHLCData {\r\n return (tvBar: Bar) => {\r\n const { time, open, high, low, close, volume } = tvBar;\r\n const date = chartDate_tv2orig(resolution, time);\r\n return { date, open, high, low, close, volume } as IOHLCData;\r\n }\r\n}\r\n\r\nexport function OrigBarToTvBar(resolution: string): (origBar: IOHLCData) => Bar {\r\n return (origBar: IOHLCData) => {\r\n let { date, open, high, low, close, volume } = origBar;\r\n const time = chartDate_orig2tv(resolution, date);\r\n return { time, open, high, low, close, volume } as Bar;\r\n }\r\n}","import {\r\n\tBar,\r\n\tLibrarySymbolInfo,\r\n\tResolutionString,\r\n\tResolveCallback,\r\n\tSubscribeBarsCallback,\r\n\tSymbolResolveExtension,\r\n\tErrorCallback,\r\n} from '../../charting_library/datafeed-api';\r\nimport { IOHLCData } from '../data';\r\nimport { IAsyncResult } from '../data/asyncResult';\r\nimport { chartDataParserForTv, OrigBarToTvBar } from '../data/chartDataParser';\r\nimport { IChartDataSource, ICommService } from '../data/dataSource';\r\nimport { ChartType, ResolutionToChartType, timeFormater } from '../typeDefine';\r\n\r\n// const comm = new CommClient('http://10.2.12.1:8080/signalr');\r\n// comm.start(OnConncted, OnConnctFailed);\r\n\r\nexport default function (priceDecimals: number) {\r\n\tlet _instrumentId: string;\r\n\tlet _instrumentCode: string;\r\n\tlet _quotePolicyId: string;\r\n\tlet _chartType: ChartType;\r\n\tlet _pricescale: number = Math.pow(10, priceDecimals);\r\n\r\n\tlet _intraday_multipliers = ['1', '5', '15', '30', '60', '120', '180', '240', '300', '360', '420', '480'];\r\n\tlet _resolutions = [..._intraday_multipliers, '1D', '1W', '1M'] as ResolutionString[];\r\n\tlet _commService: ICommService;\r\n\tlet _dataSource: IChartDataSource;\r\n\tlet _lastbar: Bar;\r\n\tlet _firstbar: Bar;\r\n\tlet _resolution: ResolutionString;\r\n\t\r\n\tconst dataApi = () => () => {\r\n\t\t/** Do Nothing */\r\n\t};\r\n\r\n\t// dataApi.commService = (service?: ICommService) => {\r\n\t// \tif (service === void 0) {\r\n\t// \t\treturn _commService;\r\n\t// \t}\r\n\t// \t_commService = service;\r\n\t// \treturn dataApi;\r\n\t// };\r\n\r\n\tdataApi.setDataSource = (dataSource: IChartDataSource) => {\r\n\t\t_dataSource = dataSource;\r\n\t\t_instrumentId = dataSource.instrumentId();\r\n\t\t_instrumentCode = dataSource.instrumentCode();\r\n\t\t_quotePolicyId = dataSource.quotePolicyId();\r\n\t\t_chartType = dataSource.chartType();\r\n\t\t_commService = dataSource.commService();\r\n\t};\r\n\r\n\t// dataApi.instrumentId = (newId?: string) => {\r\n\t// if (newId === void 0) {\r\n\t// return _instrumentId;\r\n\t// }\r\n\t// _instrumentId = newId;\r\n\t// return dataApi;\r\n\t// }\r\n\r\n\t// dataApi.instrumentCode = (x?: string) => {\r\n\t// if (x === void 0) {\r\n\t// return _instrumentCode;\r\n\t// }\r\n\t// _instrumentCode = x;\r\n\t// return dataApi;\r\n\t// }\r\n\r\n\t// dataApi.quotePolicyId = (newId?: string) => {\r\n\t// if (newId === void 0) {\r\n\t// return _quotePolicyId;\r\n\t// }\r\n\t// _quotePolicyId = newId;\r\n\t// return dataApi;\r\n\t// }\r\n\r\n\t// dataApi.chartType = (newType?: number) => {\r\n\t// if (newType === void 0) {\r\n\t// return _chartType;\r\n\t// }\r\n\t// _chartType = newType;\r\n\t// if (dataApi.OnChartTypeChanged) {\r\n\t// dataApi.OnChartTypeChanged();\r\n\t// }\r\n\t// return dataApi;\r\n\t// }\r\n\r\n\r\n\t// @ts-ignore\r\n\tdataApi.onReady = cb => {\r\n\t\tconsole.log('=====onReady running')\r\n\t\tconst config = {\r\n\t\t\tsupported_resolutions: _resolutions\r\n\t\t};\r\n\t\t\r\n\t\tsetTimeout(() => cb(config), 0);\r\n\t};\r\n\r\n\t// @ts-ignore\r\n\tdataApi.searchSymbols = (userInput, exchange, symbolType, onResultReadyCallback) => {\r\n\t\tconsole.log('====Search Symbols running');\r\n\t};\r\n\r\n\tdataApi.resolveSymbol = (symbolName: string, onResolve: ResolveCallback, onError: ErrorCallback, extension?: SymbolResolveExtension)=>{\r\n\t\t// expects a symbolInfo object in response\r\n\t\tconsole.log('======resolveSymbol running');\r\n\r\n\t\tvar symbol_stub: LibrarySymbolInfo = {\r\n\t\t\tname: symbolName,\r\n\t\t\tdescription: _dataSource.instrumentDescription(),\r\n\t\t\ttype: 'forex',\r\n\t\t\tsession: '24x7',\r\n\t\t\ttimezone: 'Etc/UTC', //'Asia/Hong_Kong', // set to Asia/Hong_Kong will cause realtime price line of D W M chart to not move.\r\n\t\t\tticker: symbolName,\r\n\t\t\texchange: 'iEx',\r\n\t\t\tminmov: 1,\r\n\t\t\tpricescale: _pricescale,\r\n\t\t\thas_intraday: true,\r\n\t\t\tintraday_multipliers: _intraday_multipliers,\r\n\t\t\tsupported_resolutions: _resolutions,\r\n\t\t\tvolume_precision: 8,\r\n\t\t\tdata_status: 'streaming',\r\n\t\t\thas_daily: true,\r\n\t\t\thas_weekly_and_monthly:true,\r\n\r\n\t\t\tfull_name: '',\r\n\t\t\tlisted_exchange: '',\r\n\t\t\tformat: 'price',\r\n\t\t\thas_no_volume: true,\r\n\t\t};\r\n\r\n\t\tsetTimeout(function () {\r\n\t\t\tonResolve(symbol_stub)\r\n\t\t\tconsole.log('Resolving that symbol....', symbol_stub)\r\n\t\t}, 0);\r\n\t\t// onError('Not feeling it today')\r\n\t};\r\n\r\n\t// @ts-ignore\r\n\tdataApi.getBars = function (symbolInfo, resolution, periodParams, onResult, onError) {\r\n\t\t_resolution = resolution;\r\n\t\tconst fromTime = periodParams.from * 1000;\r\n\t\tconst from = timeFormater(new Date(fromTime));\r\n\t\t// const to = timeFormater(new Date(periodParams.to * 1000));\r\n\t\tconst toTime = periodParams.to * 1000;\r\n\t\tlet to = new Date(toTime);\r\n\r\n\t\t// const chartType = ResolutionToChartType(resolution);\r\n\t\t// _dataSource.chartType(chartType); will cause chartType reset to Minuts1 then siwtch back to other instrument that chartType is not Minuts1.\r\n\r\n\t\tif (periodParams.firstDataRequest) {\r\n\t\t\tconst datas = _dataSource.getDataFromBuffer(fromTime, 0);\r\n\t\t\tconst bars = datas.map(OrigBarToTvBar(resolution));\r\n\t\t\t_firstbar = bars[0];\r\n\t\t\t_lastbar = bars[bars.length - 1];\r\n\t\t\tconsole.log(`tvtrace: getBars for init data, data count:${bars.length}`);\r\n\t\t\tsetTimeout(() => onResult(bars), 0);\r\n\t\t} else {\r\n\t\t\t// let result: IAsyncResult = periodParams.firstDataRequest ?\r\n\t\t\t// \t_dataSource.GetInitChartData(500) :\r\n\t\t\t// \t_dataSource.GetMoreChartData(to, 300);\r\n\r\n\t\t\t// const to = new Date(_firstbar.time);\r\n\r\n\t\t\tif (_firstbar && toTime < _firstbar.time) {\r\n\t\t\t\tto = new Date(_firstbar.time);\r\n\t\t\t}\r\n\r\n\t\t\tlet result: IAsyncResult = _dataSource.GetMoreChartData(to, 300);\r\n\t\t\tresult.resultParser(chartDataParserForTv(resolution));\r\n\t\t\t// const result = _commService.getChartData(_instrumentId, _quotePolicyId, from, to,\r\n\t\t\t// \tdataCycleParameter, requestType, rangeType, 'GetFixPeriodData', _chartType).resultParser(chartDataParserForTv);\r\n\t\t\r\n\t\t\t// console.log('=====getBars running', { symbolInfo, resolution, periodParams, from, to, firstbarTime: new Date(_firstbar.time) });\r\n\r\n\t\t\tresult.state(_resolution);\r\n\t\t\tresult.done((bars, state) => {\r\n\t\t\t\tif (_resolution != state) {\r\n\t\t\t\t\tconsole.log('=====getBars resolution not equal, exit done.', { resolution:_resolution });\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (bars.length) {\r\n\t\t\t\t\tconst lastbar = bars[bars.length - 1];\r\n\t\t\t\t\t// if (periodParams.firstDataRequest) {\r\n\t\t\t\t\t// \t_lastbar = lastbar;\r\n\t\t\t\t\t// \tconsole.log('getBar done invokeId:' + result.instanceId(),\r\n\t\t\t\t\t// \t\t{ dataCount: bars.length, firstbar: bars[0], firstbarTime: bars[0].time, lastbar, lastbarTime: lastbar.time });\r\n\t\t\t\t\t// }\r\n\r\n\t\t\t\t\t_firstbar = bars[0];\r\n\t\t\t\t\tif (bars.length === 1 && _firstbar.time === bars[0].time) {\r\n\t\t\t\t\t\tonResult([], { noData: true });\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tonResult(bars, { noData: false });\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconsole.log('getBar done invokeId:' + result.instanceId(),\r\n\t\t\t\t\t\t{ dataCount: bars.length, firstbar: bars[0], firstbarTime: bars[0].time, lastbar, lastbarTime: lastbar.time });\r\n\t\t\t\t} else {\r\n\t\t\t\t\tonResult(bars, { noData: true });\r\n\t\t\t\t}\r\n\t\t\t}).fail(err => {\r\n\t\t\t\tif (err === 'no data') {\r\n\t\t\t\t\tonResult([], { noData: true });\r\n\t\t\t\t} else {\r\n\t\t\t\t\tonError(err);\r\n\t\t\t\t}\r\n\t\t\t\tconsole.log('getBar error', { err });\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\tdataApi.subscribeBars = (\r\n\t\tsymbolInfo: LibrarySymbolInfo,\r\n\t\tresolution: ResolutionString,\r\n\t\tonTick: SubscribeBarsCallback,\r\n\t\tlistenerGuid: string, onResetCacheNeededCallback: () => void) => {\r\n\t\tconsole.log('=====subscribeBars runnning', {symbolInfo});\r\n\t\t// stream.subscribeBars(symbolInfo, resolution, onRealtimeCallback, subscribeUID);\r\n\r\n\t\tconst updateCallback = (bar: IOHLCData, ask?: number) => {\r\n\t\t\tonTick(OrigBarToTvBar(resolution)(bar));\r\n\t\t};\r\n\r\n\t\tif (_lastbar) {\r\n\t\t\t_dataSource.registerLastbarUpdateCallback(listenerGuid, undefined, updateCallback);\r\n\t\t} else {\r\n\t\t\tconsole.error('_lastbar not ready.');\r\n\t\t}\r\n\t};\r\n\r\n\tdataApi.unsubscribeBars = (subscriberUID: string) => {\r\n\t\tconsole.log('=====unsubscribeBars running');\r\n\t\t// stream.unsubscribeBars(subscriberUID);\r\n\t\t_dataSource.unregisterLastbarUpdateCallback(subscriberUID);\r\n\t};\r\n\r\n\t// @ts-ignore\r\n\tdataApi.calculateHistoryDepth = (resolution, resolutionBack, intervalBack) => {\r\n\t\t//optional\r\n\t\tconsole.log('=====calculateHistoryDepth running');\r\n\t\t// while optional, this makes sure we request 24 hours of minute data at a time\r\n\t\t// CryptoCompare's minute data endpoint will throw an error if we request data beyond 7 days in the past, and return no data\r\n\t\treturn resolution < 60 ? { resolutionBack: 'D', intervalBack: '1' } : undefined;\r\n\t};\r\n\r\n\t// @ts-ignore\r\n\tdataApi.getMarks = (symbolInfo, startDate, endDate, onDataCallback, resolution) => {\r\n\t\t//optional\r\n\t\tconsole.log('=====getMarks running');\r\n\t};\r\n\r\n\t// @ts-ignore\r\n\tdataApi.getTimeScaleMarks = (symbolInfo, startDate, endDate, onDataCallback, resolution) => {\r\n\t\t//optional\r\n\t\tconsole.log('=====getTimeScaleMarks running');\r\n\t};\r\n\r\n\t// @ts-ignore\r\n\tdataApi.getServerTime = cb => {\r\n\t\t// console.log('=====getServerTime running');\r\n\t\tconst serverTime: number = _dataSource.model().getServerTime().valueOf();\r\n\t\tconsole.log('=====getServerTime running',{serverTime});\r\n\t\tcb(serverTime/1000);\r\n\t};\r\n\r\n\treturn dataApi;\r\n}\r\n","/* eslint-disable */\r\nimport * as React from 'react';\r\nimport {\r\n\twidget,\r\n\tChartingLibraryWidgetOptions,\r\n\tLanguageCode,\r\n\tIChartingLibraryWidget,\r\n\tResolutionString,\r\n\tThemeName,\r\n\tChartStyle,\r\n\tBarStylePreferences,\r\n\tSeriesPreferencesMap\r\n} from '../../charting_library';\r\nimport dataapi from './dataapi';\r\nimport { IChartDataSource } from '../data/dataSource';\r\nimport { getTvChartConfigs, getTvChartStyleProperties } from '../chartHelper';\r\nimport { stat } from 'fs';\r\ntype Callback = () => void;\r\n\r\nexport interface ChartContainerProps {\r\n\t// symbol: ChartingLibraryWidgetOptions['symbol'];\r\n\tinterval?: ChartingLibraryWidgetOptions['interval'];\r\n\r\n\t// BEWARE: no trailing slash is expected in feed URL\r\n\tdatafeedUrl?: string;\r\n\tlibraryPath?: ChartingLibraryWidgetOptions['library_path'];\r\n\tchartsStorageUrl?: ChartingLibraryWidgetOptions['charts_storage_url'];\r\n\tchartsStorageApiVersion?: ChartingLibraryWidgetOptions['charts_storage_api_version'];\r\n\tclientId?: ChartingLibraryWidgetOptions['client_id'];\r\n\tuserId?: ChartingLibraryWidgetOptions['user_id'];\r\n\tfullscreen?: ChartingLibraryWidgetOptions['fullscreen'];\r\n\tautosize?: ChartingLibraryWidgetOptions['autosize'];\r\n\tstudiesOverrides?: ChartingLibraryWidgetOptions['studies_overrides'];\r\n\tcontainerId?: ChartingLibraryWidgetOptions['container_id'];\r\n\tchartDataSource: IChartDataSource;\r\n\tlanguage: string;\r\n\tpriceDecimals: number;\r\n\ttheme: string;\r\n\tvisible: boolean;\r\n\tcommandDispatcher: any;\r\n\treadonly chartIndex: number;\r\n}\r\n\r\nexport interface ChartContainerState {\r\n}\r\n\r\nexport class TvChartContainer extends React.PureComponent {\r\n\r\n\tpublic static defaultProps: Partial = {\r\n\t\t// symbol: 'AUDUSD',\r\n\t\tinterval: '1' as ResolutionString,\r\n\t\tcontainerId: 'tv_chart_container',\r\n\t\tlibraryPath: 'charting_library/',\r\n\t\t// chartsStorageUrl: 'https://saveload.tradingview.com',\r\n\t\t// chartsStorageApiVersion: '1.1',\r\n\t\t// clientId: 'tradingview.com',\r\n\t\t// userId: 'public_user_id',\r\n\t\tfullscreen: false,\r\n\t\tautosize: true,\r\n\t\tstudiesOverrides: {},\r\n\t};\r\n\tprivate _tvWidget: IChartingLibraryWidget | null = null;\r\n\tprivate _symbol: string = '';\r\n\tprivate _theme: string = 'black';\r\n\tprivate readonly _dark_overrides = {\r\n\t\t// \"mainSeriesProperties.showCountdown\": true,\r\n\t\t'paneProperties.background': '#000',\r\n\t\t'paneProperties.vertGridProperties.color': '#151523',\r\n\t\t'paneProperties.horzGridProperties.color': '#151523',\r\n\t\t// 'symbolWatermarkProperties.transparency': 90,\r\n\t\t'scalesProperties.lineColor': \"#666\",\r\n\t\t'scalesProperties.textColor': '#aaa',\r\n\t\t// 'mainSeriesProperties.candleStyle.wickUpColor': '#336854',\r\n\t\t// 'mainSeriesProperties.candleStyle.wickDownColor': '#7f323f',\r\n\t};\r\n\tprivate _isInSwitchSymbol: boolean = false;\r\n\r\n\tpublic componentDidMount(): void {\r\n\t\tthis._isInSwitchSymbol = true;\r\n\t\tthis.createChart();\r\n\t}\r\n\r\n\tpublic componentDidUpdate(): void {\r\n\t\t// console.log(\"======================== tv didupdate..............\")\r\n\t\tconst symbol = this.props.chartDataSource.instrumentCode();\r\n\t\tif (this._symbol !== symbol) {\r\n\t\t\tif (!this._isInSwitchSymbol) {\r\n\t\t\t\tthis._isInSwitchSymbol = true;\r\n\t\t\t\tthis.removeChartWidget(() => {\r\n\t\t\t\t\tthis.createChart();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t} else if (this._theme !== this.props.theme) {\r\n\t\t\tthis._theme = this.props.theme;\r\n\t\t\tthis.applyTheme();\r\n\t\t\t/*\r\n\t\t\tif (this._theme === 'Dark') {\r\n\t\t\t\tthis._tvWidget?.applyOverrides(this._dark_overrides)\r\n\t\t\t} else {\r\n\t\t\t\tthis._tvWidget?.changeTheme(this._theme);\r\n\t\t\t}\r\n\t\t\t*/\r\n\t\t}\r\n\t\tif (this._theme === 'Dark') {\r\n\t\t\tthis._tvWidget?.applyOverrides(this._dark_overrides) // not work when theme setted\r\n\t\t}\r\n\t}\r\n\r\n\tpublic componentWillUnmount(): void {\r\n\t\tthis.removeChartWidget(() => { });\r\n\t}\r\n\r\n\tprivate _isChartPropertyApplied: boolean = true;\r\n\tprivate _dataapi: any;\r\n\r\n\tprivate removeChartWidget(callback: Callback): void {\r\n\t\tif (this._tvWidget !== null) {\r\n\t\t\ttry {\r\n\t\t\t\tthis._tvWidget.save((state: object) => {\r\n\t\t\t\t\tconst properties = getTvChartStyleProperties(this._symbol);\r\n\t\t\t\t\tif (this._isChartPropertyApplied || !properties[this.props.chartIndex]) {\r\n\t\t\t\t\t\tproperties[this.props.chartIndex] = this._tvWidget?.chart().getSeries().chartStyleProperties(1);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst configs = getTvChartConfigs(this._symbol);\r\n\t\t\t\t\tconfigs[this.props.chartIndex] = state;\r\n\r\n\t\t\t\t\tthis._tvWidget!.remove();\r\n\t\t\t\t\tthis._tvWidget = null;\r\n\t\t\t\t\tcallback();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tcatch (error) {\r\n\t\t\t\tconsole.warn(\"removeChartWidget : save tvchart failed: \" + error);\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tcallback();\r\n\t\t}\r\n\t}\r\n\r\n\tprivate onFullSceen() {\r\n\t\tconsole.error(\"not implemented.\");\r\n\t}\r\n\r\n\tpublic addIndicator = () => {\r\n\t\tthis._tvWidget!.chart().executeActionById(\"insertIndicator\");\r\n\t}\r\n\r\n\tpublic showChartProperties = () => {\r\n\t\tthis._tvWidget!.chart().executeActionById(\"chartProperties\");\r\n\t}\r\n\r\n\tpublic setResolution(resolution: string) {\r\n\t\t// this._tvWidget!.activeChart().setResolution(resolution as ResolutionString, () => { });\r\n\t\ttry {\r\n\t\t\t// this._dataapi.OnResolutionChanging();\r\n\t\t\tthis._tvWidget!.chart(0).setResolution(resolution as ResolutionString, () => { });\r\n\t\t\tconsole.log(\"tvtrace: setResolution success for \" + this.props.containerId + \", resolution=\" + resolution);\r\n\t\t} catch (error) {\r\n\t\t\tconsole.log(\"tvtrace: setResolution failed for \" + this.props.containerId + \", resolution=\" + resolution);\r\n\t\t\tconsole.warn(error);\r\n\t\t}\r\n\t}\r\n\r\n\tpublic render(): JSX.Element {\r\n\t\tconst { visible } = this.props;\r\n\t\tconst display = visible ? 'block' : 'none';\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t);\r\n\t}\r\n\r\n\tprivate applyTheme(): void {\r\n\t\tconst tvtheme = this._theme === 'black' ? 'Dark' : 'Light';\r\n\t\tthis._tvWidget?.changeTheme(tvtheme);\r\n\t}\r\n\r\n\tprivate applyChartProperty(): void {\r\n\t\tconst properties = getTvChartStyleProperties(this._symbol);\r\n\t\tconst barProperty = properties[this.props.chartIndex];\r\n\t\tif (barProperty) {\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis._tvWidget!.chart().getSeries().setChartStyleProperties(1, barProperty);\r\n\t\t\t\t\tthis._isChartPropertyApplied = true;\r\n\t\t\t\t}\r\n\t\t\t\tcatch (error) {\r\n\t\t\t\t\t// console.warn(\"[chartStyle] setTimeout barProperty\", error, barProperty);\r\n\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tthis._tvWidget!.chart().getSeries().setChartStyleProperties(1, barProperty);\r\n\t\t\t\t\t\t\tthis._isChartPropertyApplied = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch (error) {\r\n\t\t\t\t\t\t\t// console.error(\"[chartStyle] inner setTimeout barProperty\", error, barProperty);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, 1);\t\t\r\n\t\t\t\t}\r\n\t\t\t}, 1);\r\n\t\t}\r\n\t}\r\n\r\n\tprivate createChart(): void {\r\n\t\tthis._isChartPropertyApplied = false;\r\n\t\tthis._dataapi = dataapi(this.props.priceDecimals as number);\r\n\t\tif (this.props.chartDataSource) {\r\n\t\t\tthis._dataapi.setDataSource(this.props.chartDataSource);\r\n\t\t} else {\r\n\t\t\tconsole.error('TvChartContainera: chartDataSource not set!');\r\n\t\t}\r\n\r\n\t\tconst lang = this.props.language ?? 'zh_TW';\r\n\t\tthis._symbol = this.props.chartDataSource?.instrumentCode();\r\n\t\tlet overrides:any = {};\r\n\t\tif (this.props.theme === 'black') {\r\n\t\t\toverrides = this._dark_overrides;\r\n\t\t}\r\n\r\n\t\t// overrides cannot be used because theme used.\r\n\t\t// const properties = getTvChartStyleProperties(this._symbol);\r\n\t\t// const barProperty = properties[this.props.chartIndex];\r\n\t\t// if (barProperty) {\r\n\t\t// \toverrides[\"mainSeriesProperties.candleStyle.upColor\"] = barProperty.upColor;\r\n\t\t// \toverrides[\"mainSeriesProperties.candleStyle.downColor\"] = barProperty.downColor;\r\n\t\t// \toverrides[\"mainSeriesProperties.candleStyle.drawWick\"] = barProperty.drawWick;\r\n\t\t// \toverrides[\"mainSeriesProperties.candleStyle.drawBorder\"] = barProperty.drawBorder;\r\n\t\t// \toverrides[\"mainSeriesProperties.candleStyle.borderColor\"] = barProperty.borderColor;\r\n\t\t// \toverrides[\"mainSeriesProperties.candleStyle.borderUpColor\"] = barProperty.borderUpColor;\r\n\t\t// \toverrides[\"mainSeriesProperties.candleStyle.borderDownColor\"] = barProperty.borderDownColor;\r\n\t\t// \toverrides[\"mainSeriesProperties.candleStyle.wickColor\"] = barProperty.wickColor;\r\n\t\t// \toverrides[\"mainSeriesProperties.candleStyle.wickUpColor\"] = barProperty.wickUpColor;\r\n\t\t// \toverrides[\"mainSeriesProperties.candleStyle.wickDownColor\"] = barProperty.wickDownColor;\r\n\t\t// \toverrides[\"mainSeriesProperties.candleStyle.drawBody\"] = barProperty.drawBody;\r\n\t\t// }\r\n\r\n\t\tconst widgetOptions: ChartingLibraryWidgetOptions = {\r\n\t\t\tdebug: false,\r\n\t\t\tsymbol: this._symbol,\r\n\t\t\tdatafeed: this._dataapi,\r\n\t\t\tinterval: this.props.interval as ChartingLibraryWidgetOptions['interval'],\r\n\t\t\tcontainer: this.props.containerId as string,\r\n\t\t\tlibrary_path: this.props.libraryPath,\r\n\t\t\tlocale: lang as LanguageCode,\r\n\t\t\tdisabled_features: ['use_localstorage_for_settings',\r\n\t\t\t\t'symbol_info',\r\n\t\t\t\t'display_market_status',\r\n\t\t\t\t'timeframes_toolbar',\r\n\t\t\t\t'header_widget',\r\n\t\t\t\t'header_screenshot',\r\n\t\t\t\t'header_symbol_search',\r\n\t\t\t\t'header_undo_redo',\r\n\t\t\t\t'header_compare'],\r\n\t\t\t// enabled_features: ['study_templates'],\r\n\t\t\tcharts_storage_url: this.props.chartsStorageUrl,\r\n\t\t\tcharts_storage_api_version: this.props.chartsStorageApiVersion,\r\n\t\t\tclient_id: this.props.clientId,\r\n\t\t\tuser_id: this.props.userId,\r\n\t\t\tfullscreen: this.props.fullscreen,\r\n\t\t\tautosize: this.props.autosize,\r\n\t\t\tstudies_overrides: this.props.studiesOverrides,\r\n\t\t\ttimezone: 'Asia/Hong_Kong',\r\n\t\t\toverrides: overrides,\r\n\t\t\t// toolbar_bg: '#aaa', // \r\n\t\t\t// overrides: {\r\n\t\t\t// \t// \"mainSeriesProperties.showCountdown\": true,\r\n\t\t\t// \t// 'paneProperties.background': '#131722',\r\n\t\t\t// \t// 'paneProperties.vertGridProperties.color': '#363c4e',\r\n\t\t\t// \t// 'paneProperties.horzGridProperties.color': '#363c4e',\r\n\t\t\t// \t// 'symbolWatermarkProperties.transparency': 90,\r\n\t\t\t// \t// 'scalesProperties.textColor': '#AAA',\r\n\t\t\t// \t// 'mainSeriesProperties.candleStyle.wickUpColor': '#336854',\r\n\t\t\t// \t// 'mainSeriesProperties.candleStyle.wickDownColor': '#7f323f',\r\n\t\t\t// },\r\n\t\t\ttheme: this.props.theme === 'black' ? 'Dark' : 'Light',\r\n\t\t\t// custom_css_url: '../chart.css',\r\n\t\t};\r\n\r\n\t\tthis._theme = this.props.theme;\r\n\t\tconst tvWidget = new widget(widgetOptions);\r\n\t\tthis._tvWidget = tvWidget;\r\n\r\n\t\ttvWidget.onChartReady(() => {\r\n\t\t\tconst configs = getTvChartConfigs(this._symbol);\r\n\t\t\tconst state = configs[this.props.chartIndex];\r\n\t\t\tif (state) {\r\n\t\t\t\ttvWidget.load(state);\r\n\t\t\t}\r\n\t\t\tthis.applyTheme();\r\n\t\t\tthis._isInSwitchSymbol = false;\r\n\t\t\tthis.applyChartProperty();\r\n\r\n\t\t\t// if symbol changed while creating previous sybmol chart\r\n\t\t\tif (this._symbol != this.props.chartDataSource.instrumentCode()) {\r\n\t\t\t\tthis.componentDidUpdate();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tthis.props.commandDispatcher.setResolution = this.setResolution.bind(this);\r\n\t\tthis.props.commandDispatcher.addIndicatorForTv = this.addIndicator.bind(this);\r\n\t\tthis.props.commandDispatcher.showChartProperties = this.showChartProperties.bind(this);\r\n\t\tconsole.info(this.props.containerId, \" ===> created.\");\r\n\t}\r\n}\r\n","import React from \"react\";\r\nimport \"./style/scrollbar.css\";\r\nimport { useState, useRef, useEffect } from \"react\";\r\nimport { LeftOutlined, RightOutlined } from '@ant-design/icons';\r\nimport { useResizeDetector } from \"react-resize-detector\";\r\n\r\ninterface IScrollbarProps{\r\n readonly children: JSX.Element;\r\n readonly theme?: string;\r\n readonly onResized?: (width: number) => void;\r\n readonly sizeCheckCount?: number // change this prop to force scrollCheck\r\n}\r\n\r\nexport default function Scrollbar(props: IScrollbarProps) {\r\n const scrollbar = useRef(null);\r\n // const container = useRef(null);\r\n const [scrollX, setscrollX] = useState(0);\r\n const [rightButtonLeft, setrightButtonLeft] = useState(100);\r\n const [scrolEnd, setscrolEnd] = useState(false);\r\n const [mouseOver, setmouseOver] = useState(false);\r\n const { width, height, ref } = useResizeDetector();\r\n\r\n //Slide click\r\n const slide = (orientation: number) => {\r\n // const target = container.current!;\r\n const target = ref.current!;\r\n // console.log({\r\n // scrollLeft: container.current!.scrollLeft,\r\n // clientWidth: container.current!.clientWidth,\r\n // offsetWidth: container.current!.offsetWidth,\r\n // scrollWidth: container.current!.scrollWidth,\r\n // });\r\n const minScrollSpace = 20;\r\n const totalspace = (target.scrollWidth > target.scrollLeft) ? target.scrollWidth - target.scrollLeft : 0;\r\n const scrollSpace = (target.clientWidth > minScrollSpace) ? (target.clientWidth - minScrollSpace) : target.clientWidth;\r\n const realspace = Math.min(scrollSpace, totalspace);\r\n if (realspace > 0) {\r\n // target.scrollLeft += realspace * orientation;\r\n animate(realspace, target, orientation);\r\n }\r\n };\r\n\r\n const animate = (realspace: number, target: HTMLDivElement, orientation: number) => {\r\n let step = realspace > 30 ? 8 : (realspace > 10 ? 3 : 1);\r\n const repeats = realspace / step;\r\n if (repeats > 10) {\r\n step = realspace / 10;\r\n }\r\n // console.log(`=====> realspace=${realspace}, step=${step}`);\r\n if (realspace > 0) {\r\n const realStep = Math.min(step, realspace);\r\n const adj = realStep * orientation;\r\n // console.log(`=====> target.scrollLeft=${target.scrollLeft}, adj=${adj} ===before`);\r\n target.scrollLeft += adj;\r\n // console.log(`=====> target.scrollLeft=${target.scrollLeft}, adj=${adj} ===end`);\r\n setscrollX(target.scrollLeft);\r\n realspace -= realStep;\r\n } else {\r\n if (Math.floor(target.scrollWidth - target.scrollLeft) <= target.offsetWidth) {\r\n setscrolEnd(true);\r\n } else {\r\n setscrolEnd(false);\r\n }\r\n }\r\n if (realspace > 0) {\r\n setTimeout(()=> {animate(realspace, target, orientation)}, 10);\r\n }\r\n }\r\n\r\n const onMouseOver = () => { \r\n setmouseOver(true);\r\n };\r\n\r\n const onMouseLeave = () => { \r\n setmouseOver(false);\r\n };\r\n\r\n const scrollCheck = () => {\r\n const target = ref.current;\r\n if (target) {\r\n setscrollX(target.scrollLeft);\r\n console.log({ scrollLeft: target.scrollLeft });\r\n\r\n // console.log({ delta: Math.floor(target.scrollWidth - target.scrollLeft), offsetWidth: target.offsetWidth, clientWidth: target.clientWidth });\r\n \r\n const widthAdjust = 5;\r\n if (Math.floor(target.scrollWidth - target.scrollLeft) <= target.offsetWidth + widthAdjust) {\r\n setscrolEnd(true);\r\n } else {\r\n setscrolEnd(false);\r\n }\r\n }\r\n };\r\n // const clientWidth = scrollbar.current ? scrollbar.current.clientWidth : 0;\r\n\r\n useEffect(() => {\r\n const buttonWidth = 23;\r\n setrightButtonLeft(scrollbar.current!.clientWidth - buttonWidth);\r\n scrollCheck();\r\n\r\n if (props.onResized && width) {\r\n props.onResized(width);\r\n }\r\n }, [width, props.sizeCheckCount]);\r\n \r\n const theme = props.theme ?? 'black';\r\n let bottonClass = 'float-button float-button-';\r\n bottonClass += theme === 'black' ? 'black' : 'white';\r\n\r\n // console.log({width, height});\r\n\r\n return (\r\n
\r\n {scrollX !== 0 && mouseOver && (\r\n slide(-1)}\r\n onMouseEnter={onMouseOver}\r\n onMouseLeave={onMouseLeave}\r\n />\r\n )}\r\n
\r\n {props.children}\r\n
\r\n {!scrolEnd && mouseOver && (\r\n slide(1)}\r\n onMouseEnter={onMouseOver}\r\n onMouseLeave={onMouseLeave}\r\n width={50}\r\n height={50}\r\n />\r\n )}\r\n
\r\n );\r\n}\r\n","import React from 'react';\r\nimport { map as d3Map } from 'd3-collection'\r\nimport { Tag, Row, Col, Button, Dropdown, Menu } from 'antd';\r\nimport { /*FullscreenOutlined,*/ ZoomInOutlined, ZoomOutOutlined, FundViewOutlined, SettingOutlined} from '@ant-design/icons';\r\nimport { ChartType, DataRangeType, IChartConfig, IChartIndicatorSettings, IMap, ViewType } from './typeDefine';\r\nimport { IChartDataSource } from './data/dataSource';\r\nimport { getForeColor, getToolbarbackColor } from './theme';\r\nimport { Select } from 'antd';\r\nimport { Trans, getI18n } from 'react-i18next';\r\nimport { TEventBus } from './chartContext';\r\nimport Scrollbar from './Scrollbar';\r\nimport { ChartConfigs } from './chartHelper';\r\n\r\nconst { Option } = Select;\r\nconst { CheckableTag } = Tag;\r\n//const { t } = useTranslation(); hook function, can not used in Component.\r\n\r\ntype TPeriodType = \"M\" | \"H\" | \"D\";\r\n\r\ninterface IHeaderBarProps{\r\n readonly dataSource: IChartDataSource;\r\n readonly indicatorSettings?: IChartIndicatorSettings;\r\n readonly onFullSceen: () => void;\r\n readonly theme?: string;\r\n readonly viewType: ViewType;\r\n readonly setViewType: (viewtype: ViewType) => void;\r\n readonly addIndicator: () => void;\r\n readonly showChartProperties: () => void;\r\n // readonly setResolution: (resolution: string) => void;\r\n readonly showMultiChartMemu: boolean;\r\n readonly setChartCount?: (count: number) => void;\r\n readonly eventBus: TEventBus;\r\n readonly showTV: boolean;\r\n // readonly chartType: ChartType;\r\n readonly chartIndex: number;\r\n}\r\ninterface IHeaderBarState{\r\n // periodtype: TPeriodType;\r\n // subIndex: number;\r\n readonly isZoomInChecked: boolean;\r\n // dataRanges: any[];\r\n // dataRange: DataRangeType;\r\n // isModalVisible: boolean;\r\n readonly spacingWidth: number;\r\n readonly sizeCheckCount: number;\r\n}\r\n\r\nexport class HeaderBar extends React.Component{\r\n\r\n private readonly t_m = \"M\";\r\n private readonly t_h = \"H\";\r\n private readonly t_d = \"D\";\r\n\r\n private readonly minutes = [\"1\", \"5\", \"15\", \"30\"];\r\n private readonly hours = [\"1\", \"2\", \"4\", \"8\"];\r\n private readonly days = [\"Daily\", \"Weekly\", \"Monthly\"];\r\n private readonly activeColor = \"#40a9ff\";\r\n private readonly baseStype = { cursor: \"pointer\", paddingLeft: 10, paddingRight: 10 };\r\n // private readonly baseStype = { cursor: \"pointer\", \"width\": 60};\r\n private normalStyle: any;\r\n private activeStyle: any;\r\n private prevSubIndexes: IMap;\r\n\r\n public constructor(props: IHeaderBarProps) {\r\n super(props);\r\n\r\n this.prevSubIndexes = d3Map();\r\n this.prevSubIndexes.set(this.t_d, 0);\r\n this.prevSubIndexes.set(this.t_h, 0);\r\n this.prevSubIndexes.set(this.t_m, 0);\r\n\r\n const { type, subIndex: idx } = this.ChartTypeToUIPeriodArgs(props.dataSource.chartType());\r\n this.prevSubIndexes.set(type, idx);\r\n\r\n const unit = this.getPeriodUnitage(type, idx);\r\n const ranges = this.getDataRanges(type, unit, 0);\r\n \r\n //this.state = { periodtype: type, subIndex: idx, isZoomInChecked: false, dataRanges: ranges, dataRange: DataRangeType.Unlimited };\r\n this.state = { isZoomInChecked: false, spacingWidth: 0 , sizeCheckCount: 0};\r\n this.normalStyle = this.baseStype;\r\n this.activeStyle = { ...this.baseStype, color: this.activeColor };\r\n\r\n props.eventBus?.on(\"cmd.zoomin_finish\", this.zoomin_finish);\r\n }\r\n\r\n private readonly zoomin_finish = () => {\r\n this.setState({ isZoomInChecked: false });\r\n }\r\n\r\n private ChartTypeToUIPeriodArgs = (chartType: ChartType) => {\r\n const typeName = ChartType[chartType];\r\n let type: TPeriodType = this.t_d;\r\n let subIndex = 0;\r\n \r\n if (chartType === ChartType.Weekly) subIndex = 1;\r\n else if (chartType === ChartType.Monthly) subIndex = 2;\r\n else if (typeName[0] === this.t_m) {\r\n type = this.t_m;\r\n subIndex = this.minutes.indexOf(typeName.substr(6));\r\n }\r\n else if (typeName[0] === this.t_h) {\r\n type = this.t_h;\r\n subIndex = this.hours.indexOf(typeName.substr(4));\r\n }\r\n return { type, subIndex };\r\n }\r\n\r\n private getPeriods = (periodtype: TPeriodType) => {\r\n // const { periodtype } = this.state;\r\n const periods = periodtype === this.t_m ? this.minutes : (periodtype === this.t_h) ? this.hours : this.days;\r\n return periods;\r\n }\r\n\r\n private onDataRangeChanged = (dataRange: number) => {\r\n console.log({ dataRange });\r\n // this.setState({ dataRange: dataRange });\r\n this.props.dataSource.dataRange(dataRange).OnPeriodRangeChanged(dataRange);\r\n this.forceUpdate();\r\n // this.props.dataSource.OnPeriodRangeChanged(dataRange);\r\n }\r\n\r\n private onPeriodTypeClick = (type: TPeriodType) => {\r\n //const { periodtype: oldType, subIndex } = this.state;\r\n const { type: oldType, subIndex } = this.ChartTypeToUIPeriodArgs(this.props.dataSource.chartType());\r\n this.prevSubIndexes.set(oldType, subIndex);\r\n const index = this.prevSubIndexes.get(type) as number;\r\n //this.setState({ periodtype: type, subIndex: index }, this.notifyPeriodChanged);\r\n this.notifyPeriodChanged(type, index);\r\n }\r\n\r\n private onChangePeriod = (tag: string, checked: boolean) => {\r\n const { type } = this.ChartTypeToUIPeriodArgs(this.props.dataSource.chartType());\r\n const periods = this.getPeriods(type);\r\n const newIndex = periods.indexOf(tag);\r\n //this.setState({ subIndex: newIndex }, this.notifyPeriodChanged);\r\n this.notifyPeriodChanged(type, newIndex);\r\n }\r\n\r\n private notifyPeriodChanged = (periodtype: TPeriodType, subIndex: number) => {\r\n // const { periodtype, subIndex } = this.state;\r\n let type: any;\r\n let unit: number = this.getPeriodUnitage(periodtype, subIndex);\r\n if (periodtype === this.t_m) {\r\n type = unit;\r\n }\r\n else if (periodtype === this.t_h) {\r\n type = 60 * unit;\r\n }\r\n else if(subIndex === 0) {\r\n type = ChartType.Daily;\r\n }\r\n else if(subIndex === 1) {\r\n type = ChartType.Weekly;\r\n }\r\n else if(subIndex === 2) {\r\n type = ChartType.Monthly;\r\n }\r\n this.props.dataSource.chartType(type);\r\n this.props.dataSource.dataRange(DataRangeType.Unlimited);\r\n\r\n // save old instrument's chartType\r\n const instrumentId = this.props.dataSource.instrumentId();\r\n if (ChartConfigs.has(instrumentId)) {\r\n const cfgs = ChartConfigs.get(instrumentId) as IChartConfig[];\r\n cfgs[this.props.chartIndex].chartType = type;\r\n }\r\n\r\n\r\n this.forceUpdate();\r\n\r\n // const resolution = ChartTypeToResolution(type);\r\n // this.props.setResolution(resolution);\r\n }\r\n\r\n private getPeriodUnitage = (periodtype: string, subIndex: number) => {\r\n let unitage: number = 1\r\n if (periodtype === this.t_m) {\r\n unitage = +this.minutes[subIndex];\r\n }\r\n else if (periodtype === this.t_h) {\r\n unitage = +this.hours[subIndex];\r\n }\r\n return unitage;\r\n }\r\n\r\n private getDataRanges = (type: TPeriodType, unit: number, subIndex: number) => {\r\n let ranges: any[] = [{ rangeText: \"Unlimited\", dataRange: DataRangeType.Unlimited }];\r\n if (type === this.t_m) {\r\n if (unit === 1) {\r\n ranges.push({ rangeText: \"Today\", dataRange: DataRangeType.Today });\r\n ranges.push({ rangeText: \"ThisWeek\", dataRange: DataRangeType.ThisWeek });\r\n ranges.push({ rangeText: \"ThisMonth\", dataRange: DataRangeType.ThisMonth });\r\n ranges.push({ rangeText: \"Day2\", dataRange: DataRangeType.Day2 });\r\n ranges.push({ rangeText: \"Day3\", dataRange: DataRangeType.Day3 });\r\n ranges.push({ rangeText: \"Day4\", dataRange: DataRangeType.Day4 });\r\n ranges.push({ rangeText: \"Day5\", dataRange: DataRangeType.Day5 });\r\n ranges.push({ rangeText: \"Day10\", dataRange: DataRangeType.Day10 });\r\n ranges.push({ rangeText: \"Day15\", dataRange: DataRangeType.Day15 });\r\n ranges.push({ rangeText: \"Day30\", dataRange: DataRangeType.Day30 });\r\n // ranges.push({ rangeText: \"Day45\", dataRange: DataRangeType.Day45 });\r\n }\r\n else if (unit === 5) {\r\n ranges.push({ rangeText: \"Today\", dataRange: DataRangeType.Today });\r\n ranges.push({ rangeText: \"ThisWeek\", dataRange: DataRangeType.ThisWeek });\r\n ranges.push({ rangeText: \"ThisMonth\", dataRange: DataRangeType.ThisMonth });\r\n ranges.push({ rangeText: \"ThisQuarter\", dataRange: DataRangeType.ThisQuarter });\r\n ranges.push({ rangeText: \"Day5\", dataRange: DataRangeType.Day5 });\r\n ranges.push({ rangeText: \"Day10\", dataRange: DataRangeType.Day10 });\r\n ranges.push({ rangeText: \"Day15\", dataRange: DataRangeType.Day15 });\r\n ranges.push({ rangeText: \"Day30\", dataRange: DataRangeType.Day30 });\r\n ranges.push({ rangeText: \"Day45\", dataRange: DataRangeType.Day45 });\r\n ranges.push({ rangeText: \"Day60\", dataRange: DataRangeType.Day60 });\r\n ranges.push({ rangeText: \"Day90\", dataRange: DataRangeType.Day90 });\r\n ranges.push({ rangeText: \"Day120\", dataRange: DataRangeType.Day120 });\r\n ranges.push({ rangeText: \"Day180\", dataRange: DataRangeType.Day180 });\r\n }\r\n else if (unit === 15) {\r\n ranges.push({ rangeText: \"ThisWeek\", dataRange: DataRangeType.ThisWeek });\r\n ranges.push({ rangeText: \"ThisMonth\", dataRange: DataRangeType.ThisMonth });\r\n ranges.push({ rangeText: \"ThisQuarter\", dataRange: DataRangeType.ThisQuarter });\r\n ranges.push({ rangeText: \"Day15\", dataRange: DataRangeType.Day15 });\r\n ranges.push({ rangeText: \"Day30\", dataRange: DataRangeType.Day30 });\r\n ranges.push({ rangeText: \"Day45\", dataRange: DataRangeType.Day45 });\r\n ranges.push({ rangeText: \"Month2\", dataRange: DataRangeType.Month2 });\r\n ranges.push({ rangeText: \"Month3\", dataRange: DataRangeType.Month3 });\r\n ranges.push({ rangeText: \"Month6\", dataRange: DataRangeType.Month6 });\r\n ranges.push({ rangeText: \"Year1\", dataRange: DataRangeType.Year1 });\r\n ranges.push({ rangeText: \"Year2\", dataRange: DataRangeType.Year2 });\r\n }\r\n else if (unit === 30) {\r\n ranges.push({ rangeText: \"ThisWeek\", dataRange: DataRangeType.ThisWeek });\r\n ranges.push({ rangeText: \"ThisMonth\", dataRange: DataRangeType.ThisMonth });\r\n ranges.push({ rangeText: \"ThisQuarter\", dataRange: DataRangeType.ThisQuarter });\r\n ranges.push({ rangeText: \"Day30\", dataRange: DataRangeType.Day30 });\r\n ranges.push({ rangeText: \"Day60\", dataRange: DataRangeType.Day60 });\r\n ranges.push({ rangeText: \"Day90\", dataRange: DataRangeType.Day90 });\r\n ranges.push({ rangeText: \"Month6\", dataRange: DataRangeType.Month6 });\r\n ranges.push({ rangeText: \"Year1\", dataRange: DataRangeType.Year1 });\r\n ranges.push({ rangeText: \"Year2\", dataRange: DataRangeType.Year2 });\r\n ranges.push({ rangeText: \"Year3\", dataRange: DataRangeType.Year3 });\r\n }\r\n }\r\n else if (type === this.t_h) {\r\n if (unit === 1) {\r\n ranges.push({ rangeText: \"ThisMonth\", dataRange: DataRangeType.ThisMonth });\r\n ranges.push({ rangeText: \"ThisQuarter\", dataRange: DataRangeType.ThisQuarter });\r\n ranges.push({ rangeText: \"Day30\", dataRange: DataRangeType.Day30 });\r\n ranges.push({ rangeText: \"Day60\", dataRange: DataRangeType.Day60 });\r\n ranges.push({ rangeText: \"Day90\", dataRange: DataRangeType.Day90 });\r\n ranges.push({ rangeText: \"Month6\", dataRange: DataRangeType.Month6 });\r\n ranges.push({ rangeText: \"Year1\", dataRange: DataRangeType.Year1 });\r\n ranges.push({ rangeText: \"Year2\", dataRange: DataRangeType.Year2 });\r\n ranges.push({ rangeText: \"Year3\", dataRange: DataRangeType.Year3 });\r\n ranges.push({ rangeText: \"Year5\", dataRange: DataRangeType.Year5 });\r\n }\r\n else {\r\n ranges.push({ rangeText: \"ThisMonth\", dataRange: DataRangeType.ThisMonth });\r\n ranges.push({ rangeText: \"ThisQuarter\", dataRange: DataRangeType.ThisQuarter });\r\n ranges.push({ rangeText: \"ThisYear\", dataRange: DataRangeType.ThisYear });\r\n ranges.push({ rangeText: \"Month6\", dataRange: DataRangeType.Month6 });\r\n ranges.push({ rangeText: \"Year1\", dataRange: DataRangeType.Year1 });\r\n ranges.push({ rangeText: \"Year2\", dataRange: DataRangeType.Year2 });\r\n ranges.push({ rangeText: \"Year3\", dataRange: DataRangeType.Year3 });\r\n ranges.push({ rangeText: \"Year5\", dataRange: DataRangeType.Year5 });\r\n ranges.push({ rangeText: \"Year10\", dataRange: DataRangeType.Year10 });\r\n }\r\n }\r\n else {\r\n if (type === this.t_d && subIndex === 0) {\r\n ranges.push({ rangeText: \"ThisQuarter\", dataRange: DataRangeType.ThisQuarter });\r\n }\r\n ranges.push({ rangeText: \"ThisYear\", dataRange: DataRangeType.ThisYear });\r\n ranges.push({ rangeText: \"Month6\", dataRange: DataRangeType.Month6 });\r\n ranges.push({ rangeText: \"Year1\", dataRange: DataRangeType.Year1 });\r\n ranges.push({ rangeText: \"Year2\", dataRange: DataRangeType.Year2 });\r\n ranges.push({ rangeText: \"Year3\", dataRange: DataRangeType.Year3 });\r\n ranges.push({ rangeText: \"Year4\", dataRange: DataRangeType.Year4 });\r\n ranges.push({ rangeText: \"Year5\", dataRange: DataRangeType.Year5 });\r\n ranges.push({ rangeText: \"Year10\", dataRange: DataRangeType.Year10 });\r\n ranges.push({ rangeText: \"Year20\", dataRange: DataRangeType.Year20 });\r\n }\r\n return ranges;\r\n }\r\n\r\n private getStyle = (isselected: boolean) => {\r\n let style = {...(isselected ? this.activeStyle : this.normalStyle)};\r\n // if (getI18n().language === \"en\") {\r\n // style.paddingLeft = style.paddingRight = 5;\r\n // } else {\r\n style.paddingLeft = style.paddingRight = 10;\r\n // }\r\n if (!isselected) {\r\n style.color = this.getForeColor();\r\n }\r\n return style;\r\n }\r\n\r\n private onFullScreen = () => {\r\n this.props.onFullSceen();\r\n }\r\n\r\n private OnZoomOut = () => {\r\n this.props.eventBus?.emit(\"cmd.zoom_out\");\r\n }\r\n private OnZoomInTagClicked = (ischecked: boolean) => {\r\n this.setState({ isZoomInChecked: ischecked });\r\n this.props.eventBus?.emit(ischecked ? \"cmd.begin_zoomin\" : \"cmd.stop_zoomin\");\r\n }\r\n\r\n private getPalletPos = (periodtype: string) => {\r\n let pos = 3;\r\n if (getI18n().language === \"en\") {\r\n if (periodtype === this.t_m) pos = 10;\r\n else if (periodtype === this.t_h) pos = 60;\r\n else if (periodtype === this.t_d) pos = 100;\r\n }\r\n else {\r\n const palletLen = 33;\r\n if (periodtype === this.t_h) pos += palletLen;\r\n if (periodtype === this.t_d) pos += 2 * palletLen;\r\n }\r\n return pos;\r\n }\r\n\r\n private getForeColor() {\r\n const theme = this.props.theme ?? \"white\";\r\n return getForeColor(theme);\r\n }\r\n\r\n private changeViewType(vt: ViewType) {\r\n if (this.props.viewType !== vt) {\r\n this.props.setViewType(vt);\r\n }\r\n const sizeCheckCount = this.state.sizeCheckCount + 1;\r\n this.setState({ sizeCheckCount });\r\n }\r\n\r\n private notifyChartCount(key: string) {\r\n if (this.props.setChartCount)\r\n this.props.setChartCount(+key[5]);\r\n }\r\n\r\n private onResized = (width: number) => {\r\n // if (this.props.viewType === ViewType.original) {\r\n // this.setState({ spacingWidth: width });\r\n // } else {\r\n // this.setState({ spacingWidth: width });\r\n // }\r\n\r\n this.setState({ spacingWidth: width }); // 设置应该超宽,可能Antd Row 自动进行了缩减,因此不需要区分ViewType.\r\n }\r\n\r\n public render() {\r\n const { type: periodtype, subIndex } = this.ChartTypeToUIPeriodArgs(this.props.dataSource.chartType());\r\n const periods = this.getPeriods(periodtype);\r\n const theme = this.props.theme ?? \"white\";\r\n const foreColor = getForeColor(theme);\r\n const toolbarbackColor = getToolbarbackColor(theme);\r\n\r\n let options: JSX.Element[];\r\n const unit = this.getPeriodUnitage(periodtype, subIndex);\r\n const ranges = this.getDataRanges(periodtype, unit, 0);\r\n options = ranges.map((range, index) => ());\r\n\r\n const dataRange = this.props.dataSource.dataRange();\r\n\r\n const istv = this.props.viewType === ViewType.tradingview\r\n\r\n const cbBaseStyle = {padding: '4px 8px'};\r\n const orgButtonStyle = !istv ? cbBaseStyle : { color: 'gray', ...cbBaseStyle };\r\n const tvButtonStyle = istv ? cbBaseStyle : { color: 'gray', ...cbBaseStyle };\r\n\r\n const threewin = \r\n \r\n \r\n \r\n ;\r\n\r\n const onewin = \r\n \r\n ;\r\n\r\n const twowin = \r\n \r\n \r\n ;\r\n\r\n const multiChartMenu = this.notifyChartCount(key as string)}>\r\n \r\n {onewin} Chart.OneChart\r\n \r\n \r\n {twowin} Chart.TwoCharts\r\n \r\n \r\n {threewin} Chart.ThreeCharts\r\n \r\n ;\r\n\r\n const { isZoomInChecked, spacingWidth, sizeCheckCount } = this.state;\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {istv &&\r\n \r\n \r\n \r\n }\r\n \r\n this.onPeriodTypeClick(this.t_m)}>Chart.M\r\n this.onPeriodTypeClick(this.t_h)}>Chart.H\r\n this.onPeriodTypeClick(this.t_d)}>Chart.D\r\n {/*
*/}\r\n \r\n \r\n {\r\n periods.map(tag => (\r\n this.onChangePeriod(tag, ischecked)}\r\n style={{ color: foreColor, margin: 3 }}\r\n >\r\n {periodtype === this.t_d ? {'Chart.' + tag} : tag}\r\n \r\n ))\r\n }\r\n \r\n {!istv && <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {options}\r\n \r\n \r\n }\r\n {this.props.showMultiChartMemu && <>\r\n \r\n \r\n {threewin}\r\n \r\n \r\n }\r\n \r\n \r\n
\r\n
\r\n \r\n\r\n {this.props.showTV && \r\n \r\n \r\n this.changeViewType(ViewType.original)}\r\n >\r\n Chart.Original\r\n \r\n \r\n \r\n this.changeViewType(ViewType.tradingview)}\r\n >\r\n Chart.TradingView\r\n \r\n \r\n \r\n }\r\n
\r\n );\r\n }\r\n}\r\n","import React from 'react'\r\nimport { getI18n } from 'react-i18next';\r\nimport ChartView, { IChartProps } from './ChartView';\r\nimport { TvChartContainer } from './tvchart/TvChartContainer';\r\nimport { ViewType } from './typeDefine';\r\nimport { HeaderBar } from './HeaderBar';\r\nimport mitt from 'mitt';\r\nimport { FrameContext } from './chartContext';\r\n\r\ninterface IChartFrameState {\r\n viewType: ViewType;\r\n}\r\n\r\nexport interface IChartFrameProps extends Omit {\r\n readonly viewType?: ViewType;\r\n readonly showMultiChartMemu?: boolean;\r\n readonly setChartCount?: (count: number) => void;\r\n readonly issplitterdragging?: boolean;\r\n}\r\n\r\nfunction getLanguageForTV() {\r\n const lang = getI18n().language;\r\n if (lang === 'zh_cn')\r\n return 'zh';\r\n else if (lang === 'zh_tw')\r\n return 'zh_TW'\r\n else\r\n return 'en';\r\n}\r\n\r\nclass ChartFrame extends React.PureComponent {\r\n\r\n private commandDispatcher: any = {};\r\n private eventBus = mitt();\r\n private _isShowTv: boolean = true;\r\n \r\n constructor(props: IChartFrameProps) {\r\n super(props);\r\n let viewType = props.viewType ?? (props.isPad ? ViewType.original : ViewType.tradingview);\r\n const isShowTv = props.dataSource.model().config.showTradingView;\r\n let defaultViewType = parseInt(props.dataSource.model().config.defaultViewType);\r\n if (isNaN(defaultViewType)) {\r\n defaultViewType = ViewType.original;\r\n }\r\n this._isShowTv = isShowTv ? isShowTv.toLowerCase() === \"true\" : true;\r\n if (this._isShowTv) {\r\n viewType = defaultViewType;\r\n } else {\r\n viewType = ViewType.original;\r\n }\r\n this.state = { viewType };\r\n }\r\n\r\n private setViewType = (viewType: ViewType) => {\r\n if (this._isShowTv) {\r\n this.setState({ viewType });\r\n }\r\n }\r\n\r\n private onFullSceen = () => {\r\n \r\n }\r\n private addIndicator = () => {\r\n if (this.state.viewType === ViewType.tradingview) {\r\n this.commandDispatcher.addIndicatorForTv();\r\n } else {\r\n this.commandDispatcher.addIndicator();\r\n }\r\n }\r\n private showChartProperties = () => {\r\n this.commandDispatcher.showChartProperties();\r\n }\r\n\t// private setResolution = (resolution: string) => {\r\n\t// \tthis.commandDispatcher.setResolution(resolution);\r\n\t// }\r\n\r\n private setChartCount = (count: number) => {\r\n if (this.props.setChartCount) {\r\n this.props.setChartCount(count);\r\n }\r\n }\r\n\r\n public render() {\r\n const win: any = window;\r\n const company = win.company;\r\n const { chartConfig, dataSource, priceDecimals, theme, isPad, showMultiChartMemu, chartIndex, issplitterdragging } = this.props;\r\n const { viewType } = this.state;\r\n const showmcMenu = showMultiChartMemu ?? false;\r\n const tvContainerId = 'TvContainer' + chartIndex[0];\r\n const pointerEvents = issplitterdragging ? 'none' : 'auto';\r\n const background = theme === \"white\" ? \"white\" : \"black\";\r\n const chartCount = chartIndex[1];\r\n let paddingProp = {};\r\n if (chartCount > 1) paddingProp = { paddingRight: '2px' }; // paddingRight for splitter work\r\n return (\r\n \r\n
\r\n \r\n { }}\r\n onChartExitFullScreen={() => { }}\r\n priceDecimals={priceDecimals}\r\n isPad={isPad}\r\n theme={theme}\r\n company={company}\r\n visible={this.state.viewType === ViewType.original}\r\n commandDispatcher={this.commandDispatcher}\r\n chartIndex={chartIndex}\r\n />\r\n \r\n
\r\n
\r\n );\r\n }\r\n}\r\nexport default ChartFrame;\r\n","import React from 'react';\r\nimport PubSub from 'pubsub-js'\r\n// import ReactDOM from 'react-dom';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { withTranslation, Trans } from 'react-i18next';\r\nimport { Button } from 'antd';\r\n\r\nimport { PriceTrend, OrderType, InstrumentCategory } from '../../common/const';\r\n\r\nimport * as utils from '../../common/utils.js';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\nimport PlacingDqView from './placingdqview';\r\nimport PlacingPendingView from './placingpendingview';\r\nimport WorkingListView from './workinglistview';\r\nimport PendingListView from './pendinglistview';\r\nimport InventoryView from '../physical/inventoryview';\r\nimport DeliveryInProcessView from '../physical/deliveryinprocessview';\r\n\r\nimport dataSource from '../../chart/data/dataSource';\r\nimport ChartFrame from '../../chart/ChartFrame';\r\nimport { ChartType } from '../../chart/typeDefine';\r\nimport { ChartConfigs, getChartConfigs } from '../../chart/chartHelper';\r\n\r\nconst PlacePanelType = { None: 0, WorkingList: 1, PendingList: 2, SpotTrade: 3, PendingOrder: 4, Inventory: 5, InventoryInProcess: 6 };\r\nconst PlacingDqViewComponent = withTranslation()(PlacingDqView);\r\n\r\nclass PlaceView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n console.log('PlaceView.ctor');\r\n\r\n this.state = {\r\n showPlacePanel: props.model && props.model.placingData && props.model.placingData.placePanelType ? props.model.placingData.placePanelType : PlacePanelType.None,\r\n orderType: props.model && props.model.placingData ? props.model.placingData.orderType : OrderType.SpotTrade\r\n }\r\n\r\n if (!props.isPad) {\r\n this.createChartElement.call(this);\r\n }\r\n\r\n // console.log(\"createChartDataSource in ctor: \" + (this.chartDataSource === void 0 ? \"not created.\" : \"created.\"));\r\n }\r\n\r\n getchartConfig(instrumentId) {\r\n const configs = getChartConfigs(instrumentId);\r\n return configs[0];\r\n }\r\n\r\n createChartElement() {\r\n if (utils.getQueryString('test').startsWith('true')) return;\r\n\r\n const { model, commService } = this.props;\r\n if (model && model.placingData) {\r\n const { Id, Code, Description } = model.placingData.selectedInstrument;\r\n const decimals = model.placingData.selectedInstrument.Denominator.length - 1;\r\n const quotePolicyId = model.placingData.selectedInstrument.lastQuotation.QuotePolicyId;\r\n const configs = ChartConfigs.get(Id);\r\n const chartType = configs ? configs[0].chartType : ChartType.Minute1;\r\n this.chartDataSource = dataSource()\r\n .instrumentId(Id)\r\n .instrumentCode(Code)\r\n .instrumentDescription(Description)\r\n .quotePolicyId(quotePolicyId)\r\n .chartType(chartType)\r\n .commService(commService)\r\n .model(model);\r\n\r\n this.chartElement = (\r\n { }}\r\n onChartExitFullScreen={() => { }}\r\n isPad={false}\r\n theme={this.getTheme()}\r\n chartIndex={[0, 1]}\r\n />\r\n );\r\n this.subTopic = `q.${Id}`;\r\n PubSub.subscribe(this.subTopic, this.notifyRealTimeQuotation.bind(this));\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.subTopic) {\r\n PubSub.unsubscribe(this.subTopic);\r\n }\r\n\r\n\r\n\r\n }\r\n\r\n notifyRealTimeQuotation(quotation) {\r\n if (utils.getQueryString('test').startsWith('true')) return;\r\n\r\n\r\n if (quotation.Bid && quotation.Ask) {\r\n const shouldNofityChart = !this.lastQuotation || (this.lastQuotation.Ask != quotation.Ask || this.lastQuotation.Bid != quotation.Bid);\r\n if (shouldNofityChart) {\r\n this.chartDataSource.OnRealPrice(+quotation.Bid, +quotation.Ask, quotation.Timestamp);\r\n }\r\n this.lastQuotation = { Timestamp: quotation.Timestamp, Bid: quotation.Bid, Ask: quotation.Ask };\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n }\r\n\r\n onPlaceMaskClick(e) {\r\n this.setState({ showPlacePanel: PlacePanelType.None });\r\n\r\n const { model } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n if (instrument.physicalInventory) {\r\n Object.values(instrument.physicalInventory).forEach((inventory, index) => {\r\n if (parseFloat(inventory.LotBalance) > 0) {\r\n inventory.deliveryLot = 0;\r\n inventory.checked = false;\r\n }\r\n });\r\n }\r\n }\r\n\r\n onBuySellButtonClick(isBuy) {\r\n const { model } = this.props;\r\n model.placingData.isBuy = isBuy;\r\n let instrument = this.props.model.placingData.selectedInstrument;\r\n if (model.canPlaceOrder(model.selectedAccount, instrument, OrderType.SpotTrade) || model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Market)) {\r\n this.setState({ orderType: OrderType.SpotTrade, showPlacePanel: PlacePanelType.SpotTrade });\r\n this.props.model.placingData.placePanelType = PlacePanelType.SpotTrade;\r\n\r\n model.orderingNotify(utils.uuid(), model.customer.Code, model.placingData.selectedInstrument.Code, isBuy.toString(), 'true', '1', (d) => { });\r\n\r\n } else {\r\n this.setState({ orderType: OrderType.Limit, showPlacePanel: PlacePanelType.PendingOrder });\r\n this.props.model.placingData.placePanelType = PlacePanelType.PendingOrder;\r\n }\r\n\r\n }\r\n\r\n onOrderTypeChange(orderType) {\r\n this.props.model.placingData.orderType = orderType;\r\n let placePanelType = orderType === OrderType.Limit ? PlacePanelType.PendingOrder : PlacePanelType.SpotTrade;\r\n this.setState({ orderType: orderType, showPlacePanel: placePanelType });\r\n this.props.model.placingData.placePanelType = placePanelType;\r\n }\r\n\r\n onWorkListButtonClick(placePanelType) {\r\n this.setState({ showPlacePanel: placePanelType });\r\n this.props.model.placingData.placePanelType = placePanelType; // PlacePanelType.None;\r\n }\r\n\r\n onCloseOrderClick() {\r\n // let instrument = this.props.model.placingData.selectedInstrument;\r\n if (this.props.model.placingData.selectedInstrument.openPositions) {\r\n // let openPositions = Object.values(instrument.openPositions);\r\n // openPositions.forEach((order, index) => {\r\n // //if(Boolean.parseBoolean(order.IsBuy) === !this.props.isBuy ){\r\n // order.selectedLot = parseFloat(order.LotBalance);\r\n // //}\r\n // });\r\n\r\n // let orderTypes = instrument.getAvailableOrderTypes();\r\n // let isMarket = orderTypes.indexOf(OrderType.Market) >= 0;\r\n // let orderType = this.state.orderType;\r\n // if (isMarket && orderType === OrderType.SpotTrade) {\r\n // orderType = OrderType.Market;\r\n // }\r\n\r\n // this.props.model.placingData.orderType = orderType;\r\n this.props.history.push('/closeorder');\r\n }\r\n }\r\n\r\n onConfirmClosed(isConfirmed, placePanelType) {\r\n this.setState({ showPlacePanel: isConfirmed ? PlacePanelType.None : placePanelType });\r\n // this.setState({ showPlacePanel: PlacePanelType.None });\r\n }\r\n\r\n onBackgroundPaneClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n\r\n render() {\r\n let { model, isPad } = this.props;\r\n if (!model || !model.placingData) {\r\n this.goto('/');\r\n return '';\r\n }\r\n\r\n let moduleCss = this.getModuleCss('placeview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let account = model.selectedAccount;\r\n let accountQuotePolicyId = (account.UseQuotePolicyId ? account.UseQuotePolicyId : account.PublicQuotePolicyId);\r\n let quotation = (instrument.quotations ? instrument.quotations[accountQuotePolicyId] : undefined);\r\n if (!quotation) {\r\n quotation = instrument.quotation ? instrument.quotation : {};\r\n }\r\n // let canPlaceOrder = model.canPlaceOrder(model.selectedAccount, instrument, OrderType.SpotTrade) \r\n // || model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Market) \r\n // || model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Limit);\r\n let isLogedin = (model && model.isLogedin());\r\n let canPlaceOrder = isLogedin && (model.canPlaceOrder(model.selectedAccount, instrument, OrderType.SpotTrade)\r\n || model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Market)\r\n || model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Limit));\r\n\r\n let isPhysical = (parseInt(instrument.Category) === InstrumentCategory.Physical);\r\n if (!this.props.isPad && quotation && quotation.Bid) {\r\n this.notifyRealTimeQuotation(quotation);\r\n }\r\n\r\n let bottomView = null;\r\n if (this.state.showPlacePanel === PlacePanelType.SpotTrade) {\r\n bottomView = this.onConfirmClosed(isConfirmed, PlacePanelType.SpotTrade)} onClosePaneClick={() => this.setState({ showPlacePanel: PlacePanelType.None })} onRoutePathChange={this.props.onRoutePathChange} onSwitchFullScreen={(value) => this.setState({ subViewFullScreen: value })} />;\r\n } else if (this.state.showPlacePanel === PlacePanelType.PendingOrder) {\r\n bottomView = this.onConfirmClosed(isConfirmed, PlacePanelType.PendingOrder)} onClosePaneClick={() => this.setState({ showPlacePanel: PlacePanelType.None })} onSwitchFullScreen={(value) => this.setState({ subViewFullScreen: value })} />;\r\n } else if (this.state.showPlacePanel === PlacePanelType.WorkingList) {\r\n bottomView = this.onWorkListButtonClick(PlacePanelType.None)} />;\r\n } else if (this.state.showPlacePanel === PlacePanelType.PendingList) {\r\n bottomView = this.onWorkListButtonClick(PlacePanelType.None)} />;\r\n } else if (this.state.showPlacePanel === PlacePanelType.Inventory) {\r\n bottomView = this.onWorkListButtonClick(PlacePanelType.None)} />;\r\n } else if (this.state.showPlacePanel === PlacePanelType.InventoryInProcess) {\r\n bottomView = this.onWorkListButtonClick(PlacePanelType.None)} />;\r\n }\r\n\r\n\r\n let quotationRiseColor = model.config.getValue('quotationRiseColor', '#32cd32');\r\n let quotationRiseForeColor = model.config.getValue('quotationRiseForeColor', this.getTheme() == 'white' ? '#000000' : '#ffffff');\r\n let quotationFallColor = model.config.getValue('quotationFallColor', \"#ff0000\");\r\n let quotationFallForeColor = model.config.getValue('quotationFallForeColor', this.getTheme() == 'white' ? '#000000' : '#ffffff');\r\n\r\n let colorStyle = { borderWidth: '1px', borderStyle: 'solid', borderRadius: '5px' };\r\n if (instrument.priceTrend === PriceTrend.Rise) {\r\n colorStyle.backgroundColor = quotationRiseColor;\r\n colorStyle.color = quotationRiseForeColor;\r\n } else if (instrument.priceTrend === PriceTrend.Fall) {\r\n colorStyle.backgroundColor = quotationFallColor;\r\n colorStyle.color = quotationFallForeColor;\r\n } else {\r\n colorStyle.borderWidth = '0px';\r\n colorStyle.margin = '1px';\r\n }\r\n let mobileBottomStyle = isPad ? {} : { position: 'fixed', bottom: '0em', width: '100%' };\r\n\r\n return
\r\n
\r\n {this.props.isPad || this.state.subViewFullScreen ? null :
}\r\n {this.props.isPad ? null :
\r\n
{utils.getTimeString(quotation.Timestamp)}
\r\n
  {instrument.Description}
\r\n
{quotation.Bid}/{quotation.Ask}
\r\n
\r\n DialogWindow.Open {instrument.formatRearPrice(quotation.Open, quotation.AskOpen)}\r\n DialogWindow.High {instrument.formatRearPrice(quotation.High, quotation.AskHigh)}\r\n
\r\n
\r\n DialogWindow.PrevClose {instrument.formatRearPrice(quotation.PrevBid, quotation.PrevAsk)}\r\n DialogWindow.Low {instrument.formatRearPrice(quotation.Low, quotation.AskLow)}\r\n
\r\n\r\n
\r\n
this.onWorkListButtonClick(PlacePanelType.WorkingList)}>DialogWindow.OnlineTrading
\r\n
this.onWorkListButtonClick(PlacePanelType.PendingList)}>DialogWindow.UnPendingOrder
\r\n\r\n {!isPhysical ? null :
this.onWorkListButtonClick(PlacePanelType.Inventory)}>DialogWindow.Physical_Inventory
}\r\n {!isPhysical ? null :
this.onWorkListButtonClick(PlacePanelType.InventoryInProcess)}>DialogWindow.Physical_InventoryInProcess
}\r\n
\r\n\r\n
}\r\n\r\n
{this.chartElement}
\r\n\r\n {this.state.showPlacePanel !== PlacePanelType.None ? '' :
\r\n \r\n \r\n
}\r\n
\r\n\r\n
this.onPlaceMaskClick(e)} >\r\n
\r\n
{bottomView}
\r\n
\r\n\r\n
\r\n }\r\n\r\n}\r\n\r\nlet placeView = withRouter(PlaceView);\r\nexport { placeView as PlaceView };\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { message as antMessage, Button, Checkbox, Select, Radio, Calendar, Modal } from 'antd';\r\nimport moment from 'moment';\r\nimport { CaretDownFilled } from '@ant-design/icons';\r\n\r\nimport { DeliveryMode, PhysicalChargeBasis } from '../../common/const';\r\nimport * as utils from '../../common/utils';\r\nimport * as physiclHelper from '../../model/physicalHelper.js';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\nimport { InventoryItemView } from './inventoryitemview';\r\n\r\n\r\nconst { Option } = Select;\r\n\r\n\r\nlet specificStyleProduct = {\r\n background: 'inherit',\r\n display: 'table-cell'\r\n}\r\n\r\nclass SpecificationItem extends BaseView {\r\n\r\n onCheckBoxChange(e) {\r\n console.log('SpecificationItem.onCheckBoxChange');\r\n this.props.specificationDetail.checked = e.target.checked;\r\n if (this.props.onCheckBoxChange) {\r\n this.props.onCheckBoxChange(this.props.specificationDetail);\r\n }\r\n this.forceUpdate();\r\n }\r\n\r\n onQuantityChange(e, v) {\r\n console.log('onQuantityChange');\r\n let newQuantity = parseInt(e.target.value);\r\n let { specificationDetail, beforeQuantityChange, onQuantityChange } = this.props;\r\n if (isNaN(newQuantity)) {\r\n specificationDetail.quantity = 0;\r\n } else {\r\n if (beforeQuantityChange) {\r\n specificationDetail.quantity = beforeQuantityChange(specificationDetail, newQuantity);\r\n // return;\r\n } else {\r\n specificationDetail.quantity = newQuantity;\r\n }\r\n }\r\n if (onQuantityChange) {\r\n onQuantityChange(specificationDetail);\r\n }\r\n this.forceUpdate();\r\n }\r\n\r\n render() {\r\n let css = this.getModuleCss('deliveryview', 'common');\r\n let { model, tradePolicyDetail, isTitle, chargeBasis } = this.props;\r\n let showCharge = (chargeBasis == parseInt(PhysicalChargeBasis.OnSpecification));\r\n let specificationTitle = \"DialogWindow.Physical_Specification\"; // (tradePolicyDetail.DeliveryMode == DeliveryMode.Summarized ? \"DialogWindow.Physical_Specification\" : \"DialogWindow.Physical_DeliverySpecification\");\r\n if (isTitle) {\r\n return
\r\n
\r\n
{specificationTitle}
\r\n
{showCharge ? DialogWindow.Physical_DeliveryCharge : ''}
\r\n
DialogWindow.Physical_UnitDialogWindow.Physical_Weight
\r\n
DialogWindow.Physical_DeliverySpecificationQuantity
\r\n
\r\n } else {\r\n let specificationDetail = this.props.specificationDetail;\r\n let productName = specificationDetail.ENG;\r\n\r\n switch (this.props.commService.state.loginParam.language) {\r\n case \"cht\":\r\n productName = specificationDetail.CHT;\r\n break;\r\n case \"chs\":\r\n productName = specificationDetail.CHS;\r\n break;\r\n default:\r\n productName = specificationDetail.ENG;\r\n }\r\n specificationDetail.productName = productName;\r\n return
\r\n
\r\n
{productName}
\r\n
{showCharge ? specificationDetail.DeliveryCharge : ''}
\r\n
{parseFloat(specificationDetail.Size) + parseFloat(specificationDetail.Premium)}{this.props.instrument.Unit}
\r\n \r\n
\r\n }\r\n }\r\n}\r\n\r\nclass DeliveryView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n // this.state = { addressOptions: [], selectedAddressId: undefined };\r\n this.init(props);\r\n }\r\n\r\n componentDidMount() {\r\n // this.setState({ orderGroup : this.props.orderGroup});\r\n\r\n }\r\n\r\n sortSpecification(a, b) {\r\n if (a.Size == b.Size)\r\n return 0;\r\n else\r\n return parseFloat(a.Size) < parseFloat(b.Size) ? 1 : -1;\r\n\r\n // if(a.Unit === b.Unit) return parseFloat(a.Size) < parseFloat(b.Size);\r\n // else return parseFloat(a.Unit) < parseFloat(b.Unit);\r\n }\r\n\r\n init(props) {\r\n let { model, commService } = props;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : {});\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let addressOptions = [];\r\n if (model.placingData.deliveryAddresses) {\r\n model.placingData.deliveryAddresses.forEach((address, index) => {\r\n addressOptions.push( {address.Address} );\r\n });\r\n\r\n }\r\n\r\n let deliveryCharge = utils.isEmpty(tradePolicyDetail.DeliveryChargeId) ? {} : model.deliveryCharges[tradePolicyDetail.DeliveryChargeId];\r\n let chargeBasis = parseInt(deliveryCharge.ChargeBasis);\r\n\r\n let specificationItems = [];\r\n let specifications = [];\r\n let deliverySpecificationDetails = model.deliverySpecificationDetails[instrument.DeliverySpecificationId] ? Object.values(model.deliverySpecificationDetails[instrument.DeliverySpecificationId]) : undefined;\r\n\r\n if (deliverySpecificationDetails) {\r\n deliverySpecificationDetails.sort(this.sortSpecification);\r\n\r\n specificationItems.push();\r\n if (deliverySpecificationDetails !== undefined) {\r\n deliverySpecificationDetails.forEach((deliverySpecification, index) => {\r\n let specification = deliverySpecification; // Object.assign({}, deliverySpecification);\r\n specification.checked = false;\r\n specification.quantity = 0;\r\n specifications.push(specification);\r\n specificationItems.push();\r\n });\r\n }\r\n }\r\n\r\n let deliveryBeginDate = model.getServerTime().startOf('day');\r\n if (parseInt(instrument.DeliveryTimeBeginDay) > 0) {\r\n deliveryBeginDate = this.businessDayAdd(deliveryBeginDate, parseInt(instrument.DeliveryTimeBeginDay)); // moment(deliveryBeginDate).add(parseInt(instrument.DeliveryTimeBeginDay), 'days'); //this.addDays(instrument.DeliveryTimeBeginDay);\r\n }\r\n let deliveryEndDate = deliveryBeginDate.clone();\r\n if (parseInt(instrument.DeliveryTimeEndDay) > 0) {\r\n deliveryEndDate = this.businessDayAdd(deliveryEndDate, parseInt(instrument.DeliveryTimeEndDay) - 1);\r\n } else {\r\n deliveryEndDate.add(3650, 'days');\r\n }\r\n\r\n let deliveryProps = this.initDeliveryLot(props);\r\n Object.assign(deliveryProps, { addressOptions: addressOptions, selectedAddressId: model.placingData.deliveryAddresses[0].Id, specificationItems: specificationItems, specifications: specifications, deliveryBeginDate: deliveryBeginDate, deliveryDate: deliveryBeginDate.clone(), deliveryEndDate: deliveryEndDate, modalVisible: false });\r\n this.state = deliveryProps;\r\n }\r\n\r\n // canDelivery(inventory) {\r\n // let physicalOriginValueBalance = parseFloat(inventory.PhysicalOriginValueBalance);\r\n // let paidPledgeBalance = parseFloat(inventory.PaidPledgeBalance);\r\n // let lotBalance = parseFloat(inventory.LotBalance) - parseFloat(inventory.deliveryLotInProcess.toFixed(6));\r\n // return (parseFloat(lotBalance) > 0 && physicalOriginValueBalance == Math.abs(paidPledgeBalance));\r\n // }\r\n\r\n initDeliveryLot(props) {\r\n console.log('initDeliveryLot');\r\n let { model, isPad } = props;\r\n // let instrument = model.placingData.selectedInstrument;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : {});\r\n\r\n let deliveryLot = 0;\r\n let deliveryQuantity = 0, avialabeQuantity = 0;\r\n let orderViews = [];\r\n let inventories = [];\r\n orderViews.push( );\r\n\r\n Object.values(instrument.physicalInventory).forEach((inventory, index) => {\r\n if (physiclHelper.canDelivery(inventory)) {\r\n inventories.push(inventory);\r\n orderViews.push( this.setState(this.initDeliveryLot(this.props))} />);\r\n\r\n if (inventory.deliveryLot) {\r\n deliveryLot += inventory.deliveryLot;\r\n deliveryQuantity += (inventory.deliveryLot * parseFloat(inventory.Transaction.ContractSize) * parseFloat(instrumentUnit.Weight));\r\n }\r\n let lotBalance = parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess;\r\n avialabeQuantity += lotBalance * parseFloat(inventory.Transaction.ContractSize) * parseFloat(instrumentUnit.Weight);\r\n }\r\n\r\n });\r\n this.recalcSpecificationCharge();\r\n return { inventories: inventories.sort((a, b) => a.Transaction.ExecuteTime.localeCompare(b.Transaction.ExecuteTime)), openOrderView: orderViews, deliveryLot: parseFloat(deliveryLot.toFixed(6)), deliveryQuantity: parseFloat(deliveryQuantity.toFixed(6)), avialabeQuantity: parseFloat(avialabeQuantity.toFixed(6)) };\r\n\r\n }\r\n\r\n recalculateSpecification(deliverySpecification) {\r\n console.log('recalculateSpecification');\r\n let { model } = this.props;\r\n let specifications = this.state.specifications;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n if (tradePolicyDetail.DeliveryMode == DeliveryMode.ShowDetails) {\r\n\r\n //decimal remainderQuantity = inventory.RequireQuantity; \r\n let remainderQuantity = this.state.deliveryQuantity; // this.state.avialabeQuantity;\r\n if (remainderQuantity == 0) {\r\n // deliverySpecification.checked = false;\r\n }\r\n else {\r\n if (deliverySpecification.checked) {\r\n // inventory.IsSelectDeliverySpecification = true;\r\n for (var i = 0; i < specifications.length; i++) {\r\n let item = specifications[i];\r\n item.quantity = (item.quantity === undefined ? 0 : item.quantity);\r\n if (item.checked && item.Size != deliverySpecification.Size) {\r\n remainderQuantity = remainderQuantity - (parseFloat(item.quantity) * (parseFloat(item.Size) + parseFloat(item.Premium)));\r\n }\r\n }\r\n deliverySpecification.quantity = parseInt((remainderQuantity / (parseFloat(deliverySpecification.Size) + parseFloat(deliverySpecification.Premium))).toFixed(6));\r\n }\r\n else {\r\n // bool isSelectDeliverySpecification = false;\r\n for (var i = 0; i < specifications.length; i++) {\r\n let item = specifications[i];\r\n item.quantity = (item.quantity === undefined ? 0 : item.quantity);\r\n if (item.checked && parseFloat(item.Size) != parseFloat(deliverySpecification.Size)) {\r\n // isSelectDeliverySpecification = true;\r\n }\r\n }\r\n deliverySpecification.quantity = 0;\r\n // inventory.IsSelectDeliverySpecification = isSelectDeliverySpecification;\r\n }\r\n }\r\n } else {\r\n let totalSpecifiedQuantity = 0;\r\n let totalSpecifiedQuantityWithoutSender = 0;\r\n let selectedCount = 0;\r\n let remainsQuantity = 0, avialabeQuantity = 0;\r\n let instrument = model.placingData.selectedInstrument;\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : {});\r\n this.state.inventories.forEach((inventory) => {\r\n if (physiclHelper.canDelivery(inventory)) {\r\n let lotBalance = parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess;\r\n avialabeQuantity += parseFloat(inventory.Transaction.ContractSize) * lotBalance * parseFloat(instrumentUnit.Weight);\r\n }\r\n });\r\n avialabeQuantity = parseFloat(avialabeQuantity.toFixed(6));\r\n remainsQuantity = avialabeQuantity;\r\n\r\n for (let i = 0; i < specifications.length; i++) {\r\n let specification = specifications[i];\r\n if (specification.checked && specification.quantity > 0) {\r\n remainsQuantity -= (specification.quantity * (parseFloat(specification.Size) + parseFloat(specification.Premium)));\r\n }\r\n }\r\n\r\n // foreach (DeliverySpecification specification in this.DeliverySpecificationList)\r\n for (let i = 0; i < specifications.length; i++) {\r\n\r\n let specification = specifications[i];\r\n if (specification.checked) {\r\n if (specification == deliverySpecification && (specification.quantity == 0 || specification.quantity == undefined) && specification.checked) {\r\n specification.quantity = parseInt((remainsQuantity) / (parseFloat(specification.Size) + parseFloat(specification.Premium)));\r\n }\r\n\r\n selectedCount++;\r\n // this.Inventory.IsSelectDeliverySpecification = true;\r\n totalSpecifiedQuantity += ((parseFloat(specification.Size) + parseFloat(specification.Premium)) * specification.quantity); // specification.quantity; // \r\n // if (specification != sender) {\r\n // totalSpecifiedQuantityWithoutSender += ((specification.Size + specification.Premium) * specification.Quantity);\r\n // }\r\n }\r\n else {\r\n specification.quantity = 0;\r\n }\r\n }\r\n\r\n totalSpecifiedQuantity = parseFloat(totalSpecifiedQuantity.toFixed(6));\r\n remainsQuantity = totalSpecifiedQuantity\r\n let inventories = Object.values(this.state.inventories);\r\n inventories.forEach((inventory) => {\r\n // inventory.checked = false;\r\n if (remainsQuantity > 0 && physiclHelper.canDelivery(inventory)) {\r\n let lotBalance = parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess;\r\n let deliveryLot = parseFloat(lotBalance.toFixed(6)); // (inventory.LotBalance - inventory.UnfilledLot);\r\n // inventory.checked = true;\r\n if (deliveryLot * parseFloat(inventory.Transaction.ContractSize) * parseFloat(instrumentUnit.Weight) <= remainsQuantity) {\r\n inventory.deliveryLot = deliveryLot;\r\n }\r\n else {\r\n inventory.deliveryLot = parseFloat(remainsQuantity / (parseFloat(inventory.Transaction.ContractSize) * parseFloat(instrumentUnit.Weight))).toFixed(6);\r\n }\r\n\r\n remainsQuantity -= inventory.deliveryQuantity;\r\n }\r\n });\r\n\r\n this.setState({ avialabeQuantity: avialabeQuantity, totalSpecifiedQuantity: totalSpecifiedQuantity });\r\n }\r\n\r\n let deliveryLotResult = this.getDeliveryLotResult();\r\n this.setState({ deliveryLot: deliveryLotResult.deliveryLot, deliveryQuantity: deliveryLotResult.deliveryQuantity });\r\n this.recalcSpecificationCharge();\r\n }\r\n\r\n recalcSpecificationCharge() {\r\n let { model } = this.props;\r\n let charge = 0;\r\n let instrument = this.props.model.placingData.selectedInstrument;\r\n let isNormal = utils.parseBoolean(instrument.IsNormal);\r\n let account = model.selectedAccount;\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let quotation = instrument.lastQuotation;\r\n\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : { Weight: 1 });\r\n\r\n\r\n if (!utils.isEmpty(tradePolicyDetail.DeliveryChargeId)) {\r\n let deliveryCharge = model.deliveryCharges[tradePolicyDetail.DeliveryChargeId];\r\n let chargeBasis = parseInt(deliveryCharge.ChargeBasis);\r\n let price = parseFloat(isNormal ? quotation.Bid : quotation.Ask);\r\n if (chargeBasis === PhysicalChargeBasis.DayOpenPrice) {\r\n price = parseFloat(isNormal ? quotation.Open : quotation.AskOpen);\r\n }\r\n if (chargeBasis === PhysicalChargeBasis.OnSpecification) {\r\n if (this.state && this.state.specifications) {\r\n this.state.specifications.forEach((specification) => {\r\n if (specification.checked && specification.quantity > 0) {\r\n charge += (specification.quantity * parseFloat(specification.DeliveryCharge));\r\n }\r\n });\r\n }\r\n } else {\r\n\r\n Object.values(instrument.physicalInventory).forEach((inventory) => {\r\n if (physiclHelper.canDelivery(inventory) && (tradePolicyDetail.DeliveryMode == DeliveryMode.Summarized || inventory.checked)) {\r\n if (chargeBasis === PhysicalChargeBasis.UnitFixAmount) {\r\n let lotBalance = inventory.deliveryLot; // - inventory.deliveryLotInProcess;\r\n charge += lotBalance * deliveryCharge.ChargeRate;\r\n } else if (chargeBasis === PhysicalChargeBasis.MkTPrice || chargeBasis === PhysicalChargeBasis.DayOpenPrice) {\r\n let lotBalance = inventory.deliveryLot; // - inventory.deliveryLotInProcess;\r\n charge += price * parseFloat(inventory.Transaction.ContractSize) * lotBalance * parseFloat(instrumentUnit.Weight);\r\n }\r\n }\r\n });\r\n }\r\n charge = Math.max(parseFloat(deliveryCharge.MinCharge), charge);\r\n }\r\n\r\n if (!utils.parseBoolean(account.IsMultiCurrency)) {\r\n charge = model.exchangeRate(charge, instrument.CurrencyId, account.CurrencyID);\r\n }\r\n let currency = model.currencies[utils.parseBoolean(account.IsMultiCurrency) ? instrument.CurrencyId : account.CurrencyID];\r\n if (charge != 0) {\r\n this.setState({ deliveryCharge: parseFloat(charge.toFixed(parseInt(currency.Decimals))) });\r\n }\r\n return charge;\r\n }\r\n\r\n onSpecificationQuantityChange(sender) {\r\n let deliveryLotResult = this.getDeliveryLotResult();\r\n this.setState({ deliveryLot: deliveryLotResult.deliveryLot, deliveryQuantity: deliveryLotResult.deliveryQuantity });\r\n this.recalcSpecificationCharge();\r\n }\r\n\r\n beforeSpecificationQuantityChange(sender, newQuantity) {\r\n console.log('beforeSpecificationQuantityChange', newQuantity);\r\n let { model } = this.props;\r\n let specifications = this.state.specifications;\r\n\r\n let avialabeQuantity = 0;\r\n let instrument = model.placingData.selectedInstrument;\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : {});\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n\r\n this.state.inventories.forEach((inventory) => {\r\n if (physiclHelper.canDelivery(inventory) && (tradePolicyDetail.DeliveryMode == DeliveryMode.Summarized || inventory.checked)) {\r\n let lotBalance = parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess;\r\n avialabeQuantity += parseFloat(inventory.Transaction.ContractSize) * lotBalance * parseFloat(instrumentUnit.Weight);\r\n }\r\n });\r\n\r\n\r\n let totalSpecifiedQuantityWithoutSender = 0;\r\n\r\n specifications.forEach((specification) => {\r\n if (specification != sender && specification.checked && specification.quantity > 0) {\r\n totalSpecifiedQuantityWithoutSender += (specification.quantity * (parseFloat(specification.Size) + parseFloat(specification.Premium)));\r\n }\r\n });\r\n\r\n if ((totalSpecifiedQuantityWithoutSender + (newQuantity * (parseFloat(sender.Size) + parseFloat(sender.Premium)))) > avialabeQuantity) {\r\n sender.quantity = parseInt((avialabeQuantity - totalSpecifiedQuantityWithoutSender) / (parseFloat(sender.Size) + parseFloat(sender.Premium)));\r\n newQuantity = sender.quantity;\r\n }\r\n\r\n let totalSpecifiedQuantity = totalSpecifiedQuantityWithoutSender + (newQuantity * (parseFloat(sender.Size) + parseFloat(sender.Premium)));\r\n\r\n // let remainsQuantity = totalSpecifiedQuantity;\r\n let inventories = Object.values(this.state.inventories).sort((a, b) => a.Transaction.ExecuteTime.localeCompare(b.Transaction.ExecuteTime));\r\n inventories.forEach((inventory) => {\r\n if (totalSpecifiedQuantity > 0 && physiclHelper.canDelivery(inventory) && (tradePolicyDetail.DeliveryMode == DeliveryMode.Summarized)) {\r\n let lotBalance = parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess;\r\n let deliveryLot = parseFloat(lotBalance.toFixed(6)); // (inventory.LotBalance - inventory.UnfilledLot);\r\n // inventory.checked = true;\r\n if (deliveryLot * parseFloat(inventory.Transaction.ContractSize) * parseFloat(instrumentUnit.Weight) <= totalSpecifiedQuantity) {\r\n inventory.deliveryLot = deliveryLot;\r\n }\r\n else {\r\n inventory.deliveryLot = parseFloat((totalSpecifiedQuantity / (parseFloat(inventory.Transaction.ContractSize) * parseFloat(instrumentUnit.Weight))).toFixed(6));\r\n }\r\n\r\n totalSpecifiedQuantity -= inventory.deliveryQuantity;\r\n } else {\r\n // inventory.checked = false;\r\n // inventory.deliveryLot = 0;\r\n }\r\n });\r\n\r\n totalSpecifiedQuantity = 0;\r\n specifications.forEach((specification) => {\r\n let quantity = (specification == sender ? newQuantity : specification.quantity);\r\n if (specification.checked && quantity > 0) {\r\n totalSpecifiedQuantity += (quantity * (parseFloat(specification.Size) + parseFloat(specification.Premium)));\r\n }\r\n });\r\n // this.recalcSpecificationCharge();\r\n this.setState({ deliveryQuantity: totalSpecifiedQuantity, avialabeQuantity: parseFloat(avialabeQuantity.toFixed(6)) });\r\n\r\n return newQuantity;\r\n }\r\n\r\n onBackgroundPaneClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n\r\n\r\n\r\n businessDayAdd = function (momentDate, days) {\r\n var d = momentDate.clone().add('d', Math.floor(days / 5) * 7);\r\n var remaining = days % 5;\r\n while (remaining) {\r\n d.add('d', 1);\r\n if (d.day() !== 0 && d.day() !== 6)\r\n remaining--;\r\n }\r\n console.log('businessDayAdd', momentDate.format(\"YYYY-MM-DD HH:mm:ss\"), days, d.format(\"YYYY-MM-DD HH:mm:ss\"));\r\n return d;\r\n }\r\n\r\n\r\n onAddressChange(value, option) {\r\n this.setState({ selectedAddressId: value });\r\n }\r\n\r\n onOpenOrderCheckboxChange(inventory, checked) {\r\n // this.forceUpdate();\r\n\r\n let { model, t, isPad } = this.props;\r\n let account = model.selectedAccount;\r\n let instrument = model.placingData.selectedInstrument;\r\n\r\n let deliverySpecificationDetails = model.deliverySpecificationDetails[instrument.DeliverySpecificationId] ? Object.values(model.deliverySpecificationDetails[instrument.DeliverySpecificationId]) : undefined;\r\n\r\n if (deliverySpecificationDetails) {\r\n deliverySpecificationDetails.forEach((deliverySpecification, index) => {\r\n let specification = deliverySpecification; // Object.assign({}, deliverySpecification);\r\n specification.checked = false;\r\n specification.quantity = 0;\r\n });\r\n }\r\n\r\n // let tradePolicyDetail = account.TradePolicyDetails[instrument.Id];\r\n // if (tradePolicyDetail.DeliveryMode == DeliveryMode.ShowDetails) {\r\n // let specifications = this.state.specifications;\r\n // for (let i = 0; i < specifications.length; i++) {\r\n // let specification = specifications[i];\r\n // specification.checked = false;\r\n // // specification.quantity =0;\r\n // } \r\n // }\r\n this.forceUpdate();\r\n this.setState(this.initDeliveryLot(this.props));\r\n }\r\n\r\n checkRequireLot(requireLot, tradePolicyDetail) {\r\n if (requireLot == 0 || requireLot < tradePolicyDetail.PhysicalMinDeliveryQuantity) {\r\n return false;\r\n } else if (tradePolicyDetail.PhysicalDeliveryIncremental != 0) {\r\n let quantity = parseFloat((requireLot / tradePolicyDetail.PhysicalDeliveryIncremental).toFixed(6));\r\n if (requireLot > tradePolicyDetail.PhysicalMinDeliveryQuantity && quantity != parseInt(quantity)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n //get and recalculate delivery lot\r\n getDeliveryLotResult() {\r\n let { model, t, isPad } = this.props;\r\n let account = model.selectedAccount;\r\n let instrument = model.placingData.selectedInstrument;\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : {});\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n\r\n let specifications = [];\r\n //let charge = 0;\r\n //check DeliveryRequestSpecification\r\n let specificationQuantity = 0, remainsQuantity = 0;\r\n this.state.specifications.forEach((specification, index) => {\r\n if (specification.checked && specification.quantity > 0) {\r\n // charge = charge + parseFloat(specification.DeliveryCharge);\r\n specifications.push({ DeliveryRequestSpecification: { Quantity: specification.quantity, Size: specification.Size, Premium: specification.Premium, UnitId: instrument.UnitId, productName: specification.productName } })\r\n\r\n specificationQuantity += specification.quantity * (parseFloat(specification.Size) + parseFloat(specification.Premium));\r\n }\r\n });\r\n\r\n remainsQuantity = specificationQuantity;\r\n let totalDeliveryLot = 0, totalQuantity = 0;\r\n let inventories = Object.values(this.state.inventories).sort((a, b) => a.Transaction.ExecuteTime.localeCompare(b.Transaction.ExecuteTime));\r\n inventories.forEach((inventory, index) => {\r\n // let physicalOriginValueBalance = parseFloat(inventory.PhysicalOriginValueBalance);\r\n // let paidPledgeBalance = parseFloat(inventory.PaidPledgeBalance);\r\n if (physiclHelper.canDelivery(inventory)) {\r\n let lotBalance = parseFloat(inventory.LotBalance) - inventory.deliveryLotInProcess;\r\n let deliveryLot = parseFloat(lotBalance.toFixed(6)); // (inventory.LotBalance - inventory.UnfilledLot);\r\n\r\n if (tradePolicyDetail.DeliveryMode == DeliveryMode.Summarized) {\r\n if (deliveryLot * parseFloat(inventory.Transaction.ContractSize) * parseFloat(instrumentUnit.Weight) <= remainsQuantity) {\r\n inventory.deliveryLot = deliveryLot;\r\n }\r\n else {\r\n inventory.deliveryLot = parseFloat((remainsQuantity / (parseFloat(inventory.Transaction.ContractSize) * parseFloat(instrumentUnit.Weight))).toFixed(6));\r\n }\r\n\r\n } else if (tradePolicyDetail.DeliveryMode == DeliveryMode.ShowDetails) {\r\n // inventory.deliveryLot = inventory.checked ? deliveryLot : 0;\r\n }\r\n inventory.deliveryQuantity = inventory.deliveryLot * (parseFloat(inventory.Transaction.ContractSize) * parseFloat(instrumentUnit.Weight));\r\n remainsQuantity -= inventory.deliveryQuantity;\r\n\r\n totalDeliveryLot += inventory.deliveryLot;\r\n totalQuantity += inventory.deliveryQuantity;\r\n }\r\n });\r\n\r\n return { deliveryLot: parseFloat(totalDeliveryLot.toFixed(6)), deliveryQuantity: parseFloat(totalQuantity.toFixed(6)), remainsQuantity: remainsQuantity, specifications: specifications, specificationQuantity: specificationQuantity };\r\n }\r\n\r\n onSubmitButtonClick() {\r\n let { model, t, isPad } = this.props;\r\n let account = model.selectedAccount;\r\n let instrument = model.placingData.selectedInstrument;\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : {});\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n\r\n if (!this.checkRequireLot(this.state.deliveryLot, tradePolicyDetail)) {\r\n utils.logError(DialogWindow.Physical_LotIsNotValid);\r\n return;\r\n }\r\n\r\n let lotResult = this.getDeliveryLotResult();\r\n if (this.state.specifications.length > 0 && lotResult.specificationQuantity != lotResult.deliveryQuantity) {\r\n utils.logError(DialogWindow.Physical_SpecificationIsIncorrect)\r\n return;\r\n }\r\n\r\n let orderRelations = [];\r\n let deliveryRequestId = utils.uuid();\r\n Object.values(instrument.physicalInventory).forEach((inventory, index) => {\r\n if (physiclHelper.canDelivery(inventory) && inventory.deliveryLot > 0) {\r\n let orderRelation = {\r\n DeliveryRequestId: deliveryRequestId,\r\n OpenOrderId: inventory.ID,\r\n DeliveryQuantity: inventory.deliveryLot * parseFloat(inventory.Transaction.ContractSize) * parseFloat(instrumentUnit.Weight),\r\n DeliveryLot: inventory.deliveryLot\r\n };\r\n orderRelations.push(orderRelation);\r\n }\r\n });\r\n\r\n let data = {\r\n Id: deliveryRequestId,\r\n AccountID: account.Id,\r\n InstrumentID: instrument.Id,\r\n RequireLot: lotResult.deliveryLot,\r\n RequireQuantity: lotResult.deliveryQuantity,\r\n Charge: this.recalcSpecificationCharge(),\r\n ChargeCurrencyId: (Boolean.parseBoolean(account.IsMultiCurrency) ? instrument.CurrencyId : account.CurrencyId),\r\n DeliveryTime: this.state.deliveryDate.format('YYYY-MM-DD'),\r\n SubmitorId: model.loginResult.UserId,\r\n SubmitTime: model.getServerTime().format(\"YYYY-MM-DD HH:mm:ss\"),\r\n Ask: instrument.lastQuotation.Ask,\r\n Bid: instrument.lastQuotation.Bid,\r\n Status: \"0\",\r\n DeliveryAddressId: this.state.selectedAddressId,\r\n DeliveryRequestOrderRelation: orderRelations,\r\n DeliveryRequestSpecifications: lotResult.specifications\r\n };\r\n\r\n\r\n this.props.commService.applyDelivery(data, (d) => {\r\n debugger;\r\n let data = JSON.parse(d);\r\n if (data.Result.content_result.transactionError === 'OK') {\r\n if (tradePolicyDetail.DeliveryMode == DeliveryMode.Summarized) {\r\n let specifactionDescription = this.getSubmitSpecifactionDescription(lotResult.specifications);\r\n antMessage.info(utils.format2(t('DialogWindow.RunLog_DeliverySummarizedSuccess'), instrument.Description, this.state.deliveryQuantity.toString(), instrument.Unit, utils.format2(t('DialogWindow.DeliverProduct'), specifactionDescription)));\r\n } else {\r\n antMessage.info(utils.format2(t('DialogWindow.RunLog_DeliverySuccess'), instrument.Description, this.state.deliveryQuantity.toString() + instrument.Unit, this.state.deliveryLot));\r\n }\r\n } else {\r\n if (tradePolicyDetail.DeliveryMode == DeliveryMode.Summarized) {\r\n let specifactionDescription = this.getSubmitSpecifactionDescription(lotResult.specifications);\r\n antMessage.info(utils.format2(t('DialogWindow.RunLog_DeliverySummarizedFailed'), instrument.Description, this.state.deliveryQuantity.toString(), instrument.Unit, utils.format2(t('DialogWindow.DeliverProduct'), specifactionDescription)), data.Result.content_result.transactionError);\r\n } else {\r\n let error = utils.format2(t('DialogWindow.RunLog_DeliveryFailed'), instrument.Description, this.state.deliveryQuantity.toString() + instrument.Unit, this.state.deliveryLot, data.Result.content_result.transactionError);\r\n utils.logError(error);\r\n }\r\n }\r\n if (isPad) {\r\n this.props.onCancel();\r\n } else {\r\n this.goBack();\r\n }\r\n });\r\n }\r\n\r\n getSubmitSpecifactionDescription(specifications) {\r\n let specifactionDescription = '';\r\n specifications.forEach((specification) => {\r\n if (!utils.isEmpty(specifactionDescription)) {\r\n specifactionDescription += ','\r\n }\r\n specifactionDescription += (specification.DeliveryRequestSpecification.productName + '*' + specification.DeliveryRequestSpecification.Quantity)\r\n });\r\n return specifactionDescription;\r\n }\r\n\r\n onDeliveryDateClick() {\r\n this.setState({ modalVisible: true });\r\n }\r\n\r\n onModalOk(e) {\r\n this.setState({ modalVisible: false, deliveryDate: this.state.modalDate });\r\n }\r\n\r\n onModalCancel(e) {\r\n this.setState({ modalVisible: false });\r\n }\r\n\r\n getDeliveryDisabledDate(current) {\r\n\r\n let result = current < this.state.deliveryBeginDate || current > this.state.deliveryEndDate || current.isoWeekday() > 5;\r\n return result;\r\n }\r\n\r\n render() {\r\n let moduleCss = this.getModuleCss('deliveryview', 'common');\r\n\r\n let { model, isPad } = this.props;\r\n // let instrument = model.placingData.selectedInstrument;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let account = model.selectedAccount;\r\n let currencyId = (utils.parseBoolean(account.IsMultiCurrency) ? instrument.CurrencyId : account.CurrencyID);\r\n let currency = (!model.currencies ? '' : model.currencies[currencyId]);\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n\r\n let specificationWeight = 0;\r\n let specificationQuantity = 0;\r\n // if (tradePolicyDetail.DeliveryMode == DeliveryMode.Summarized) {\r\n let specifications = this.state.specifications;\r\n for (let i = 0; i < specifications.length; i++) {\r\n let specification = specifications[i];\r\n if (specification.checked && specification.quantity > 0) {\r\n specificationQuantity += specification.quantity;\r\n specificationWeight += (specification.quantity * (parseFloat(specification.Size) + parseFloat(specification.Premium)));\r\n }\r\n }\r\n // }\r\n let specificationItems = [];\r\n let deliverySpecificationDetails = model.deliverySpecificationDetails[instrument.DeliverySpecificationId] ? Object.values(model.deliverySpecificationDetails[instrument.DeliverySpecificationId]) : undefined;\r\n let deliveryCharge = utils.isEmpty(tradePolicyDetail.DeliveryChargeId) ? {} : model.deliveryCharges[tradePolicyDetail.DeliveryChargeId];\r\n let chargeBasis = parseInt(deliveryCharge.ChargeBasis);\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : {});\r\n \r\n if (deliverySpecificationDetails) {\r\n deliverySpecificationDetails.sort(this.sortSpecification);\r\n specificationItems.push();\r\n if (deliverySpecificationDetails !== undefined) {\r\n deliverySpecificationDetails.forEach((deliverySpecification, index) => {\r\n let specification = deliverySpecification; // Object.assign({}, deliverySpecification);\r\n specificationItems.push();\r\n });\r\n }\r\n }\r\n\r\n return
\r\n {isPad ? '' : DialogWindow.Physical_Delivery} />}\r\n
\r\n
\r\n
DialogWindow.Physical_ProductName
\r\n
{instrument.Description}
\r\n
\r\n\r\n
\r\n
DialogWindow.Physical_DeliveryTime
\r\n
{this.state.deliveryDate.format('YYYY-MM-DD')}
\r\n
\r\n\r\n
\r\n
DialogWindow.Physical_DeliveryAddress
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
DialogWindow.Physical_DeliveryQuantity
\r\n
{this.state.avialabeQuantity} {instrument.Unit}
\r\n
\r\n\r\n
\r\n\r\n\r\n\r\n {tradePolicyDetail.DeliveryMode == DeliveryMode.Summarized ? '' :
{this.state.openOrderView}
}\r\n\r\n
\r\n {specificationItems}\r\n
\r\n
\r\n
DialogWindow.Physical_Summary
\r\n {!this.state.deliveryCharge ? '' :
{currency.Code} {this.state.deliveryCharge}
}\r\n {!this.state.deliveryQuantity ? '' :
{this.state.deliveryQuantity}{instrument.Unit}
}\r\n\r\n {!specificationQuantity ? '' :
{specificationQuantity}
}\r\n\r\n
\r\n \r\n\r\n document.body.style.overflow = \"auto\"}\r\n visible={this.state.modalVisible} onCancel={this.onModalCancel.bind(this)} onOk={this.onModalOk.bind(this)}>\r\n\r\n\r\n\r\n
\r\n this.setState({ modalDate: d })} disabledDate={this.getDeliveryDisabledDate.bind(this)} />\r\n
\r\n\r\n
\r\n
\r\n }\r\n\r\n\r\n}\r\n\r\n\r\nlet deliveryView = withRouter(DeliveryView);\r\nexport { deliveryView as DeliveryView };","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Button } from 'antd';\r\n\r\n\r\nimport * as utils from '../../common/utils';\r\nimport * as physicalHelper from '../../model/physicalHelper.js';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport { OrderType, PaymentForm, InstrumentStatus, AllowCloseInstalment, AdvancePaymentOption, PhysicalTradeSide } from '../../common/const';\r\nimport TitleBarView from '../titlebarview';\r\n\r\n\r\nclass InventoryDetailView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = { instalmentPolicy: {} };\r\n }\r\n\r\n componentDidMount() {\r\n console.log(\"InventoryDetailView\", \"componentDidMount\");\r\n let model = this.props.model;\r\n if (model !== undefined) {\r\n let selectOrder = model.placingData.selectedInventory;\r\n\r\n if (!selectOrder && model.placingData.selectedOrders !== undefined && model.placingData.selectedOrders.length > 0) {\r\n selectOrder = model.placingData.selectedOrders[0];\r\n }\r\n\r\n let instrument = model.instruments[selectOrder.Transaction.InstrumentID];\r\n let openPositions = Object.values(instrument.openPositions);\r\n openPositions.forEach((order, index) => {\r\n order.isSelected = false;\r\n });\r\n selectOrder.isSelected = true;\r\n\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let instalmentPolicy = model.instalmentPolicies[tradePolicyDetail.InstalmentPolicyId];\r\n this.setState({ instalmentPolicy: instalmentPolicy });\r\n }\r\n // this.state = { order: props.selectedOrder };\r\n }\r\n\r\n onDeliveryButtonClick(e) {\r\n if (e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n }\r\n\r\n let { model, isPad } = this.props;\r\n physicalHelper.gotoDelivery(model, model.selectedAccount, model.placingData.selectedInstrument, this.props.model.placingData.selectedInventory, () => this.goto('/delivery'));\r\n // let instrument = model.placingData.selectedInstrument;\r\n // let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n\r\n // this.props.commService.getDeliveryAddress(tradePolicyDetail.DeliveryPointGroupId, this.deliveryAddressCallback.bind(this));\r\n // this.goto('/delivery');\r\n }\r\n\r\n // deliveryAddressCallback(d) {\r\n // console.log('deliveryAddressCallback', d);\r\n // let data = JSON.parse(d);\r\n\r\n // if (data.Result.content_result.DeliveryAddresses) {\r\n // this.props.model.placingData.deliveryAddresses = utils.forceToArray(data.Result.content_result.DeliveryAddresses.DeliveryAddress);\r\n\r\n // this.goto('/delivery');\r\n // }\r\n // }\r\n\r\n onRepaymentButtonClick(e) {\r\n this.goto('/repayment');\r\n }\r\n\r\n onInstalmentButtonClick(e) {\r\n this.goto('/instalmentsum');\r\n }\r\n\r\n onPlacingButtonClick(orderType) {\r\n // this.props.model.placingData.selectedOrders[0];\r\n let { model } = this.props;\r\n let inventory = model.placingData.selectedInventory;\r\n let instrument = model.instruments[inventory.Transaction.InstrumentID];\r\n model.buildPlacingData(instrument, [inventory], orderType);\r\n inventory.isSelected = true;\r\n // model.placingData.orderType = orderType;\r\n // this.props.history.push('/closeorder');\r\n this.goto('/closeorder');\r\n }\r\n\r\n render() {\r\n let { model } = this.props;\r\n if (model === undefined || model.placingData === undefined || model.placingData.selectedOrders === undefined) {\r\n this.goto('/');\r\n return
;\r\n }\r\n\r\n let moduleCss = this.getModuleCss('inventoryview', 'common');\r\n let account = model.selectedAccount;\r\n // let currency = model.currencies[account.CurrencyID] \r\n\r\n let inventory = model.placingData.selectedInventory;\r\n let instrument = model.instruments[inventory.Transaction.InstrumentID];\r\n let currency = undefined;\r\n if (Boolean.parseBoolean(account.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n }\r\n else {\r\n currency = model.currencies[account.CurrencyId];\r\n }\r\n\r\n\r\n let paymentForm = PaymentForm.FullPayment;\r\n let canRepayment = true;\r\n let title = \"DialogWindow.Physical_FullPayment\";\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let canDelivery = ((tradePolicyDetail.AllowedPhysicalTradeSides & PhysicalTradeSide.Delivery) == PhysicalTradeSide.Delivery);\r\n if (canDelivery) canDelivery = physicalHelper.canDelivery(inventory);\r\n let buttonPane = ;\r\n\r\n if (parseInt(inventory.Period) >= 1) {\r\n title = (parseInt(inventory.Period) === 1 ? \"DialogWindow.Physical_AdvancePayment\" : \"DialogWindow.Physical_Instalment\");\r\n }\r\n\r\n if (Math.abs(parseFloat(inventory.PaidPledgeBalance)) !== parseFloat(inventory.PhysicalOriginValueBalance)) {\r\n paymentForm = (parseInt(inventory.Period) === 1 ? PaymentForm.AdvancePayment : PaymentForm.Instalment);\r\n }\r\n\r\n\r\n let canPlaceDqOrder = false;\r\n let canPlaceLimitOrder = false;\r\n let isMarket = false; // orderTypes.indexOf(OrderType.Market) >= 0;\r\n\r\n if (instrument.status == InstrumentStatus.DayOpen || instrument.status == InstrumentStatus.SessionOpen) {\r\n if (model.canPlaceOrder(model.selectedAccount, instrument, OrderType.SpotTrade) || model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Market)) {\r\n canPlaceDqOrder = true;\r\n }\r\n }\r\n\r\n model.getMaxCloseLot(instrument, inventory, OrderType.Limit);\r\n if (model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Limit)) {\r\n canPlaceLimitOrder = true;\r\n if (inventory.allowedCloseLot_LimitOrStop == 0) {\r\n canPlaceLimitOrder = false;\r\n }\r\n }\r\n if (paymentForm == PaymentForm.FullPayment) {\r\n canRepayment = false;\r\n\r\n // let orderTypes = instrument.getAvailableOrderTypes();\r\n // isMarket = orderTypes.indexOf(OrderType.Market) >= 0;\r\n\r\n } else {\r\n let allowClose = parseInt(this.state.instalmentPolicy.AllowClose);\r\n let advancePayment = parseInt(this.state.instalmentPolicy.AdvancePayment);\r\n\r\n if (paymentForm == PaymentForm.AdvancePayment) {\r\n if (canPlaceDqOrder) canPlaceDqOrder = (allowClose != AllowCloseInstalment.DisAllow);\r\n if (canPlaceLimitOrder) canPlaceLimitOrder = (allowClose != AllowCloseInstalment.DisAllow);\r\n canRepayment = (advancePayment == AdvancePaymentOption.AllowPrepayment || advancePayment == AdvancePaymentOption.AllowAll);\r\n } else if (paymentForm == PaymentForm.Instalment) {\r\n if (canPlaceDqOrder) canPlaceDqOrder = (allowClose == AllowCloseInstalment.AllowWhenNoOutstandingInstalment || allowClose == AllowCloseInstalment.AllowAll);\r\n if (canPlaceLimitOrder) canPlaceLimitOrder = (allowClose == AllowCloseInstalment.AllowWhenNoOutstandingInstalment || allowClose == AllowCloseInstalment.AllowAll);\r\n\r\n canRepayment = (advancePayment == AdvancePaymentOption.AllowInstalment || advancePayment == AdvancePaymentOption.AllowAll);\r\n }\r\n\r\n buttonPane = [,\r\n ]\r\n\r\n }\r\n\r\n\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : {});\r\n let weight = instrumentUnit ? parseFloat(instrumentUnit.Weight) : 1;\r\n return
\r\n {!this.props.isPad ? () : ('')}\r\n\r\n
DialogWindow.OrderCode{inventory.Code}
\r\n
DialogWindow.ExecuteTime{inventory.Transaction.ExecuteTime}
\r\n\r\n
DialogWindow.Physical_Weight{(parseFloat(inventory.LotBalance) * parseFloat(inventory.Transaction.ContractSize) * weight).toFixed(currency.Decimals)}
\r\n
DialogWindow.ExecutePrice{inventory.ExecutePrice}
\r\n\r\n
DialogWindow.RefPrice{ }
\r\n
DialogWindow.PhysicalItem_MarketValue{utils.formatNumber(inventory.PhysicalOriginValueBalance, currency.Decimals)}
\r\n\r\n
DialogWindow.TradePLFloat{inventory.TradePLFloat + inventory.InterestPLFloat + inventory.StoragePLFloat}
\r\n
DialogWindow.PhysicalItem_PedgeValue{utils.formatNumber(inventory.ValueAsMargin, currency.Decimals)}
\r\n\r\n
\r\n {buttonPane}\r\n {window.globalData.prevLocation.endsWith('/placeview') ? '' :\r\n [,\r\n ]}\r\n\r\n
\r\n\r\n {/* { this.bottomBarComponent = ref;}} /> */}\r\n\r\n\r\n
\r\n }\r\n\r\n}\r\n\r\nexport default withRouter(InventoryDetailView);\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { message as antMessage, Button } from 'antd';\r\n\r\nimport * as utils from '../../common/utils';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport { ContractTerminateType } from '../../common/const';\r\nimport TitleBarView from '../titlebarview';\r\n\r\n\r\nclass RepaymentView extends BaseView {\r\n\r\n componentDidMount() { }\r\n\r\n onSubmitButtonClick(e) {\r\n let { model, isPad } = this.props;\r\n let account = model.selectedAccount;\r\n let instrument = model.placingData.selectedInstrument;\r\n let inventory = model.placingData.selectedInventory;\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let instalmentPolicyDetail = model.getInstalmentPolicyDetail(tradePolicyDetail.InstalmentPolicyId, inventory.Period, inventory.Frequence);\r\n\r\n let currency = model.currencies[Boolean.parseBoolean(account.IsMultiCurrency) ? instrument.CurrencyId : account.CurrencyId];\r\n\r\n let paidPledgeBalance = (inventory.PaidPledgeBalance ? inventory.PaidPledgeBalance : 0);\r\n let paymentAmount = parseFloat(inventory.PhysicalOriginValueBalance) - Math.abs(paidPledgeBalance);\r\n let terminateFee = 0;\r\n let feeFactor = parseFloat(instalmentPolicyDetail.ContractTerminateFee)\r\n switch (parseInt(instalmentPolicyDetail.ContractTerminateType)) {\r\n case ContractTerminateType.RepaymentRatio:\r\n terminateFee = Math.round2(feeFactor * paymentAmount, currency.Decimals);\r\n break;\r\n case ContractTerminateType.FixedAmount:\r\n terminateFee = Math.round2(parseFloat(inventory.LotBalance) * feeFactor, currency.Decimals);\r\n break;\r\n case ContractTerminateType.LumpSum:\r\n terminateFee = Math.round2(feeFactor, currency.Decimals);\r\n break;\r\n default:\r\n }\r\n let terminateXml = utils.format('',\r\n inventory.ID, terminateFee, paymentAmount, terminateFee, currency.Id, paymentAmount);\r\n\r\n this.props.commService.instalmentPayoff(model.selectedAccount.Id, currency.Id, paymentAmount, terminateFee, terminateXml, this.instalmentPayoffCallback.bind(this));\r\n // this.goto('/delivery');\r\n }\r\n\r\n instalmentPayoffCallback(d) {\r\n console.log('instalmentPayoffCallback', d);\r\n debugger;\r\n let data = JSON.parse(d);\r\n if (data.Result.transactionError === \"OK\") {\r\n antMessage.info(DialogWindow.Physical_RepaymentSuccess);\r\n if (this.props.onClose) {\r\n this.props.onClose();\r\n }\r\n this.goto('/');\r\n } else {\r\n antMessage.info({\"DialogWindow.TransactionError_\" + data.Result.transactionError});\r\n }\r\n }\r\n\r\n render() {\r\n\r\n if (this.props.model === undefined || this.props.model.placingData === undefined || this.props.model.placingData.selectedInventory === undefined) {\r\n this.goto('/');\r\n return
;\r\n }\r\n\r\n let moduleCss = this.getModuleCss('inventoryview', 'common');\r\n\r\n let { model } = this.props;\r\n let instrumentCode = '';\r\n let inventory = this.props.model.placingData.selectedInventory;\r\n let account = !inventory ? '' : model.accounts[inventory.Transaction.AccountID];\r\n let instrument = !inventory ? '' : model.instruments[inventory.Transaction.InstrumentID];\r\n let currency = undefined;\r\n if (inventory) {\r\n if (Boolean.parseBoolean(account.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n }\r\n else {\r\n currency = model.currencies[account.CurrencyId];\r\n }\r\n }\r\n let unPaid = !inventory ? '' : utils.formatNumber(parseFloat(inventory.PhysicalOriginValueBalance) - Math.abs(parseFloat(inventory.PaidPledgeBalance)), currency.Decimals);\r\n return
\r\n {!this.props.isPad ? () : ('')}\r\n\r\n
DialogWindow.OrderCode{inventory.Code}
\r\n
DialogWindow.PhysicalBalanceOfCost_BalanceAmount{unPaid}
\r\n\r\n
DialogWindow.PhysicalBalanceOfCost_DeliveryCharge0
\r\n
DialogWindow.PhysicalBalanceOfCost_TotalPayable{ }
\r\n\r\n\r\n
\r\n \r\n
\r\n\r\n {/* { this.bottomBarComponent = ref;}} /> */}\r\n\r\n\r\n
\r\n }\r\n\r\n}\r\n\r\nexport default withRouter(RepaymentView);\r\n","import React from 'react';\r\n// import ReactDOM from 'react-dom';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Select } from 'antd';\r\nimport { Trans } from 'react-i18next';\r\n\r\nimport * as utils from '../../common/utils.js';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\n\r\n\r\nconst { Option } = Select;\r\nclass InstalmentPeriodView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.onSubComponentLoad) {\r\n this.props.onSubComponentLoad(\"instalmentPeriodView\", this);\r\n }\r\n console.log('InstalmentPeriodView.componentDidMount');\r\n }\r\n\r\n\r\n\r\n getRows() {\r\n let { model } = this.props;\r\n let inventory = model.placingData.selectedInventory;\r\n\r\n let account = model.accounts[inventory.Transaction.AccountID];\r\n let instrument = model.instruments[inventory.Transaction.InstrumentID];\r\n let currency = undefined;\r\n if (Boolean.parseBoolean(account.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n }\r\n else {\r\n currency = model.currencies[account.CurrencyId];\r\n }\r\n\r\n let result = [];\r\n result.push(this.getRow(DialogWindow.Physical_Period, DialogWindow.Physical_RepaymentDueDate, DialogWindow.Currency, DialogWindow.Physical_PrincipalInstalment, DialogWindow.Physical_InterestInstalment, DialogWindow.Physical_InstalmentAmount,\r\n DialogWindow.Physical_DateOfActualRepayment, DialogWindow.Physical_PenaltyInterest, DialogWindow.Physical_Status));\r\n utils.forceToArray(inventory.InstalmentDetails.InstalmentDetail).forEach((item, index) => {\r\n let status = utils.isEmpty(item.PaidDateTime) ? DialogWindow.Physical_UnPayment : DialogWindow.Physical_Payment;\r\n result.push(this.getRow(parseInt(item.Period), item.PaymentDateTimeOnPlan, currency.Name, utils.formatNumber(item.Principal, currency.Decimals), utils.formatNumber(item.Interest, currency.Decimals), parseFloat(item.Principal) + parseFloat(item.Interest), item.PaidDateTime, utils.formatNumber(item.DebitInterest, currency.Decimals), status));\r\n });\r\n return result;\r\n }\r\n\r\n getRow(period, dueDate, currency, principal, interest, amount, paidDate, penaltyInterest, status) {\r\n let moduleCss = this.getModuleCss('inventoryview', 'common');\r\n\r\n return
\r\n
{period}
\r\n
{typeof (dueDate) === \"string\" ? dueDate.substring(0, 10) : dueDate}
\r\n
{currency}
\r\n
{principal}
\r\n
{interest}
\r\n
{typeof (amount) !== \"object\" ? utils.formatNumber(amount, currency.Decimals) : amount}
\r\n
{typeof (paidDate) === \"string\" ? paidDate.substring(0, 10) : paidDate}
\r\n
{penaltyInterest}
\r\n
{status}
\r\n
\r\n }\r\n\r\n\r\n render() {\r\n console.log('InstalmentPeriodView.render');\r\n\r\n let { model, isPad } = this.props;\r\n let moduleCss = this.getModuleCss('inventoryview', 'common');\r\n\r\n return
\r\n {isPad ? '' : DialogWindow.Physical_Instalment} />}\r\n {this.getRows()}\r\n\r\n
\r\n
\r\n }\r\n\r\n}\r\nlet instalmentPeriodView = withRouter(InstalmentPeriodView);\r\nexport { instalmentPeriodView as InstalmentPeriodView };\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Button } from 'antd';\r\nimport moment from 'moment';\r\n\r\nimport * as utils from '../../common/utils';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport { PaymentForm, getEnumLangaugeKey } from '../../common/const';\r\nimport TitleBarView from '../titlebarview';\r\nimport { InstalmentPeriodView } from './instalmentperiodview';\r\n\r\n\r\nclass InstalmentSumView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n }\r\n\r\n componentDidMount() {\r\n console.log('InstalmentSumView.componentDidMount');\r\n let model = this.props.model;\r\n if (model !== undefined && model.placingData.selectedOrders !== undefined && model.placingData.selectedOrders.length > 0) {\r\n let instruments = model.instruments;\r\n let selectOrder = model.placingData.selectedOrders[0];\r\n let instrument = instruments[selectOrder.Transaction.InstrumentID];\r\n let openPositions = Object.values(instrument.openPositions);\r\n openPositions.forEach((order, index) => {\r\n order.isSelected = false;\r\n });\r\n selectOrder.isSelected = true;\r\n }\r\n\r\n // this.state = { order: props.selectedOrder };\r\n }\r\n\r\n onNextButtonClick(e) {\r\n\r\n //this.props.commService.getOrderInstalment(this.props.model.placingData.selectedInventory.ID, this.getOrderInstalmentCallback.bind(this));\r\n // this.goto('/delivery');\r\n this.goto('/instalmentperiod');\r\n }\r\n\r\n\r\n render() {\r\n\r\n if (this.props.model === undefined || this.props.model.placingData === undefined || this.props.model.placingData.selectedInventory === undefined) {\r\n this.goto('/');\r\n return
;\r\n }\r\n\r\n let moduleCss = this.getModuleCss('inventoryview', 'common');\r\n\r\n let { model, isPad, commService } = this.props;\r\n let instrumentCode = '';\r\n let inventory = model.placingData.selectedInventory;\r\n let details = utils.forceToArray(inventory.InstalmentDetails.InstalmentDetail);\r\n let period = 0, paidPeriod = 0, paidPrincipal = 0, unpaidPrincipal = 0, paidInterest = 0, unpaidInterest = 0, debitInterest = 0;\r\n let overDueNotPaid = 0, overDuePaid = 0;\r\n\r\n let account = model.accounts[inventory.Transaction.AccountID];\r\n let instrument = model.instruments[inventory.Transaction.InstrumentID];\r\n let isMultiCurrency = Boolean.parseBoolean(account.IsMultiCurrency);\r\n let currency = model.currencies[isMultiCurrency ? instrument.CurrencyId : account.CurrencyId];\r\n\r\n details.forEach((d) => {\r\n debitInterest += parseFloat(d.DebitInterest);\r\n period++;\r\n if (utils.isEmpty(d.PaidDateTime)) {\r\n if (moment(d.PaymentDateTimeOnPlan) < model.getServerTime()) {\r\n overDueNotPaid++;\r\n }\r\n unpaidPrincipal += parseFloat(d.Principal);\r\n unpaidInterest += parseFloat(d.Interest);\r\n } else { // d.PaidDateTime is not empty\r\n paidPeriod++;\r\n paidPrincipal += parseFloat(d.Principal);\r\n paidInterest += parseFloat(d.Interest);\r\n if (moment(d.PaymentDateTimeOnPlan) < moment(d.PaidDateTime)) {\r\n overDuePaid++;\r\n }\r\n }\r\n\r\n\r\n\r\n });\r\n\r\n let detailPane = '';\r\n if (isPad) {\r\n detailPane =
;\r\n }\r\n return
\r\n
\r\n {!isPad ? () : ('')}\r\n\r\n
DialogWindow.Physical_Frequency{{getEnumLangaugeKey(\"InstalmentFrequence\", parseInt(inventory.Frequence))}}
\r\n
DialogWindow.Physical_NoOfInstalment{inventory.Period - 1}
\r\n\r\n
DialogWindow.Physical_PaidInstalment{paidPeriod}
\r\n
DialogWindow.Physical_UnpaidInstalment{parseInt(period) - paidPeriod}
\r\n\r\n
DialogWindow.Physical_NoOfLateInstalment{utils.formatNumber(overDueNotPaid, currency.Decimals)}
\r\n
DialogWindow.Physical_NoOfPaidLateInstalment{utils.formatNumber(overDuePaid, currency.Decimals)}
\r\n\r\n
DialogWindow.Physical_PaidPrincipal{utils.formatNumber(paidPrincipal, currency.Decimals)}
\r\n
DialogWindow.Physical_UnpaidPrincipalBalance{utils.formatNumber(unpaidPrincipal, currency.Decimals)}
\r\n\r\n
DialogWindow.Physical_PaidInterest{utils.formatNumber(paidInterest, currency.Decimals)}
\r\n
DialogWindow.Physical_UnpaidInterest{utils.formatNumber(unpaidInterest, currency.Decimals)}
\r\n
DialogWindow.Physical_PenaltyInterest{utils.formatNumber(debitInterest, currency.Decimals)}
\r\n\r\n {isPad ? '' :
\r\n \r\n
}\r\n
\r\n {detailPane}\r\n {/* { this.bottomBarComponent = ref;}} /> */}\r\n\r\n\r\n
\r\n }\r\n\r\n}\r\n\r\nlet instalmentSumView = withRouter(InstalmentSumView);\r\nexport { instalmentSumView as InstalmentSumView };\r\n","import React from 'react';\r\nimport PubSub from 'pubsub-js'\r\nimport dataSource, { IChartDataSource } from './data/dataSource';\r\nimport ChartFrame from './ChartFrame';\r\nimport { DataRangeType, IChartConfig, IInstrumentInfo, IQuotation } from './typeDefine';\r\nimport { SplitPane, SplitPaneHooks } from 'react-collapse-pane';\r\n// import { Console } from 'console';\r\nimport { getChartConfigs } from './chartHelper';\r\n\r\ninterface IMultiChartViewProps{\r\n // readonly isPad: boolean;\r\n readonly model: any;\r\n // readonly onSubComponentLoad: (name: string, comp: any) => void;\r\n readonly commService: any;\r\n readonly instrumentInfo: IInstrumentInfo;\r\n readonly priceDecimals: number;\r\n readonly theme: string;\r\n readonly issplitterdragging: boolean;\r\n}\r\n\r\ninterface IMultiChartViewState{\r\n readonly chartcount: number;\r\n readonly issplitterdragging: boolean;\r\n}\r\n\r\nexport class MultiChartView extends React.PureComponent {\r\n\r\n private subTopic: string | undefined = void 0;\r\n private chartDataSources: IChartDataSource[] = [];\r\n // private charts: any[] = [];\r\n private lastQuotation: any | undefined = void 0;\r\n\r\n constructor(props: IMultiChartViewProps) {\r\n super(props);\r\n\r\n this.state = { chartcount: 1, issplitterdragging: props.issplitterdragging };\r\n\r\n this.unsubscribeQuotation = this.unsubscribeQuotation.bind(this);\r\n }\r\n\r\n // public componentDidMount() {\r\n // }\r\n\r\n private getInstrumentId(): string | undefined {\r\n return this.chartDataSources.length > 0 ? this.chartDataSources[0].instrumentId() : void 0;\r\n }\r\n\r\n private getChartConfig(chartIndex: number) : IChartConfig {\r\n\r\n const configs = getChartConfigs(this.getInstrumentId() as string) as IChartConfig[];\r\n\r\n // const instrumnetId = this.getInstrumentId() as string;\r\n // console.log(`configDebug: chartIndex=${chartIndex} -----------------------------------------`);\r\n // configs.forEach((config, index) => {\r\n // const cfg = config.indictorsSettings;\r\n // console.log(`configDebug: configId=${cfg.configId},\r\n // instrumentId=${instrumnetId},\r\n // index=${index},\r\n // auxIndicator=${cfg.auxIndicatorSettings?.indicatorName},\r\n // mainIndictorsSettings.size=${cfg.mainIndictorsSettings.size()}`);\r\n // });\r\n // console.log(`configDebug: chartIndex=${chartIndex} ==========================================`);\r\n // console.log(`configDebug: private getChartConfig chartType=${configs[chartIndex].chartType}`);\r\n \r\n // return configs[chartIndex].indictorsSettings;\r\n return configs[chartIndex];\r\n }\r\n\r\n private setChartCount = (count: number) => {\r\n this.setState({ chartcount: count });\r\n }\r\n\r\n private createChartDataSource() {\r\n const { commService, model } = this.props;\r\n const { id:instrumentId, code, description, quotePolicyId } = this.props.instrumentInfo;\r\n\r\n const oldInstrumentId = this.getInstrumentId();\r\n if (oldInstrumentId != instrumentId) {\r\n // create new configs for new instrument\r\n // this.createDefaultChartConfigs(instrumentId);\r\n // clear old dataSources\r\n this.chartDataSources = [];\r\n }\r\n\r\n const configs = getChartConfigs(instrumentId) as IChartConfig[];\r\n for (let index = this.chartDataSources.length; index < this.state.chartcount; index++) {\r\n const chartType = configs[index].chartType;\r\n console.log(`configDebug: index=${index} chartType=${chartType}`);\r\n const chartDataSource = dataSource()\r\n .instrumentId(instrumentId)\r\n .instrumentCode(code)\r\n .instrumentDescription(description)\r\n .quotePolicyId(quotePolicyId)\r\n .chartType(chartType)\r\n .dataRange(DataRangeType.Unlimited)\r\n .commService(commService)\r\n .model(model);\r\n this.chartDataSources.push(chartDataSource);\r\n }\r\n\r\n const newTopic = `q.${instrumentId}`;\r\n if (this.subTopic !== newTopic) {\r\n this.unsubscribeQuotation();\r\n this.subTopic = newTopic\r\n PubSub.subscribe(this.subTopic, this.notifyRealTimeQuotation.bind(this));\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n this.unsubscribeQuotation();\r\n }\r\n\r\n unsubscribeQuotation() {\r\n if (this.subTopic) {\r\n PubSub.unsubscribe(this.subTopic);\r\n }\r\n }\r\n\r\n notifyRealTimeQuotation(msg: string, quotation: IQuotation) {\r\n // console.log(timeFormaterWithMs(new Date()), \"real time quotation received.\");\r\n if (quotation.Bid && quotation.Ask) {\r\n const shouldNofityChart = !this.lastQuotation || (this.lastQuotation.Ask != quotation.Ask || this.lastQuotation.Bid != quotation.Bid);\r\n if (shouldNofityChart) {\r\n this.chartDataSources.forEach((ds) => {\r\n ds.OnRealPrice(+quotation.Bid, +quotation.Ask, quotation.Timestamp);\r\n });\r\n }\r\n this.lastQuotation = { Timestamp: quotation.Timestamp, Bid: quotation.Bid, Ask: quotation.Ask };\r\n }\r\n }\r\n\r\n private splitHooks: SplitPaneHooks = {\r\n onDragStarted: () => {\r\n // console.log(\"splitHooks onDragStarted\");\r\n this.setState({ issplitterdragging: true });\r\n },\r\n // onChange: (sizes: number[]) => {\r\n // console.log(\"splitHooks onChange\", sizes);\r\n // },\r\n onSaveSizes: (sizes: number[]) => {\r\n // console.log(\"splitHooks onSaveSizes\", sizes);\r\n this.setState({ issplitterdragging: false });\r\n }\r\n }\r\n\r\n render() {\r\n this.createChartDataSource();\r\n const { chartcount } = this.state;\r\n const { theme } = this.props;\r\n const issplitterdragging = this.state.issplitterdragging || this.props.issplitterdragging;\r\n if (chartcount === 1) {\r\n return { }}\r\n onChartExitFullScreen={() => { }}\r\n isPad={true}\r\n theme={theme}\r\n showMultiChartMemu={true}\r\n chartIndex={[0, chartcount]}\r\n setChartCount={this.setChartCount}\r\n issplitterdragging={issplitterdragging}\r\n />;\r\n } else if (chartcount === 2) {\r\n return \r\n { }}\r\n onChartExitFullScreen={() => { }}\r\n isPad={true}\r\n theme={theme}\r\n showMultiChartMemu={true}\r\n chartIndex={[0, chartcount]}\r\n setChartCount={this.setChartCount}\r\n issplitterdragging={issplitterdragging}\r\n />\r\n { }}\r\n onChartExitFullScreen={() => { }}\r\n isPad={true}\r\n theme={theme}\r\n showMultiChartMemu={true}\r\n chartIndex={[1, chartcount]}\r\n setChartCount={this.setChartCount}\r\n issplitterdragging={issplitterdragging}\r\n />\r\n ;\r\n } else {\r\n return \r\n { }}\r\n onChartExitFullScreen={() => { }}\r\n isPad={true}\r\n theme={theme}\r\n showMultiChartMemu={true}\r\n chartIndex={[0, chartcount]}\r\n setChartCount={this.setChartCount}\r\n issplitterdragging={issplitterdragging}\r\n />\r\n \r\n { }}\r\n onChartExitFullScreen={() => { }}\r\n isPad={true}\r\n theme={theme}\r\n showMultiChartMemu={true}\r\n chartIndex={[1, chartcount]}\r\n setChartCount={this.setChartCount}\r\n issplitterdragging={issplitterdragging}\r\n />\r\n { }}\r\n onChartExitFullScreen={() => { }}\r\n isPad={true}\r\n theme={theme}\r\n showMultiChartMemu={true}\r\n chartIndex={[2, chartcount]}\r\n setChartCount={this.setChartCount}\r\n issplitterdragging={issplitterdragging}\r\n />\r\n \r\n ;\r\n }\r\n }\r\n}\r\n\r\n","import React from 'react';\r\nimport BaseView from \"../baseview.js\";\r\nimport { OrderType } from '../../common/const';\r\nimport { IInstrumentInfo } from '../../chart/typeDefine';\r\nimport { MultiChartView } from '../../chart/multichartview';\r\n\r\nconst PlacePanelType = { None: 0, WorkingList: 1, PendingList: 2, SpotTrade: 3, PendingOrder: 4 };\r\n\r\ninterface IMultiChartViewProps{\r\n readonly isPad: boolean;\r\n readonly model: any;\r\n readonly onSubComponentLoad: (name: string, comp: any) => void;\r\n readonly commService: any;\r\n readonly issplitterdragging: boolean;\r\n}\r\n\r\nexport class PadChartView extends BaseView {\r\n\r\n constructor(props: IMultiChartViewProps) {\r\n super(props);\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.onSubComponentLoad) {\r\n this.props.onSubComponentLoad(\"padPlaceView\", this);\r\n }\r\n }\r\n\r\n // resetInput(props, isConstructor) {\r\n public resetInput() {\r\n let instrument = this.props.model.placingData.selectedInstrument;\r\n let orderType = this.props.model.placingData.orderType;\r\n let placingType = (orderType === OrderType.Limit ? PlacePanelType.PendingOrder : PlacePanelType.None);\r\n\r\n if (instrument.openPositions) {\r\n let openPositions = Object.values(instrument.openPositions) as any[];\r\n openPositions.forEach((order, index) => { \r\n order.selectedLot = order.allowedCloseLot = this.props.model.getMaxCloseLot(instrument, order); //parseFloat(order.LotBalance);\r\n order.isSelected = false;\r\n });\r\n } else {\r\n placingType = PlacePanelType.None;\r\n }\r\n }\r\n\r\n render() {\r\n const { model, commService, issplitterdragging } = this.props;\r\n if (this.props.isPad && model && model.isTradingDataLoaded && model.placingData && model.placingData.selectedInstrument) {\r\n // if (!model.placingData) {\r\n // const instrument = model.orderedInstruments[0];\r\n // model.buildPlacingData(instrument);\r\n // }\r\n } else {\r\n return <>;\r\n }\r\n\r\n const { Id, Code, Description } = model.placingData.selectedInstrument;\r\n const quotePolicyId = model.placingData.selectedInstrument.lastQuotation.QuotePolicyId;\r\n const iinfo: IInstrumentInfo = {\r\n id: Id,\r\n code: Code,\r\n description: Description,\r\n quotePolicyId\r\n };\r\n\r\n return \r\n }\r\n}\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\n\r\nimport { Checkbox } from 'antd';\r\nimport InputNumberComponent from '../inputnumbercomponent';\r\n\r\nimport { getLotSettings } from '../../model/placinglotsetting';\r\nimport { OrderType, BuySell, InstrumentCategory, PhysicalTradeSide } from '../../common/const';\r\n\r\nimport * as utils from '../../common/utils.js';\r\n\r\nimport BaseView from \"../baseview.js\";\r\n\r\nexport default class CloseOrderItemView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n this.state = { order: props.order, defaultCss };\r\n }\r\n\r\n componentDidMount() {\r\n // console.log('CloseOrderItemView.componentDidMount');\r\n }\r\n\r\n\r\n onCheckboxChange(event) {\r\n this.state.order.isSelected = event.target.checked;\r\n\r\n // this.setState({ order: this.props.order });\r\n if (this.props.onOrderSelectChanged) {\r\n this.props.onOrderSelectChanged(this.props.order);\r\n }\r\n if (!event.target.checked) {\r\n this.props.order.selectedLot = this.props.order.allowedCloseLot;\r\n }\r\n this.forceUpdate();\r\n }\r\n\r\n onSelectionLotChange(value, order) {\r\n console.log('CloseOrderItemView.onSelectionLotChange');\r\n order.selectedLot = parseFloat(value);\r\n let lotBalance = parseFloat(order.LotBalance) - order.deliveryLotInProcess;\r\n if (value <= lotBalance && value >= 0 && order.isSelected) {\r\n if (this.props.onOrderSelectChanged) {\r\n this.props.onOrderSelectChanged(order);\r\n }\r\n\r\n } else {\r\n\r\n }\r\n this.forceUpdate();\r\n }\r\n\r\n render() {\r\n let moduleCss = this.getModuleCss('closeorderview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n let { model, isPad } = this.props;\r\n let itemStyle = isPad ? { height: '100%' } : {};\r\n\r\n let titleStyle = { height: '2em' };\r\n if (model && model.config) {\r\n titleStyle.backgroundColor = model.config.getValue('titleBackgroundColor');\r\n titleStyle.color = model.config.getValue('titleColor');\r\n }\r\n\r\n if (this.props.isTitle) {\r\n return
\r\n
\r\n\r\n MainView.Select\r\n MainView.BuySell\r\n\r\n MainView.TradePrice\r\n MainView.TradeDay\r\n MainView.TradePLFloat\r\n
\r\n {isPad ? DialogWindow.CloseLot : null}\r\n
\r\n } else {\r\n\r\n let instrument = model.placingData.selectedInstrument;\r\n let isMultiCurrency = Boolean.parseBoolean(model.selectedAccount.IsMultiCurrency);\r\n let currencyId = (isMultiCurrency ? instrument.CurrencyId : model.selectedAccount.CurrencyID);\r\n let currency = model.currencies[currencyId];\r\n\r\n let order = this.state.order;\r\n let lotSettings = getLotSettings(model.selectedAccount, instrument, model.placingData.OrderType !== OrderType.Limit, false);\r\n\r\n if (lotSettings.min > parseFloat(order.allowedCloseLot)) {\r\n lotSettings.min = parseFloat(order.allowedCloseLot);\r\n }\r\n lotSettings.max = parseFloat(order.allowedCloseLot);\r\n let inputCompnent = \r\n \r\n ;\r\n\r\n let buySellButtonClass = Boolean.parseBoolean(order.IsBuy) ? `${moduleCss.orderSelectionBuySell} ${moduleCss.orderSelectionPaneItemCommon}` : `${moduleCss.orderSelectionBuySell} ${moduleCss.orderSelectionPaneItemCommon} ${this.state.defaultCss.negativeNumber}`;\r\n let lotBalance = parseFloat(order.LotBalance) - order.deliveryLotInProcess;\r\n let tradePLFloat = (parseFloat(order.TradePLFloat) / lotBalance) * order.selectedLot;\r\n let tradePLFloatClass = `${moduleCss.orderSelectionTradePLFloat} ${moduleCss.orderSelectionPaneItemCommon} ${tradePLFloat < 0 ? this.state.defaultCss.negativeNumber : ''}`;\r\n\r\n let paymentTitle = undefined;\r\n if (instrument.Category == InstrumentCategory.Physical && order.PhysicalTradeSide == PhysicalTradeSide.Buy) {\r\n if (utils.isEmpty(order.Period) || parseInt(order.Period) < 1) {\r\n paymentTitle = (DialogWindow.Physical_FullPayment);\r\n }\r\n else if (parseInt(order.Period) >= 1) {\r\n paymentTitle = parseInt(order.Period) === 1 ? (DialogWindow.Physical_AdvancePayment) : (DialogWindow.Physical_Instalment);\r\n }\r\n }\r\n\r\n return
\r\n \r\n {Boolean.parseBoolean(order.IsBuy) ? \"MainView.Buy\" : \"MainView.Sell\"}\r\n {order.ExecutePrice}{paymentTitle}\r\n {order.Transaction.ExecuteTime.substring(0, 10)}\r\n {isNaN(tradePLFloat) || tradePLFloat == 0 ? 'NA' : utils.formatNumber(tradePLFloat, currency.Decimals)}\r\n {isPad ? null : inputCompnent}\r\n
\r\n {isPad ? inputCompnent : null}\r\n\r\n
\r\n }\r\n }\r\n\r\n}\r\n\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { message as antMessage, Button, Select, Checkbox } from 'antd';\r\n\r\nimport * as utils from '../../common/utils.js';\r\nimport { TransactionType, OrderType, LimitOrStop, BuySell, PriceTrend, BSStatus } from '../../common/const';\r\nimport { getPendingPriceSetting } from '../../model/placingpricesetting';\r\nimport { getLotSettings, getMovePipsSettings } from '../../model/placinglotsetting';\r\nimport { isAcceptedNewLimitPosition, isAcceptedNewStopPosition } from '../../model/orderHelper';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport ExpireSelectView from '../placing/expireselectview';\r\nimport CloseOrderItemView from './closeorderitemview';\r\nimport PlaceConfirmView from '../placing/placeconfirmview';\r\nimport InputNumberComponent from '../inputnumbercomponent';\r\nimport TitleBarView from '../titlebarview';\r\n\r\n// const BottomBarComponent = withTranslation()(BottomBar);\r\n\r\nconst SavePipsCookey = 'SpotTradePips';\r\n\r\nclass CloseOrderView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n let { model, isPad } = props;\r\n let instrument = (model.placingData ? model.placingData.selectedInstrument : {});\r\n let savedPips = parseFloat(utils.loadCookie(model.customer.Id + instrument.Id + SavePipsCookey));\r\n if (savedPips) {\r\n model.placingData.pips = savedPips;\r\n }\r\n\r\n \r\n let expireTypes = model.getExpireTypes(instrument);\r\n this.state = {\r\n confirmDialogVisible: false,\r\n selectedBuyLot: 0,\r\n selectedSellLot: 0,\r\n pips: savedPips ? savedPips : 0,\r\n expireTypes: expireTypes,\r\n expireType: expireTypes && expireTypes.length > 0 ? expireTypes[0] : 0\r\n };\r\n\r\n }\r\n\r\n componentDidMount() {\r\n // console.log('CloseOrderView.componentDidMount');\r\n let { model } = this.props;\r\n\r\n if (model !== undefined) {\r\n if (model.placingData) {\r\n delete model.placingData.useLimitPrice;\r\n delete model.placingData.useStopPrice;\r\n }\r\n this.refreshOpenOrderLot(this.props);\r\n }\r\n\r\n if (model.placingData && model.placingData.quoteCallback) {\r\n delete model.placingData.quoteCallback;\r\n delete model.placingData.quoteAnswer;\r\n delete model.placingData.isQuoteTimeout;\r\n window.clearTimeout(model.placingData.quoteTimeoutId);\r\n }\r\n\r\n if (this.props.onSubComponentLoad) {\r\n this.props.onSubComponentLoad(\"closeOrderView\", this);\r\n }\r\n }\r\n\r\n\r\n onOrderSelectChanged(orderChanged) {\r\n console.log('onOrderSelectChanged');\r\n if (orderChanged.isSelected) {\r\n this.unSelectSimultaneousBuySellClose(!utils.parseBoolean(orderChanged.IsBuy));\r\n }\r\n this.refreshOpenOrderLot(this.props);\r\n }\r\n\r\n refreshOpenOrderLot(props, isReset) {\r\n let { model } = props ? props : this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n model.closeLot = 0;\r\n model.refreshAllowedCloseLot(instrument);\r\n if (instrument.openPositions) {\r\n let totalBuyPrice = 0;\r\n let totalSellPrice = 0;\r\n\r\n let buyLot = 0;\r\n let sellLot = 0;\r\n let buyLotCanSelect = 0;\r\n let sellLotCanSelect = 0;\r\n let openPositions = Object.values(instrument.openPositions);\r\n\r\n openPositions.forEach((order, index) => {\r\n let isBuy = Boolean.parseBoolean(order.IsBuy);\r\n if (isReset) {\r\n order.isSelected = false;\r\n } else {\r\n if (model.placingData.orderType === OrderType.SpotTrade || model.placingData.orderType === OrderType.Market || isBuy == !model.placingData.isBuy) {\r\n if (isBuy) {\r\n\r\n buyLotCanSelect += parseFloat(order.selectedLot);\r\n if (order.isSelected) {\r\n buyLot += parseFloat(order.selectedLot);\r\n totalBuyPrice += (parseFloat(order.ExecutePrice) * parseFloat(order.selectedLot));\r\n }\r\n } else {\r\n sellLotCanSelect += parseFloat(order.selectedLot);\r\n if (order.isSelected) {\r\n sellLot += parseFloat(order.selectedLot);\r\n totalSellPrice += (parseFloat(order.ExecutePrice) * parseFloat(order.selectedLot));\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (!order.isSelected) {\r\n order.selectedLot = order.allowedCloseLot;\r\n }\r\n });\r\n buyLot = Math.round2(buyLot, 4);\r\n sellLot = Math.round2(sellLot, 4);\r\n this.setState({\r\n selectedBuyLot: buyLot,\r\n selectedSellLot: sellLot,\r\n buyLotCanSelect: Math.round2(buyLotCanSelect, 4),\r\n sellLotCanSelect: Math.round2(sellLotCanSelect, 4),\r\n averageBuyPrice: buyLot > 0 ? totalBuyPrice / buyLot : 0,\r\n averageSellPrice: sellLot > 0 ? totalSellPrice / sellLot : 0\r\n });\r\n\r\n if (model.placingData.orderType === OrderType.SpotTrade || model.placingData.orderType === OrderType.Market) {\r\n model.placingData.closeBuyLot = buyLot;\r\n model.placingData.closeSellLot = sellLot;\r\n model.closeLot = sellLot + buyLot;\r\n\r\n\r\n if (buyLot > 0 && (this.state.lastBuyLot != buyLot || sellLot == 0)) {\r\n let orderingNotifyId = this.state.buyOrderingNotifyId;\r\n if (orderingNotifyId === undefined) {\r\n orderingNotifyId = utils.uuid();\r\n this.setState({ buyOrderingNotifyId: orderingNotifyId });\r\n }\r\n\r\n model.orderingNotify(orderingNotifyId, model.customer.Code, model.placingData.selectedInstrument.Code, 'false', 'false', buyLot.toString(), (d) => { });\r\n }\r\n if (sellLot > 0 && (this.state.lastSellLot != sellLot || buyLot == 0)) {\r\n let orderingNotifyId = this.state.sellOrderingNotifyId;\r\n if (orderingNotifyId === undefined) {\r\n orderingNotifyId = utils.uuid();\r\n this.setState({ sellOrderingNotifyId: orderingNotifyId });\r\n }\r\n\r\n model.orderingNotify(orderingNotifyId, model.customer.Code, model.placingData.selectedInstrument.Code, 'true', 'false', sellLot.toString(), (d) => { });\r\n\r\n }\r\n this.setState({ lastSellLot: sellLot, lastBuyLot: buyLot });\r\n } else {\r\n model.closeLot = (model.placingData.isBuy ? sellLot : buyLot);\r\n }\r\n if (this.props.onOrderSelectChanged) {\r\n //this.props.onOrderSelectChanged(buyLot > sellLot ? buyLot : sellLot);\r\n this.props.onOrderSelectChanged(model.closeLot);\r\n }\r\n\r\n\r\n }\r\n }\r\n\r\n onSelectAllCheckboxChange(checked, buySell) {\r\n console.log('CloseOrderView.onSelectAllCheckboxChange');\r\n let { model } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n if (checked) {\r\n this.unSelectSimultaneousBuySellClose(buySell == BuySell.Sell);\r\n }\r\n this.setState({ orderingNotifyId: undefined });\r\n if (instrument.openPositions) {\r\n let openPositions = Object.values(instrument.openPositions);\r\n openPositions.forEach((order, index) => {\r\n if (this.canSelectOrder(order) && (Boolean.parseBoolean(order.IsBuy) === (buySell === BuySell.Buy))) {\r\n order.isSelected = checked;\r\n }\r\n });\r\n\r\n this.refreshOpenOrderLot(this.props);\r\n this.forceUpdate();\r\n }\r\n }\r\n\r\n unSelectSimultaneousBuySellClose(isBuy) {\r\n let { model } = this.props;\r\n if (model.placingData.orderType !== OrderType.Limit) {\r\n let instrument = model.placingData.selectedInstrument;\r\n let dealingPolicy = instrument.dealingPolicyDetail;\r\n let isSimultaneousBuySellClose = utils.parseBoolean(utils.isEmpty(dealingPolicy) ? instrument.IsSimultaneousBuySellClose : dealingPolicy.IsSimultaneousBuySellClose);\r\n\r\n if (!isSimultaneousBuySellClose && instrument.openPositions) {\r\n let openPositions = Object.values(instrument.openPositions);\r\n openPositions.forEach((order, index) => {\r\n if (this.canSelectOrder(order) && (Boolean.parseBoolean(order.IsBuy) === isBuy)) {\r\n order.isSelected = false;\r\n }\r\n });\r\n }\r\n }\r\n }\r\n\r\n onConfirmCancel(e, urlGoBack) {\r\n let { model } = this.props;\r\n // model.closeLot = 0;\r\n this.refreshOpenOrderLot(this.props);\r\n if (!this.props.isPad && urlGoBack) {\r\n this.goBack();\r\n }\r\n this.setState({ confirmDialogVisible: false });\r\n }\r\n\r\n onConfirmOk(e) {\r\n // this.setState({confirmDialogVisible : false});\r\n this.refreshOpenOrderLot(this.props);\r\n this.setState({ isConfirmOkClicked: true });\r\n\r\n this.placeTransaction();\r\n\r\n if (this.props.onConfirmClosed) {\r\n this.props.onConfirmClosed(true);\r\n }\r\n }\r\n\r\n placeTransaction() {\r\n let { model, commService } = this.props;\r\n //let tran = { OrderType: 2, OpenOrderID: \"a89feb41-fd7b-446d-bb6d-9084f8ea82a0\", Order : [{TradeOption : \"0\", DQMaxMove: 1}, {TradeOption : \"2\", DQMaxMove: 3, OrderRelation : [] } ] };\r\n\r\n this.props.model.placingData.transactions.forEach((tran, index) => {\r\n let xmlDoc = utils.convertToXml(tran, 'Transaction');\r\n commService.place(tran);\r\n });\r\n\r\n let instrument = model.placingData.selectedInstrument;\r\n model.closeLot = 0;\r\n if (instrument.openPositions) {\r\n let openPositions = Object.values(instrument.openPositions);\r\n openPositions.forEach((order, index) => {\r\n order.selectedLot = order.allowedCloseLot = model.getMaxCloseLot(instrument, order);\r\n });\r\n }\r\n this.refreshOpenOrderLot(this.props, true);\r\n }\r\n\r\n adjustLotByQuote() {\r\n\r\n }\r\n\r\n startSpotTradedPromptUIKeepSeconds(orderType) {\r\n let model = this.props.model;\r\n if (orderType === OrderType.SpotTrade) {\r\n let spotTradedPromptUIKeepSeconds = parseInt(model.settingData.SystemParameter.SpotTradedPromptUIKeepSeconds);\r\n if (spotTradedPromptUIKeepSeconds > 0) {\r\n setTimeout(() => this.setState({ confirmDialogVisible: false }), spotTradedPromptUIKeepSeconds * 1000);\r\n }\r\n }\r\n }\r\n\r\n onSubmitClick(limitPrice, stopPrice) {\r\n let { model, t } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n\r\n this.setState({ orderingNotifyId: undefined });\r\n\r\n let lotSettings = getLotSettings(model.selectedAccount, instrument, model.placingData.orderType !== OrderType.Limit, false);\r\n if (model.closeLot > lotSettings.max || model.closeLot < lotSettings.min) {\r\n model.showModalDialog(utils.format2(t('DialogWindow.PlacingOrder_SumLotGreaterThanMaxLotOrLessThanMinLot'), model.closeLot, lotSettings.max, lotSettings.min));\r\n return;\r\n }\r\n\r\n if (model.placingData.orderType != OrderType.Limit && instrument.needQuote(model.closeLot)) {\r\n if (model.placingData && model.placingData.quoteCallback) {\r\n delete model.placingData.quoteCallback;\r\n delete model.placingData.quoteAnswer;\r\n delete model.placingData.isQuoteTimeout;\r\n window.clearTimeout(model.placingData.quoteTimeoutId);\r\n }\r\n\r\n model.placingData.quoteCallback = (answer) => {\r\n console.log('answer callback', answer);\r\n if (answer.InstrumentId == instrument.Id && answer.QuoteLot == model.closeLot) {\r\n delete model.placingData.quoteCallback;\r\n debugger;\r\n if (answer.QuoteLot != answer.AnswerLot) {\r\n this.adjustLotTo(parseFloat(answer.AnswerLot));\r\n }\r\n this.submit();\r\n }\r\n };\r\n this.setState({ transactions: undefined, confirmDialogVisible: true });\r\n this.startSpotTradedPromptUIKeepSeconds(model.placingData.orderType);\r\n model.placingData.quoteTimeoutId = setTimeout(() => model.placingData.isQuoteTimeout = true,\r\n parseFloat(model.settingData.SystemParameter.EnquiryOutTime) * 1000);\r\n\r\n model.commService.quote(instrument.Id, model.closeLot, BSStatus.Both, model.placingData.pips, (e) => console.log(e));\r\n } else {\r\n this.submit(limitPrice, stopPrice);\r\n }\r\n }\r\n\r\n adjustLotTo(newLot) {\r\n let { model } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n\r\n let openOrders = [];\r\n for (let orderId in instrument.openPositions) {\r\n let order = instrument.openPositions[orderId];\r\n if (order.isSelected && order.selectedLot) {\r\n openOrders.push(instrument.openPositions[orderId]);\r\n }\r\n }\r\n openOrders.sort((a, b) => a.Transaction.ExecuteTime.localeCompare(b.Transaction.ExecuteTime));\r\n\r\n // List < ClosingContract > contracts = new List < ClosingContract > (this.ClosingContracts);\r\n // contracts.Sort(ClosingContract.AdjustLotComparer);\r\n let remainLot = newLot;\r\n openOrders.forEach((contract) => {\r\n if (contract.selectedLot > 0 && remainLot < contract.selectedLot) {\r\n if (remainLot <= 0) {\r\n remainLot = 0;\r\n contract.isSelected = false;\r\n }\r\n contract.selectedLot = remainLot;\r\n }\r\n remainLot -= (contract.selectedLot ? contract.selectedLot : 0);\r\n });\r\n }\r\n\r\n submit(limitPrice, stopPrice) {\r\n let { model, t, isPad } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n\r\n let lotSettings = getLotSettings(model.selectedAccount, instrument, model.placingData.orderType !== OrderType.Limit, false);\r\n if (model.closeLot > lotSettings.max || model.closeLot < lotSettings.min) {\r\n model.showModalDialog(utils.format2(t('DialogWindow.PlacingOrder_SumLotGreaterThanMaxLotOrLessThanMinLot'), model.closeLot, lotSettings.max, lotSettings.min));\r\n return;\r\n }\r\n let quotation = model.placingData.quoteAnswer && model.placingData.quoteAnswer.Ask ? model.placingData.quoteAnswer : instrument.quotation;\r\n let buyPrice = (isNormal ? quotation.Ask : quotation.Bid);\r\n let sellPrice = (isNormal ? quotation.Bid : quotation.Ask);\r\n let dqPrices = { buyPrice: buyPrice, sellPrice: sellPrice };\r\n\r\n let openOrders = [];\r\n let isOcoChecked = isPad ? model.placingData.isOcoChecked : this.state.isOcoChecked;\r\n for (let orderId in instrument.openPositions) {\r\n let order = instrument.openPositions[orderId];\r\n if (order.isSelected && order.selectedLot) {\r\n openOrders.push(instrument.openPositions[orderId]);\r\n }\r\n }\r\n if (openOrders.length === 0) {\r\n model.showModalDialog(DialogWindow.OpenOrderPageTitle);\r\n } else {\r\n\r\n let trans = null;\r\n let isBuy = !Boolean.parseBoolean(openOrders[0].IsBuy);\r\n // trans = model.buildTransactions(instrument, TransactionType.Single, model.placingData.orderType, isBuy, 0, openOrders, dqPrices);\r\n if (model.placingData.orderType === OrderType.SpotTrade || model.placingData.orderType === OrderType.Market) {\r\n trans = model.buildTransactions(instrument, TransactionType.Single, model.placingData.orderType, isBuy, 0, openOrders, dqPrices);\r\n } else {\r\n\r\n if (limitPrice === undefined) limitPrice = this.state.limitPrice;\r\n if (stopPrice === undefined) stopPrice = this.state.stopPrice;\r\n\r\n if (utils.isEmpty(limitPrice) && utils.isEmpty(stopPrice)) {\r\n model.showModalDialog(DialogWindow.PleaseEnterPrice);\r\n return;\r\n }\r\n let transactionType = (this.isOcoEnabled(limitPrice, stopPrice) && isOcoChecked ? TransactionType.OneCancelOther : TransactionType.Single);\r\n let orderType = (this.isOcoEnabled(limitPrice, stopPrice) && isOcoChecked ? OrderType.OneCancelOther : OrderType.Limit);\r\n let expireType = isPad ? model.placingData.expireType : this.state.expireType;\r\n let expireTime = isPad ? model.placingData.expireTime : this.state.expireTime;\r\n trans = model.buildTransactions(instrument, transactionType, orderType, isBuy, 0, openOrders, undefined, { setPrice: limitPrice }, { setPrice: stopPrice }, expireType, expireTime);\r\n }\r\n model.placingData.transactions = undefined;\r\n if (instrument.fastTradeChecked) {\r\n model.placingData.transactions = trans;\r\n this.setState({ transactions: trans, confirmDialogVisible: true });\r\n this.startSpotTradedPromptUIKeepSeconds(model.placingData.orderType);\r\n this.placeTransaction();\r\n } else {\r\n if (isPad) model.startDqPriceCountDown(instrument, () => { if (!this.state.isConfirmOkClicked) this.setState({ confirmDialogVisible: false }) });\r\n this.setState({ isConfirmOkClicked: false, transactions: trans, confirmDialogVisible: true });\r\n this.startSpotTradedPromptUIKeepSeconds(model.placingData.orderType);\r\n }\r\n }\r\n }\r\n\r\n setStateProp(propName, propValue) {\r\n let { model } = this.props;\r\n let prop = {};\r\n prop[propName] = propValue;\r\n this.setState(prop);\r\n\r\n if (propName === 'isOcoChecked') {\r\n model.placingData.isOcoChecked = propValue;\r\n }\r\n\r\n if (propName === \"pips\") {\r\n this.props.model.placingData.pips = propValue;\r\n }\r\n\r\n if (propName === \"limitPrice\") {\r\n model.placingData.useLimitPrice = !utils.isEmpty(propValue);\r\n model.refreshAllowedCloseLot(model.placingData.selectedInstrument);\r\n this.refreshOpenOrderLot();\r\n // this.onCloseOrderClick();\r\n if (this.props.forceUpdate) this.props.forceUpdate();\r\n } else if (propName === \"stopPrice\") {\r\n model.placingData.useStopPrice = !utils.isEmpty(propValue);\r\n model.refreshAllowedCloseLot(model.placingData.selectedInstrument);\r\n this.refreshOpenOrderLot();\r\n //this.onCloseOrderClick();\r\n if (this.props.forceUpdate) this.props.forceUpdate();\r\n }\r\n }\r\n\r\n onInputChange(propName, value) {\r\n if (value >= 0) {\r\n this.setStateProp(propName, value);\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n isOcoEnabled(limitPrice, stopPrice) {\r\n let { model } = this.props;\r\n let instrument = model.placingData.selectedInstrument;\r\n let canPlaceOcoOrder = model.canPlaceOcoOrder(instrument, false);\r\n if (limitPrice === undefined) limitPrice = this.state.limitPrice;\r\n if (stopPrice === undefined) stopPrice = this.state.stopPrice;\r\n return !utils.isEmpty(limitPrice) && !utils.isEmpty(stopPrice) && canPlaceOcoOrder;\r\n }\r\n\r\n canSelectOrder(order) {\r\n let { model, isPad } = this.props;\r\n //return (order.allowedCloseLot > 0 && (Boolean.parseBoolean(order.IsBuy) === !model.placingData.isBuy || (!isPad && model.placingData.orderType !== OrderType.Limit)));\r\n return (order.allowedCloseLot > 0 && (Boolean.parseBoolean(order.IsBuy) === !model.placingData.isBuy || model.placingData.orderType !== OrderType.Limit));\r\n }\r\n\r\n\r\n onExpireSelectViewChange(e) {\r\n this.setState({ expireType: e.expireType, expireTime: e.date });\r\n }\r\n\r\n render() {\r\n let { t, model, isPad } = this.props;\r\n\r\n if (this.props.model === undefined || this.props.model.placingData === undefined) {\r\n this.goto('/');\r\n return
;\r\n }\r\n let moduleCss = this.getModuleCss('CloseOrderView', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n let instrument = model.placingData.selectedInstrument;\r\n let tradePolicyDetail = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n let currency = undefined;\r\n if (Boolean.parseBoolean(model.selectedAccount.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n // this.Decimals = currency.Decimals;\r\n }\r\n else {\r\n currency = model.currencies[model.selectedAccount.CurrencyId];\r\n }\r\n\r\n let isBuy = model.placingData.isBuy;\r\n\r\n let buyOrderItemViews = [];\r\n let sellOrderItemViews = [];\r\n let totalFloating = 0;\r\n if (instrument.openPositions) {\r\n let openPositions = Object.values(instrument.openPositions).sort((a, b) => a.Transaction.ExecuteTime.localeCompare(b.Transaction.ExecuteTime));\r\n\r\n openPositions.forEach((order, index) => {\r\n if (this.canSelectOrder(order)) {\r\n if (Boolean.parseBoolean(order.IsBuy)) {\r\n buyOrderItemViews.push( )\r\n } else {\r\n sellOrderItemViews.push( )\r\n }\r\n if (order.isSelected && order.selectedLot > 0) {\r\n let lotBalance = parseFloat(order.LotBalance) - order.deliveryLotInProcess;\r\n totalFloating += parseFloat(order.TradePLFloat) * (parseFloat(order.selectedLot) / lotBalance);\r\n }\r\n }\r\n });\r\n }\r\n\r\n let quotationRiseColor = model.config.getValue('quotationRiseColor', '#32cd32');\r\n let quotationRiseForeColor = model.config.getValue('quotationRiseForeColor', this.getTheme() == 'white' ? '#000000' : '#ffffff');\r\n let quotationFallColor = model.config.getValue('quotationFallColor', \"#ff0000\");\r\n let quotationFallForeColor = model.config.getValue('quotationFallForeColor', this.getTheme() == 'white' ? '#000000' : '#ffffff');\r\n let colorStyle = undefined;\r\n if (instrument.priceTrend === PriceTrend.Rise) {\r\n colorStyle = { backgroundColor: quotationRiseColor, color: quotationRiseForeColor };\r\n } else if (instrument.priceTrend === PriceTrend.Fall) {\r\n colorStyle = { backgroundColor: quotationFallColor, color: quotationFallForeColor };\r\n } else {\r\n colorStyle = {}\r\n }\r\n\r\n let askBidPrice = (instrument.quotation ? instrument.quotation.Bid + '/' + instrument.quotation.Ask : '');\r\n let pendingOptionsVisibleStyle = { display: (model.placingData.orderType === OrderType.Limit ? 'block' : 'none') };\r\n let dqOptionsVisibleStyle = { display: (model.placingData.orderType !== OrderType.Limit ? 'block' : 'none') };\r\n\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n let pipsSettings = getMovePipsSettings(model.selectedAccount, instrument);\r\n let pips = (this.state.pips ? this.state.pips : (pipsSettings ? pipsSettings.default : 0));\r\n\r\n let basePrice = (isBuy === isNormal ? instrument.quotation.Ask : instrument.quotation.Bid);\r\n let limitPriceSetting = getPendingPriceSetting(model, instrument, basePrice, 0, LimitOrStop.Limit, isBuy ? BuySell.Buy : BuySell.Sell, false);\r\n let stopPriceSetting = getPendingPriceSetting(model, instrument, basePrice, 0, LimitOrStop.Stop, isBuy ? BuySell.Buy : BuySell.Sell, false);\r\n\r\n let selectAllSummaryBuy = this.state.selectedBuyLot == 0 ? \"\" : utils.format2(t('DialogWindow.SelectAllSummaryBuy'), this.state.selectedBuyLot);\r\n let selectAllSummarySell = this.state.selectedSellLot == 0 ? \"\" : utils.format2(t('DialogWindow.SelectAllSummarySell'), ',', this.state.selectedSellLot);\r\n let selectAllSummaryBuySell = (this.state.selectedBuyLot == 0 && this.state.selectedSellLot == 0) ? \"\" : utils.format2(t('DialogWindow.SelectAllSummaryBuySell'), selectAllSummaryBuy, selectAllSummarySell);\r\n\r\n let expireTypeOptions = [];\r\n\r\n let mainPaneClass = `${defaultCss.defaultColor} ${isPad ? moduleCss.closeOrderPane : moduleCss.closeOrderPane}`;\r\n // let buyOrderPane = buyOrderItemViews.length === 0 ? undefined :
{buyOrderItemViews}
;\r\n // let sellOrderPane = sellOrderItemViews.length === 0 ? undefined :
{sellOrderItemViews}
;\r\n\r\n let orderPane =
\r\n {buyOrderItemViews}\r\n {sellOrderItemViews}\r\n
;\r\n\r\n let checkAllBuyPane =
this.onSelectAllCheckboxChange.bind(this)(e.target.checked, BuySell.Buy)}>
MainView.Buy {this.state.selectedBuyLot ? @ {utils.formatPrice(this.state.averageBuyPrice, instrument.Denominator)} : ''}
;\r\n let checkAllSellPane =
this.onSelectAllCheckboxChange.bind(this)(e.target.checked, BuySell.Sell)}>
MainView.Sell {this.state.selectedSellLot ? @ {utils.formatPrice(this.state.averageSellPrice, instrument.Denominator)} : ''}
;\r\n let tradePLFloatClass = `${defaultCss.defaultColor} ${totalFloating < 0 ? defaultCss.negativeNumber : ''}`;\r\n let instrumentTradePLFloatClass = `${defaultCss.defaultColor} ${totalFloating < 0 ? defaultCss.negativeNumber : ''}`;\r\n let floatPaneStyle = isPad ? { textAlign: 'right', float: 'right' } : { textAlign: 'right', width: '10%', display: 'inline-block' };\r\n\r\n\r\n let canPlaceLimit = model.placingData.orderType != OrderType.Limit ? false : isAcceptedNewLimitPosition(model.selectedAccount, instrument, false, isBuy, model.closeLot);\r\n // if (canPlaceLimit && !utils.isEmpty(this.state.stopPrice)) {\r\n // canPlaceLimit = Boolean.parseBoolean(tradePolicyDetail.AllowNewLimitStopSameTime);\r\n // }\r\n\r\n let canPlaceStop = model.placingData.orderType != OrderType.Limit ? false : isAcceptedNewStopPosition(model.selectedAccount, instrument, false, isBuy, model.closeLot);\r\n // if (canPlaceStop && !utils.isEmpty(this.state.limitPrice)) {\r\n // canPlaceStop = Boolean.parseBoolean(tradePolicyDetail.AllowNewLimitStopSameTime);\r\n // }\r\n let lotSum = parseFloat(this.state.selectedBuyLot + this.state.selectedSellLot);\r\n let floatPane = {!totalFloating ? '' : utils.formatNumber(totalFloating, currency.Decimals)};\r\n let padSumPane =
\r\n
\r\n {this.state.buyLotCanSelect === 0 ? '' :
{checkAllBuyPane}
}\r\n {this.state.sellLotCanSelect === 0 ? '' :
{checkAllSellPane}
}\r\n
{lotSum ? lotSum : ''}
\r\n
\r\n {!isPad || (this.state.selectedBuyLot === 0 && this.state.selectedSellLot === 0) ? ''\r\n : {floatPane} }\r\n {!isPad ? '' :
this.props.onClosePaneClick()}>DialogWindow.Cancel
}\r\n
;\r\n\r\n let isValidInput = this.state.selectedBuyLot || this.state.selectedSellLot;\r\n if (isValidInput && model.placingData.orderType == OrderType.Limit && utils.isEmpty(this.state.stopPrice) && utils.isEmpty(this.state.limitPrice)) {\r\n isValidInput = false;\r\n }\r\n\r\n let enableFastTrade = utils.parseBoolean(model.customer.EnableFastTrade);\r\n let submitButtonClass = `${moduleCss.limitRowButton} ${!isValidInput ? '' : defaultCss.defaultButtonColor}`;\r\n return
\r\n {!isPad ? () : ''}\r\n\r\n {isPad ? null :\r\n
\r\n
{askBidPrice}
\r\n
\r\n {!totalFloating ? '' :
\r\n DialogWindow.PositionProfitAndLoss\r\n {utils.formatNumber(totalFloating, currency.Decimals)} \r\n
}\r\n
\r\n\r\n
}\r\n\r\n {!isPad ? padSumPane : ''}\r\n \r\n
\r\n {orderPane}\r\n {/* {buyOrderPane}\r\n {sellOrderPane} */}\r\n\r\n
\r\n {isPad ? padSumPane : ''}\r\n {isPad ? \"\" :
}\r\n\r\n
\r\n\r\n\r\n
\r\n {pipsSettings ?\r\n (
\r\n
DialogWindow.MovePips
\r\n
\r\n this.onInputChange('pips', value)} > \r\n
\r\n
) : ''}\r\n\r\n
\r\n {!enableFastTrade ? '' :
{ instrument.fastTradeChecked = e.target.checked; this.forceUpdate() }} >DialogWindow.FastTradeNoConfirm
}\r\n \r\n
\r\n\r\n\r\n
\r\n\r\n\r\n
\r\n
\r\n
DialogWindow.PlacingOrder_LimitPrice
\r\n
\r\n this.onInputChange('limitPrice', value)} placeHolder={DialogWindow.Price} > \r\n
\r\n
\r\n this.setStateProp('isOcoChecked', e.target.checked)}> DialogWindow.OCO \r\n
\r\n
\r\n\r\n
\r\n
DialogWindow.PlacingOrder_StopPrice
\r\n
\r\n this.onInputChange('stopPrice', value)} placeHolder={DialogWindow.Price} > \r\n
\r\n
\r\n\r\n\r\n
\r\n
DialogWindow.TimeExpired
\r\n
\r\n \r\n
\r\n\r\n \r\n
\r\n\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n \r\n
\r\n }\r\n\r\n}\r\n\r\nexport default withRouter(CloseOrderView);","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { CaretDownFilled, CaretRightOutlined, ClockCircleOutlined, PoweroffOutlined } from '@ant-design/icons';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport InventoryView from '../physical/inventoryview.js';\r\nimport * as utils from '../../common/utils.js';\r\nimport { PriceTrend, OrderType, InstrumentStatus, InstrumentCategory, PhysicalTradeSide } from '../../common/const';\r\n\r\nclass OpenPositionOrderView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n console.log('OpenPositionOrderView.ctor');\r\n }\r\n onOrderClick() {\r\n let { order, isPad } = this.props;\r\n if (!isPad) {\r\n order.isSelected = true;\r\n\r\n this.props.model.buildPlacingData(this.props.instrument, [order]);\r\n this.goto('/opencontract');\r\n }\r\n }\r\n\r\n\r\n onPlacingButtonClick(e, orderType) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n\r\n let { order, model, isTitle } = this.props;\r\n if (!isTitle) {\r\n let instrument = model.instruments[order.Transaction.InstrumentID];\r\n let isMarketClose = (instrument.status != InstrumentStatus.DayOpen && instrument.status != InstrumentStatus.SessionOpen);\r\n if (!isMarketClose) {\r\n model.buildPlacingData(this.props.instrument, [order], orderType);\r\n order.isSelected = true;\r\n // model.placingData.selectedOrders = [order];\r\n //model.placingData.orderType = orderType;\r\n this.goto('/closeorder');\r\n }\r\n }\r\n }\r\n\r\n render() {\r\n let { model, order, isPad, isTitle } = this.props;\r\n let moduleCss = this.getModuleCss('openpositionview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n let showTime = Boolean.parseBoolean(model.settingData.SystemParameter.OpenPositionShowTime);\r\n let instrument = isTitle ? undefined : model.instruments[order.Transaction.InstrumentID];\r\n let enableRebate = utils.parseBoolean(model.config.getValue('enableRebate', \"false\"));\r\n let enableInterest = utils.parseBoolean(model.config.getValue('enableInterest', \"true\"));\r\n if (isTitle) {\r\n if (isPad) {\r\n let titleStyle = (model && model.config) ? { backgroundColor: model.config.getValue('titleBackgroundColor'), color: model.config.getValue('titleColor') } : {};\r\n\r\n return
\r\n
DialogWindow.LimitOrStop
\r\n
DialogWindow.Liquidation
\r\n
DialogWindow.OrderCode
\r\n
DialogWindow.Account
\r\n
DialogWindow.Item
\r\n\r\n
DialogWindow.ExecuteTime
\r\n
DialogWindow.Lot
\r\n
MainView.BuySell
\r\n
DialogWindow.ExecutePrice
\r\n {/*
\r\n
*/}\r\n
DialogWindow.RefPrice
\r\n
DialogWindow.TradePLFloat
\r\n {!enableInterest ? '' :
DialogWindow.InterestPL
}\r\n {!enableInterest ? '' :
DialogWindow.InterestRate
}\r\n\r\n {/*
DialogWindow.StoragePL
*/}\r\n {!this.props.showCommission ? '' :
MainListView.CommissionSum
}\r\n {!enableRebate ? '' :
DialogWindow.Rebate
}\r\n\r\n {/*
DialogWindow.InterestRate
\r\n
MainView.CurrencyRate
*/}\r\n
\r\n }\r\n return
\r\n
MainView.BuySell
\r\n
MainView.TradePrice
\r\n
MainView.TradeDay
\r\n
MainView.Position
\r\n
MainView.TradePLFloat
\r\n
\r\n }\r\n else {\r\n let account = model.accounts[order.Transaction.AccountID];\r\n let tradePolicy = model.selectedAccount.TradePolicyDetails[instrument.Id];\r\n\r\n let currency = undefined;\r\n if (Boolean.parseBoolean(model.selectedAccount.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n // this.Decimals = currency.Decimals;\r\n }\r\n else {\r\n currency = model.currencies[model.selectedAccount.CurrencyId];\r\n }\r\n\r\n let isBuy = (order && utils.parseBoolean(order.IsBuy));\r\n let buySellClass = `${moduleCss.orderItemBuySell} ${!isBuy ? defaultCss.sellColor : ''}`;\r\n let refPrice = utils.parseBoolean(instrument.IsNormal) == isBuy ? instrument.lastQuotation.Bid : instrument.lastQuotation.Ask;\r\n let tradePLFloatClass = `${isPad ? moduleCss.padOrderTradePLFloat : moduleCss.orderItemFloat} ${order && order.TradePLFloat < 0 ? defaultCss.negativeNumber : ''}`;\r\n\r\n let orderTypes = instrument.getAvailableOrderTypes();\r\n let isMarket = orderTypes.indexOf(OrderType.Market) >= 0;\r\n let isMultiCurrency = utils.parseBoolean(account.IsMultiCurrency);\r\n let isMarketClose = (instrument.status != InstrumentStatus.DayOpen && instrument.status != InstrumentStatus.SessionOpen) || utils.isEmpty(refPrice);\r\n let disableClass = isMarketClose ? defaultCss.disabledColor : '';\r\n\r\n if (isPad) {\r\n\r\n let tradePolicyDetail = account.TradePolicyDetails[instrument.Id];\r\n let interestRatePolicy = model.interestRates[tradePolicyDetail.InterestRateId];\r\n let interestRate = isBuy ? interestRatePolicy.Buy : interestRatePolicy.Sell;\r\n let interestRateClass = `${moduleCss.padOrderInterestRate} ${order && interestRate < 0 ? defaultCss.negativeNumber : ''}`;\r\n\r\n let currencyRate = model.currencyRates[instrument.CurrencyId + \"_\" + account.CurrencyId];\r\n\r\n let rebate = utils.formatNumber(Math.abs((order.Commission < 0 ? order.Commission : 0) + (order.Levy < 0 ? order.Levy : 0)), currency.Decimals);\r\n return
this.onOrderClick()} >\r\n\r\n
this.onPlacingButtonClick.bind(this)(e, OrderType.Limit)} >
\r\n
this.onPlacingButtonClick.bind(this)(e, isMarket ? OrderType.Market : OrderType.SpotTrade)} >
\r\n
{order.Code}
\r\n
{account.Code}
\r\n
{instrument.Description}
\r\n\r\n\r\n
{showTime ? order.Transaction.ExecuteTime : order.Transaction.ExecuteTime.substring(0, 10)}
\r\n
{parseFloat(order.LotBalance)}
\r\n
{isBuy ? MainView.Buy : MainView.Sell}
\r\n
{order.ExecutePrice}
\r\n {/*
\r\n
*/}\r\n
{refPrice}
\r\n
{!order.TradePLFloat ? '' : utils.formatNumber(order.TradePLFloat, currency.Decimals)}
\r\n {!enableInterest ? '' :
{order.InterestPLFloat}
}\r\n {!enableInterest ? '' :
{interestRate}
}\r\n {/*
{order.StoragePLFloat}
*/}\r\n {!this.props.showCommission ? '' :
{utils.formatNumber(parseFloat(order.EstimateCloseCommission), currency.Decimals)}
}\r\n {enableRebate ?
{rebate}
: ''}\r\n\r\n {/*
{interestRate}
\r\n
{parseFloat(currencyRate.RateIn)}
*/}\r\n
\r\n } else {\r\n return
this.onOrderClick()} >\r\n
{isBuy ? 'MainView.Buy' : 'MainView.Sell'}
\r\n
{order.ExecutePrice}
\r\n
{showTime ? order.Transaction.ExecuteTime : order.Transaction.ExecuteTime.substring(0, 10)}
\r\n
{parseFloat(order.LotBalance)}
\r\n
{!order.TradePLFloat ? '' : utils.formatNumber(parseFloat(order.TradePLFloat), currency.Decimals)}
\r\n
\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\nlet OpenPositionOrderRouteView = withRouter(OpenPositionOrderView);\r\nclass OpenPositionGroupView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n collapsed: true,\r\n displayStyle: { display: props.isPad ? 'block' : 'none' }\r\n };\r\n }\r\n\r\n onBuySellButtonClick(e, isBuy) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n\r\n let { model, isTitle, instrument } = this.props;\r\n if (isTitle || !instrument || (instrument.totalBuyLot == 0 && isBuy) || instrument.totalSellLot == 0 && !isBuy) {\r\n return;\r\n }\r\n\r\n if (instrument.openPositions) {\r\n let isMarketClose = (instrument.status != InstrumentStatus.DayOpen && instrument.status != InstrumentStatus.SessionOpen);\r\n if (!isMarketClose) {\r\n let openPositions = Object.values(instrument.openPositions).sort((a, b) => {\r\n return a.Transaction.ExecuteTime.localeCompare(b.Transaction.ExecuteTime);\r\n }).filter((o) => utils.parseBoolean(o.IsBuy) == isBuy);\r\n\r\n openPositions.forEach((order) => { order.isSelected = true });\r\n\r\n model.buildPlacingData(this.props.instrument, openPositions, OrderType.SpotTrade);\r\n\r\n // model.placingData.selectedOrders = [order];\r\n //model.placingData.orderType = orderType;\r\n this.goto('/closeorder');\r\n openPositions.forEach((order) => { order.isSelected = true });\r\n }\r\n }\r\n }\r\n render() {\r\n let moduleCss = this.getModuleCss('openpositionview', 'common');\r\n\r\n let { model, instrument, isPad, isPositionSum, isTitle } = this.props;\r\n //let currency = model.currencies[instrument.CurrencyId];\r\n let currency = undefined;\r\n if (Boolean.parseBoolean(model.selectedAccount.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n // this.Decimals = currency.Decimals;\r\n }\r\n else {\r\n currency = model.currencies[model.selectedAccount.CurrencyId];\r\n }\r\n\r\n\r\n let orderViews = [];\r\n if (!isPad) {\r\n orderViews.push( );\r\n }\r\n let openLotBuy = 0, openLotSell = 0, tradePLFloat = 0;\r\n let openPositions = undefined;\r\n if (!isTitle) {\r\n openPositions = Object.values(instrument.openPositions).sort((a, b) => {\r\n return a.Transaction.ExecuteTime.localeCompare(b.Transaction.ExecuteTime);\r\n }\r\n );\r\n\r\n openPositions.forEach((order, index) => {\r\n if (parseFloat(order.LotBalance) > 0) {\r\n if (!isPad || instrument.Category == InstrumentCategory.Forex) {\r\n orderViews.push( )\r\n }\r\n tradePLFloat += parseFloat(order.TradePLFloat);\r\n if (Boolean.parseBoolean(order.IsBuy)) {\r\n openLotBuy += parseFloat(order.LotBalance);\r\n }\r\n else {\r\n openLotSell += parseFloat(order.LotBalance);\r\n }\r\n }\r\n });\r\n }\r\n\r\n let quotationRiseColor = model.config.getValue('quotationRiseColor', '#32cd32');\r\n let quotationRiseForeColor = model.config.getValue('quotationRiseForeColor', this.getTheme() == 'white' ? '#000000' : '#ffffff');\r\n let quotationFallColor = model.config.getValue('quotationFallColor', \"#ff0000\");\r\n let quotationFallForeColor = model.config.getValue('quotationFallForeColor', this.getTheme() == 'white' ? '#000000' : '#ffffff');\r\n let priceColorStyle = undefined;\r\n if (instrument.priceTrend === PriceTrend.Rise) {\r\n priceColorStyle = { backgroundColor: quotationRiseColor, color: quotationRiseForeColor };\r\n } else if (instrument.priceTrend === PriceTrend.Fall) {\r\n priceColorStyle = { backgroundColor: quotationFallColor, color: quotationFallForeColor };\r\n } else {\r\n priceColorStyle = {}\r\n }\r\n let askBidPrice = (instrument.quotation ? instrument.quotation.Bid + '/' + instrument.quotation.Ask : '');\r\n let defaultCss = this.getModuleCss('default');\r\n let floatClass = `${moduleCss.instrumentRightValue} ${tradePLFloat < 0 ? defaultCss.negativeNumber : ''}`;\r\n\r\n let netPosition = parseFloat((instrument.totalBuyLot - instrument.totalSellLot).toFixed(4));\r\n let buyClass = `${moduleCss.positionSumLot} ${defaultCss.buyColor}`;\r\n let sellClass = `${moduleCss.positionSumLot} ${defaultCss.sellColor}`;\r\n let netClass = netPosition >= 0 ? buyClass : sellClass;\r\n let isUniqueClient = utils.parseBoolean(model.settingData.SystemParameter.IsUniqueClient);\r\n if (isPad) {\r\n if (isPositionSum) {\r\n if (isTitle) {\r\n let titleStyle = (model && model.config) ? { backgroundColor: model.config.getValue('titleBackgroundColor'), color: model.config.getValue('titleColor') } : {};\r\n\r\n return
\r\n
DialogWindow.InstrumentCode
\r\n
MainView.Buy
\r\n
Common.AverageBuyPrice
\r\n
MainView.Sell
\r\n
Common.AverageSellPrice
\r\n {isUniqueClient ? '' :
Common.NetPosition
}\r\n
DialogWindow.TradePLFloat{currency ? \"(\" + currency.Name + \")\" : ''}
\r\n
;\r\n } else {\r\n return
\r\n
{instrument.Description}
\r\n
this.onBuySellButtonClick(e, true)}> {parseFloat(instrument.totalBuyLot.toFixed(4))}
\r\n
{instrument.averageBuyPrice}
\r\n
this.onBuySellButtonClick(e, false)}> {parseFloat(instrument.totalSellLot.toFixed(4))}
\r\n
{instrument.averageSellPrice}
\r\n {isUniqueClient ? '' :
{Math.abs(netPosition)}
}\r\n
{!instrument.TradePLFloat ? '' : utils.formatNumber(instrument.TradePLFloat, currency.Decimals)}
\r\n
;\r\n }\r\n } else {\r\n return
\r\n
\r\n {orderViews}\r\n
\r\n
\r\n }\r\n } else {\r\n if (parseInt(instrument.Category) == InstrumentCategory.Physical && instrument.physicalInventory) {\r\n let physicalInventories = Object.values(instrument.physicalInventory).filter((inventory) => parseFloat(inventory.LotBalance) > 0);\r\n if (physicalInventories && physicalInventories.length > 0) {\r\n let inventory = physicalInventories[0];\r\n if (inventory.PhysicalTradeSide != PhysicalTradeSide.ShortSell) {\r\n // console.log(instrument.Description);\r\n orderViews = \r\n }\r\n } else {\r\n orderViews = [];\r\n }\r\n }\r\n return orderViews.length == 0 ? '' :
\r\n
\r\n
\r\n
{this.state.collapsed ? : }
{instrument.Description}
\r\n
 
\r\n
{askBidPrice}
\r\n
\r\n\r\n
\r\n
DialogWindow.PositionProfitAndLoss {!instrument.TradePLFloat ? '' : utils.formatNumber(instrument.TradePLFloat, currency.Decimals)}
\r\n
MainView.Buy {parseFloat(openLotBuy.toFixed(4))}
\r\n
MainView.Sell {parseFloat(openLotSell.toFixed(4))}
\r\n\r\n
\r\n
\r\n
\r\n {orderViews}\r\n
\r\n\r\n
\r\n }\r\n }\r\n\r\n handleInstrumentClick() {\r\n let collapsed = !this.state.collapsed;\r\n this.setState({\r\n displayStyle: { display: collapsed ? 'none' : 'block' },\r\n collapsed: collapsed\r\n });\r\n }\r\n\r\n}\r\n\r\n\r\n// export default withRouter(OrderInstrumentGroupView);\r\nlet openPositionGroupView = withRouter(OpenPositionGroupView);\r\n\r\n\r\nexport { openPositionGroupView as OpenPositionGroupView, OpenPositionOrderView };\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { CaretLeftFilled } from '@ant-design/icons';\r\n\r\nimport { InstrumentCategory } from '../../common/const';\r\nimport BaseView from \"../baseview.js\";\r\nimport { OpenPositionGroupView, OpenPositionOrderView } from './openpositiongroupview';\r\nimport TitleBarView from '../titlebarview';\r\n\r\nclass OpenPositionView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n console.log('OpenPositionView.ctor');\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.model && this.props.model.isTradingDataLoaded) {\r\n this.props.model.resetInput();\r\n }\r\n }\r\n\r\n render() {\r\n // console.log('OpenPositionView.render');\r\n if (this.props.model === undefined || this.props.model.instruments === undefined) {\r\n this.goto('/');\r\n return
;\r\n }\r\n\r\n let { model, isPad } = this.props;\r\n let moduleCss = this.getModuleCss('openpositionview', 'common');\r\n\r\n let orderGroups = [];\r\n let instruments = Object.values(model.instruments).sort((a, b) => a.Code.localeCompare(b.Code));\r\n\r\n let showRebate = false;\r\n let showCommission = false;\r\n\r\n\r\n instruments.forEach((instrument)=>{\r\n if (instrument.openPositions) {\r\n let openPositions = Object.values(instrument.openPositions);\r\n if (openPositions.length > 0) {\r\n openPositions.forEach((order) => {\r\n if (parseFloat(order.EstimateCloseCommission) != 0) showCommission = true;\r\n // if (parseFloat(order.EstimateCloseLevy) < 0) showRebate = true;\r\n });\r\n }\r\n }\r\n });\r\n\r\n instruments.forEach((instrument)=>{\r\n if (instrument.openPositions) {\r\n let openPositions = Object.values(instrument.openPositions);\r\n if (openPositions.length > 0) {\r\n let currency = this.props.model.currencies[instrument.CurrencyId];\r\n orderGroups.push( );\r\n\r\n // openPositions.forEach((order, index) => {\r\n // order.isSelected = false;\r\n // order.selectedLot = parseFloat(order.LotBalance);\r\n // });\r\n }\r\n }\r\n });\r\n\r\n\r\n // console.info(orderGroups);\r\n\r\n return
\r\n {!isPad ? () : ('')}\r\n\r\n {isPad ?
\r\n \r\n
: ''}\r\n\r\n
\r\n {orderGroups}\r\n
\r\n\r\n\r\n
\r\n }\r\n\r\n handleGoBack() {\r\n this.props.history.goBack();\r\n }\r\n\r\n\r\n}\r\n\r\n\r\n\r\nclass OpenPositionSumView extends BaseView {\r\n\r\n componentDidMount() {\r\n if (this.props.model && this.props.model.isTradingDataLoaded) {\r\n this.props.model.resetInput();\r\n }\r\n }\r\n\r\n render() {\r\n // console.log('OpenPositionView.render');\r\n if (this.props.model === undefined || this.props.model.instruments === undefined) {\r\n this.goto('/');\r\n return
;\r\n }\r\n\r\n let { model, isPad } = this.props;\r\n let moduleCss = this.getModuleCss('openpositionview', 'common');\r\n\r\n let orderGroups = [];\r\n let instruments = this.props.model.instruments;\r\n\r\n let showRebate = false;\r\n let showCommission = false;\r\n\r\n\r\n for (let instrumentId in instruments) {\r\n let instrument = instruments[instrumentId];\r\n if (instrument.openPositions) {\r\n let openPositions = Object.values(instrument.openPositions);\r\n if (openPositions.length > 0) {\r\n openPositions.forEach((order) => {\r\n if (parseFloat(order.EstimateCloseCommission) > 0) showCommission = true;\r\n if (parseFloat(order.EstimateCloseCommission) < 0) showRebate = true;\r\n });\r\n }\r\n }\r\n }\r\n\r\n for (let instrumentId in instruments) {\r\n let instrument = instruments[instrumentId];\r\n if (parseInt(instrument.Category) !== InstrumentCategory.Physical && instrument.openPositions) {\r\n let openPositions = Object.values(instrument.openPositions);\r\n if (openPositions.length > 0) {\r\n let currency = this.props.model.currencies[instrument.CurrencyId];\r\n orderGroups.push( );\r\n\r\n // openPositions.forEach((order, index) => {\r\n // order.isSelected = false;\r\n // order.selectedLot = parseFloat(order.LotBalance);\r\n // });\r\n }\r\n }\r\n }\r\n\r\n\r\n\r\n // console.info(orderGroups);\r\n\r\n return
\r\n
\r\n \r\n
\r\n
\r\n {orderGroups}\r\n
\r\n\r\n\r\n
\r\n }\r\n\r\n handleGoBack() {\r\n this.props.history.goBack();\r\n }\r\n\r\n\r\n}\r\n\r\nlet openPositionView = withRouter(OpenPositionView);\r\nexport { openPositionView as OpenPositionView, OpenPositionSumView };\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { message as antMessage, Select } from 'antd';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\nimport * as utils from '../../common/utils.js';\r\n// import BottomBar from './bottombar';\r\n\r\n\r\n\r\nconst { Option } = Select;\r\n\r\nclass OrderQueryView extends BaseView {\r\n\r\n constructor(props) {\r\n console.log('OrderQueryView.ctor');\r\n super(props);\r\n this.state = { queryType: '0', instrument: '', days: \"1\" };\r\n }\r\n\r\n componentDidMount() { }\r\n\r\n\r\n\r\n onQueryClick(e) {\r\n let { model } = this.props;\r\n if (this.state.queryType === \"4\") {\r\n if (this.props.isPad) {\r\n this.props.onQueryClick('PendingOrderView');\r\n } else {\r\n this.goto('/pendingorder');\r\n }\r\n } else {\r\n model.showLoadingSpin(true);\r\n model.orderQueryParam = { queryType: this.state.queryType, instrument: this.state.instrument, days: this.state.days };\r\n\r\n if (model && model.orderQueryParam) {\r\n let param = this.props.model.orderQueryParam;\r\n this.props.commService.queryOrder(model.selectedAccount.Id, param.instrument, param.days, param.queryType, this.queryCallback.bind(this));\r\n }\r\n\r\n // this.goto('/orderqueryresult');\r\n }\r\n }\r\n\r\n\r\n queryCallback(jsonMessage) {\r\n let { model } = this.props;\r\n let data = JSON.parse(jsonMessage);\r\n let viewData_OrderQueryResultView = {};\r\n if (data.Result.error) {\r\n utils.logError(data.Result.error);\r\n }\r\n else if (data.Result.content_result.OrderQueryResults != null) {\r\n let orders = utils.forceToArray(data.Result.content_result.OrderQueryResults.OrderQueryResult);\r\n orders.forEach((order, index) => {\r\n let group = viewData_OrderQueryResultView[order.InstrumentCode];\r\n if (!group) {\r\n group = [];\r\n group.tradePLSum = 0;\r\n group.openLotSum = 0;\r\n group.closeLotSum = 0;\r\n viewData_OrderQueryResultView[order.InstrumentCode] = group;\r\n }\r\n\r\n if (Boolean.parseBoolean(order.IsOpen)) {\r\n group.openLotSum += parseFloat(order.Lot);\r\n } else {\r\n group.closeLotSum += parseFloat(order.Lot);\r\n }\r\n if (!utils.isEmpty(order.TradePL)) {\r\n group.tradePLSum += parseFloat(order.TradePL);\r\n }\r\n group.push(order);\r\n });\r\n }\r\n\r\n this.props.model.viewData_OrderQueryResultView = viewData_OrderQueryResultView;\r\n model.showLoadingSpin(false);\r\n this.goto('/orderqueryresult');\r\n }\r\n\r\n render() {\r\n if (!this.props.model) {\r\n this.goto('/');\r\n return '';\r\n }\r\n\r\n let { model } = this.props;\r\n let moduleCss = this.getModuleCss('OrderQueryView', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n let instrumentSelect = [];\r\n model.orderedInstruments.forEach((instrument) => {\r\n instrumentSelect.push()\r\n });\r\n\r\n let daySelect = [];\r\n for (let i = 1; i <= 7; i++) {\r\n daySelect.push()\r\n }\r\n\r\n return
\r\n {!this.props.isPad ? () : ('')}\r\n\r\n
\r\n
DialogWindow.Type
\r\n
\r\n \r\n
\r\n
\r\n
DialogWindow.Item
\r\n
\r\n \r\n
\r\n
\r\n
DialogWindow.LastDays
\r\n
\r\n \r\n\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n\r\n\r\n
\r\n\r\n {this.props.children}\r\n {/* { this.bottomBarComponent = ref;}} /> */}\r\n\r\n\r\n
\r\n }\r\n\r\n}\r\n\r\nexport default withRouter(OrderQueryView);\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Spin, message as antMessage } from 'antd';\r\n\r\n// import moduleCss from \"../../style/todayexecute.module.css\";\r\n\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\n\r\nimport * as utils from '../../common/utils.js';\r\nimport { OrderType, TransactionType, TradeOption } from '../../common/const.js';\r\n\r\n\r\n\r\nclass OrderQueryResultView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = { ordersGroupedByInstrument: {} };\r\n }\r\n\r\n componentDidMount() { }\r\n\r\n componentWillUnmount() {\r\n if (this.props.model !== undefined && this.props.model.viewData_OrderQueryResultView !== undefined) {\r\n this.props.model.viewData_OrderQueryResultView = undefined;\r\n }\r\n }\r\n\r\n getOrderTypeLanguageKey(orderType, tradeOption) {\r\n if (orderType == OrderType.SpotTrade) {\r\n return \"MainView.OrderType_Spot\";\r\n } else if (orderType == OrderType.Market) {\r\n return \"MainView.OrderType_Market\";\r\n }\r\n // else if (order.Transaction.Type == TransactionType.OneCancelOther) {\r\n // return (order.TradeOption == TradeOption.Better ? \"MainView.LimitOfOCO\" : \"MainView.StopOfOCO\");\r\n // } \r\n else {\r\n return tradeOption == TradeOption.Better ? \"MainView.OrderType_Limit\" : \"MainView.OrderType_Stop\";\r\n };\r\n\r\n }\r\n\r\n render() {\r\n if (!this.props.model || !this.props.model.selectedAccount || !this.props.model.orderQueryParam) {\r\n this.goto('/');\r\n return
;\r\n }\r\n\r\n console.info('orderqueryresultview.render');\r\n let { model } = this.props;\r\n\r\n let orderGroups = [];\r\n let viewData_OrderQueryResultView = this.props.model.viewData_OrderQueryResultView;\r\n let moduleCss = this.getModuleCss('orderqueryresult', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n if (viewData_OrderQueryResultView) {\r\n let instrumentCodes = Object.keys(viewData_OrderQueryResultView).sort((a, b) => b.localeCompare(a));\r\n if (instrumentCodes && instrumentCodes.length > 0) {\r\n instrumentCodes.forEach((instrumentCode, i1) => {\r\n let todayOrders = viewData_OrderQueryResultView[instrumentCode];\r\n orderGroups.push(
{instrumentCode}\r\n DialogWindow.OpenCloseOrder:{parseFloat(todayOrders.openLotSum.toFixed(4))}/{parseFloat(todayOrders.closeLotSum.toFixed(4))}\r\n {todayOrders.tradePLSum ? parseFloat(todayOrders.tradePLSum.toFixed(6)) : ''}\r\n
);\r\n todayOrders.forEach((order, index) => {\r\n\r\n orderGroups.push(
\r\n
{utils.getPhaseLanguageKey(order.Phase)}
\r\n
{order.ExecuteTime ? order.ExecuteTime.substring(5, 16) : ''}
\r\n
{this.getOrderTypeLanguageKey(order.OrderType, order.TradeOption)}
\r\n\r\n\r\n
{Boolean.parseBoolean(order.IsBuy) ? 'MainView.Buy' : 'MainView.Sell'} {parseFloat(order.Lot)}
\r\n
{order.Price}
\r\n\r\n
{order.TradePL != 0 ? order.TradePL : ''}
\r\n\r\n
);\r\n });\r\n\r\n });\r\n }\r\n }\r\n\r\n return
\r\n {!this.props.isPad ? (\r\n ) : ('')}\r\n\r\n
\r\n\r\n
MainView.Phase
\r\n
DialogWindow.ExecuteTradeDay
\r\n
DialogWindow.OrderType
\r\n
DialogWindow.Quantity
\r\n
DialogWindow.Price
\r\n\r\n
MainView.TradePL
\r\n\r\n
\r\n\r\n
\r\n {orderGroups}\r\n {\r\n orderGroups.length === 0 ?
Common.NoData
: ''\r\n }\r\n {this.props.children}\r\n
\r\n\r\n\r\n
\r\n }\r\n\r\n handleGoBack() {\r\n this.props.history.goBack();\r\n }\r\n\r\n\r\n}\r\n\r\nexport default withRouter(OrderQueryResultView);\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\n\r\nimport { CaretDownFilled, PoweroffOutlined } from '@ant-design/icons';\r\n\r\nimport { PhysicalTradeSide, InstrumentStatus, OrderType } from '../../common/const';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport { InventoryItemView } from './inventoryitemview';\r\nimport * as utils from '../../common/utils';\r\n\r\nexport default class ShortSellView extends BaseView {\r\n\r\n componentDidMount() {\r\n // this.setState({ orderGroup : this.props.orderGroup});\r\n }\r\n\r\n refreshGroup() {\r\n }\r\n\r\n render() {\r\n let moduleCss = this.getModuleCss('inventoryview', 'common');\r\n\r\n let { model, isPad } = this.props;\r\n\r\n let orderViews = [];\r\n\r\n Object.values(model.instruments).forEach((instrument, index) => {\r\n if (instrument.physicalShortSell && (isPad || instrument.Id === model.placingData.selectedInstrument.Id)) {\r\n Object.values(instrument.physicalShortSell).forEach((inventory, index) => {\r\n if (parseFloat(inventory.LotBalance) > 0) {\r\n orderViews.push();\r\n }\r\n });\r\n }\r\n });\r\n\r\n return
\r\n
\r\n \r\n
\r\n {orderViews}\r\n
\r\n
\r\n\r\n
\r\n }\r\n\r\n\r\n}\r\n\r\n\r\nclass ShortSellItemView extends BaseView {\r\n\r\n componentDidMount() {\r\n console.log('ShortSellItemView.componentDidMount');\r\n }\r\n\r\n\r\n onCloseButtonClick(e) {\r\n e.stopPropagation();\r\n e.cancelBubble = true;\r\n let { inventory, instrument, model, isTitle } = this.props;\r\n if (!isTitle) {\r\n // let instrument = model.instruments[order.Transaction.InstrumentID];\r\n let isMarketClose = (instrument.status != InstrumentStatus.DayOpen && instrument.status != InstrumentStatus.SessionOpen);\r\n if (!isMarketClose) {\r\n model.buildPlacingData(this.props.instrument, [inventory], OrderType.SpotTrade);\r\n inventory.isSelected = true;\r\n // model.placingData.selectedOrders = [order];\r\n //model.placingData.orderType = orderType;\r\n this.goto('/closeorder');\r\n }\r\n }\r\n }\r\n\r\n\r\n render() {\r\n let { model, inventory, instrument, isPad, isTitle } = this.props;\r\n let moduleCss = this.getModuleCss('inventoryview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n // let instrument = model.instruments[inventory.Transaction.InstrumentID];\r\n let account = !inventory ? '' : model.accounts[inventory.Transaction.AccountID];\r\n\r\n let currency = undefined;\r\n if (inventory) {\r\n if (Boolean.parseBoolean(account.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n }\r\n else {\r\n currency = model.currencies[account.CurrencyId];\r\n }\r\n }\r\n let unPaid = !inventory ? '' : utils.formatNumber(parseFloat(inventory.PhysicalOriginValueBalance) - Math.abs(parseFloat(inventory.PaidPledgeBalance)), currency.Decimals);\r\n let rowStyle = { marginLeft: 0 };\r\n if (isTitle && model && model.config) {\r\n rowStyle.backgroundColor = model.config.getValue('titleBackgroundColor');\r\n rowStyle.color = model.config.getValue('titleColor');\r\n }\r\n\r\n let buyPrice = '', sellPrice = '', quotation = {};\r\n if (instrument) {\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n quotation = instrument.quotations[account.UseQuotePolicyId];\r\n if (!quotation) {\r\n quotation = instrument.quotations[account.PublicQuotePolicyId];\r\n }\r\n buyPrice = (isNormal ? quotation.Ask : quotation.Bid);\r\n //sellPrice = (isNormal ? quotation.Bid : quotation.Ask);\r\n }\r\n if (isPad) {\r\n if (this.props.isTitle) {\r\n return
\r\n
MainView.Close
\r\n\r\n
DialogWindow.Account
\r\n
MainView.Instrument
\r\n
MainView.Date
\r\n
DialogWindow.Physical_Weight
\r\n
DialogWindow.Physical_Unit
\r\n
DialogWindow.Currency
\r\n\r\n
DialogWindow.ExecutePrice
\r\n
DialogWindow.RefPrice
\r\n\r\n
DialogWindow.TradePLFloat
\r\n
DialogWindow.PhysicalItem_PaidPledge
\r\n\r\n\r\n
\r\n } else {\r\n let instrumentUnit = (instrument.UnitId ? model.instrumentUnits[instrument.UnitId] : {});\r\n let weight = instrumentUnit ? parseFloat(instrumentUnit.Weight) : 1;\r\n\r\n return
\r\n
\r\n
{account.Name}
\r\n
{instrument.Description}
\r\n
{inventory.Transaction.ExecuteTime}
\r\n
{(parseFloat(inventory.Transaction.ContractSize) * parseFloat(inventory.LotBalance) * weight).toFixed(currency.Decimals)}
\r\n
{instrument.Unit}
\r\n
{currency.Code}
\r\n\r\n
{inventory.ExecutePrice}
\r\n
{buyPrice}
\r\n\r\n
{utils.formatNumber(inventory.TradePLFloat, currency.Decimals)}
\r\n
{utils.formatNumber(Math.abs(inventory.PaidPledgeBalance), currency.Decimals)}
\r\n
\r\n }\r\n } else {\r\n if (this.props.isTitle)\r\n return
\r\n
\r\n
DialogWindow.ExecuteTime
\r\n
DialogWindow.Physical_Weight
\r\n
DialogWindow.Physical_Unit
\r\n
DialogWindow.ExecutePrice
\r\n
DialogWindow.PhysicalItem_MarketValue
\r\n
\r\n else\r\n return
this.onInventoryClick()} >\r\n
\r\n
{inventory.Transaction.ExecuteTime.substring(0, 10)}
\r\n
{(parseFloat(inventory.Transaction.ContractSize) * parseFloat(inventory.LotBalance)).toFixed(4)}
\r\n
{instrument.Unit}
\r\n
{inventory.ExecutePrice}
\r\n
{(parseFloat(inventory.ExecutePrice) * parseFloat(inventory.LotBalance)).toFixed(4)}
\r\n
\r\n\r\n }\r\n }\r\n\r\n}\r\n\r\n// export {ShortSellView, ShortSellItemView}","import React from 'react';\r\n// import { Board } from './board';\r\nimport { Breakpoint } from 'react-socks';\r\nimport { HashRouter as Router, Switch, Route } from \"react-router-dom\";\r\nimport { withTranslation, Trans } from 'react-i18next';\r\nimport { message as antMessage, Spin, Radio, Button } from 'antd';\r\nimport { CloseOutlined } from '@ant-design/icons';\r\n\r\nimport * as utils from '../../common/utils.js';\r\nimport { OrderType } from '../../common/const';\r\n\r\nimport BaseView from \"../baseview.js\";\r\n\r\nimport InventoryView from './inventoryview';\r\nimport DeliveryInProcessView from './deliveryinprocessview';\r\nimport ShortSellView from './shortsellview';\r\n\r\n\r\nexport default class PadStockView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = { tabType: \"InventoryView\" };\r\n }\r\n\r\n componentDidMount() { }\r\n\r\n onOrderTypeChange(orderType) {\r\n this.props.model.placingData.orderType = orderType;\r\n // this.setState({ orderType: orderType, showPlacePanel: orderType === OrderType.Limit ? PlacePanelType.PendingOrder : PlacePanelType.SpotTrade }); \r\n this.setState({ tabType: orderType.toString() });\r\n }\r\n\r\n getStockTab(tabType) {\r\n let { model } = this.props;\r\n if (!model || !model.isTradingDataLoaded) {\r\n return null;\r\n }\r\n\r\n if (!tabType) {\r\n tabType = this.state.tabType;\r\n }\r\n console.log(\"getStockTab\");\r\n\r\n let result = [];\r\n\r\n\r\n // console.log('getBottomWorkingTab');\r\n if (tabType === \"InventoryView\") {\r\n result.push( );\r\n } else if (tabType === \"InventoryInProcessView\") {\r\n result.push();\r\n } else if (tabType === \"ShortSellView\") {\r\n result.push();\r\n }\r\n\r\n return result;\r\n }\r\n\r\n changeViewType(viewType) {\r\n if (this.state.tabType != viewType) {\r\n this.setState({ tabType: viewType });\r\n }\r\n }\r\n\r\n render() {\r\n // console.log('PadStockView.render()');\r\n\r\n let moduleCss = this.getModuleCss('inventoryview', 'common');\r\n let { model } = this.props;\r\n\r\n let instrument = (model && model.placingData ? model.placingData.selectedInstrument : {});\r\n let tabTitle = null;\r\n let closeButton = null;\r\n // if (this.state.tabType !== OrderType.SpotTrade.toString() && this.state.tabType !== OrderType.Limit.toString()) {\r\n tabTitle =
\r\n { this.changeViewType(e.target.value); }}>\r\n MainListView.Physical_Inventory\r\n MainListView.Physical_InventoryInProcess\r\n MainListView.Physical_InventoryDeficit\r\n \r\n\r\n
;\r\n // }\r\n\r\n return
\r\n {tabTitle}\r\n
\r\n {this.getStockTab()}\r\n
\r\n
;\r\n }\r\n\r\n\r\n}\r\n\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Spin } from 'antd';\r\n\r\n// import moduleCss from \"../../style/todayexecute.module.css\";\r\n\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\n\r\nimport * as utils from '../../common/utils.js';\r\n// import BottomBar from './bottombar';\r\n\r\n\r\n\r\nclass TodayExecuteView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = { ordersGroupedByInstrument: {} };\r\n }\r\n\r\n componentDidMount() {\r\n // debugger;\r\n // this.setState( {orderGroupByInstrument : this.props.orderGroupByInstrument });\r\n let model = this.props.model;\r\n if (model && model.selectedAccount) {\r\n this.props.commService.queryOrder(model.selectedAccount.Id, '', \"1\", \"3\", this.queryCallback.bind(this));\r\n }\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.props.model !== undefined && this.props.model.viewData_TodayExecuteView !== undefined) {\r\n this.props.model.viewData_TodayExecuteView = undefined;\r\n }\r\n }\r\n\r\n queryCallback(jsonMessage) {\r\n let data = JSON.parse(jsonMessage);\r\n let viewData_TodayExecuteView = {};\r\n if (data.Result.content_result.OrderQueryResults != null) {\r\n let orders = utils.forceToArray(data.Result.content_result.OrderQueryResults.OrderQueryResult);\r\n orders.forEach((order, index) => {\r\n let group = viewData_TodayExecuteView[order.InstrumentCode];\r\n if (!group) {\r\n group = [];\r\n viewData_TodayExecuteView[order.InstrumentCode] = group;\r\n }\r\n group.push(order);\r\n });\r\n }\r\n // this.setState({viewData_TodayExecuteView: viewData_TodayExecuteView});\r\n this.props.model.viewData_TodayExecuteView = viewData_TodayExecuteView;\r\n this.forceUpdate();\r\n }\r\n\r\n\r\n render() {\r\n // console.info('openpositionView.render'); \r\n if (!this.props.model) {\r\n this.goto('/');\r\n return '';\r\n }\r\n let { model } = this.props;\r\n let orderGroups = [];\r\n let viewData_TodayExecuteView = this.props.model.viewData_TodayExecuteView;\r\n let moduleCss = this.getModuleCss('todayexecute', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n\r\n if (viewData_TodayExecuteView) {\r\n let instrumentCodes = Object.keys(viewData_TodayExecuteView).sort((a, b) => b.localeCompare(a)).reverse();\r\n if (instrumentCodes && instrumentCodes.length > 0) {\r\n instrumentCodes.forEach((instrumentCode, i1) => {\r\n let todayOrders = viewData_TodayExecuteView[instrumentCode].sort((a, b) => b.ExecuteTime.localeCompare(a.ExecuteTime)).reverse();\r\n orderGroups.push(
{instrumentCode}
);\r\n\r\n todayOrders.forEach((order, index) => {\r\n let isBuy = Boolean.parseBoolean(order.IsBuy);\r\n let buySellClass = `${moduleCss.orderItemBuySell} ${!isBuy ? defaultCss.sellColor : ''}`;\r\n\r\n orderGroups.push(
\r\n
{isBuy ? 'MainView.Buy' : 'MainView.Sell'}
\r\n
{order.ExecuteTime.substring(11, 19)}
\r\n
{parseFloat(order.Lot)}
\r\n
{order.Price}
\r\n\r\n
{Boolean.parseBoolean(order.IsOpen) ? 'DialogWindow.OpenPosition' : 'DialogWindow.ClosePosition'}
\r\n
{utils.getPhaseLanguageKey(order.Phase)}
\r\n
);\r\n });\r\n\r\n });\r\n }\r\n }\r\n\r\n return
\r\n {!this.props.isPad ? (\r\n ) : ('')}\r\n\r\n
\r\n
\r\n
DialogWindow.SubmitTime
\r\n
DialogWindow.Quantity
\r\n
DialogWindow.Price
\r\n\r\n
DialogWindow.OpenCloseOrder
\r\n
MainView.Phase
\r\n
\r\n
\r\n {viewData_TodayExecuteView ? '' :
}\r\n {orderGroups}\r\n\r\n {this.props.children}\r\n
\r\n {/* { this.bottomBarComponent = ref;}} /> */}\r\n\r\n\r\n
\r\n }\r\n\r\n handleGoBack() {\r\n this.props.history.goBack();\r\n }\r\n\r\n\r\n}\r\n\r\nexport default withRouter(TodayExecuteView);\r\n","import React from 'react';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Trans } from 'react-i18next';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\nimport * as utils from '../../common/utils.js';\r\n\r\nclass MessageItemView extends BaseView {\r\n render() {\r\n let moduleCss = this.getModuleCss('messagelognews', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n let { model, message, isTitle, isPad } = this.props;\r\n let isRead = (message && message.IsRead !== undefined && utils.parseBoolean(message.IsRead));\r\n let timeStyle = (isRead || isPad ? {} : { fontWeight: \"bolder\" });\r\n\r\n // let rowStyle = (isTitle ? { fontWeight: \"bolder\" } : {});\r\n let rowStyle = { lineHeight: \"2.5em\" };\r\n if (isPad) rowStyle.minHeight = \"2.5em\";\r\n if (isTitle && model && model.config) {\r\n rowStyle.backgroundColor = model.config.getValue('titleBackgroundColor');\r\n rowStyle.color = model.config.getValue('titleColor');\r\n }\r\n\r\n let rowClassName = isPad ? `${moduleCss.padMessageItemMainPane} ${defaultCss.defaultBorderColor}` : `${moduleCss.messageItemMainPane} ${defaultCss.defaultColor}`;\r\n let timeClassName = `${isPad ? moduleCss.padMessageItemTime : moduleCss.messageItemTime} ${isRead ? defaultCss.secondaryTextColor : ''}`;\r\n let titleClassName = `${isPad ? moduleCss.padMessageItemTitle : moduleCss.messageItemTitle} ${isRead || !isPad ? defaultCss.secondaryTextColor : ''}`;\r\n\r\n return
{ this.props.onClick(message) }} className={rowClassName} style={rowStyle}>\r\n
{isTitle ? MainListView.PublishTime : message.PublishTime}
\r\n
{isTitle ? MainListView.Title : message.Title}
\r\n
\r\n }\r\n\r\n}\r\n\r\nclass MessageDetailView extends BaseView {\r\n onDeleteButtonClick() {\r\n let { model } = this.props;\r\n model.showLoadingSpin(true);\r\n let message = model.selectedMessage;\r\n this.props.commService.deleteMessage(message.Id, (d) => {\r\n let data = JSON.parse(d);\r\n model.showLoadingSpin(false);\r\n if (data.Result.content_result == 1) {\r\n delete model.messages[message.Id];\r\n this.goBack();\r\n } else {\r\n console.error('deleteMessage failed.');\r\n }\r\n });\r\n }\r\n\r\n onNextButtonClick(revers) {\r\n let { model } = this.props;\r\n let message = model.selectedMessage;\r\n let arr = Object.values(model.messages);\r\n let index = revers ? arr.length - 1 : 0;\r\n for (; revers ? index >= 0 : index <= arr.length - 1; revers ? index-- : index++) {\r\n if (arr[index].Id === message.Id) {\r\n break;\r\n }\r\n }\r\n\r\n index += (revers ? -1 : 1);\r\n\r\n if (arr.length == 0) {\r\n this.goBack();\r\n return;\r\n } else if (index >= arr.length || index < 0) {\r\n index = 0;\r\n }\r\n model.selectedMessage = arr[index];\r\n this.forceUpdate();\r\n }\r\n\r\n render() {\r\n let moduleCss = this.getModuleCss('messagelognews', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n let { model, isPad } = this.props;\r\n let message = model.selectedMessage;\r\n let isRead = (message.IsRead !== undefined && Boolean.parseBoolean(message.IsRead));\r\n if (!isRead) {\r\n this.props.commService.updateMessageState(message.Id, (d) => {\r\n let data = JSON.parse(d);\r\n if (data.Result.content_result == 1) {\r\n message.IsRead = \"True\";\r\n } else {\r\n console.error('updateMessageState failed.');\r\n }\r\n });\r\n }\r\n\r\n let arr = Object.values(model.messages);\r\n let index = 0;\r\n for (; index <= arr.length - 1; index++) {\r\n if (arr[index].Id === message.Id) {\r\n break;\r\n }\r\n }\r\n let nextDisabled = false;\r\n let prevDisabled = false;\r\n\r\n if (index <= 0) prevDisabled = true;\r\n if (index >= arr.length - 1) nextDisabled = true;\r\n\r\n return
\r\n {!this.props.isPad ? () : ('')}\r\n
\r\n
{message.PublishTime}
\r\n
{message.Title}
\r\n
{message.Content}
\r\n\r\n
\r\n
\r\n
nextDisabled ? false : this.onNextButtonClick.bind(this)(false)}>DialogWindow.Message_Next
\r\n
prevDisabled ? false : this.onNextButtonClick.bind(this)(true)}>DialogWindow.Message_Previous
\r\n
DialogWindow.Delete
\r\n
this.goBack()}>DialogWindow.Exit
\r\n
\r\n\r\n\r\n
\r\n }\r\n}\r\n\r\nclass MessageView extends BaseView {\r\n\r\n componentDidMount() { }\r\n\r\n onItemClick(message) {\r\n this.props.model.selectedMessage = message;\r\n this.goto('/messagedetail');\r\n }\r\n\r\n render() {\r\n let { model, isPad } = this.props;\r\n if (!model || !model.systemSetting) {\r\n this.goto('/');\r\n return '';\r\n }\r\n\r\n let items = []; \r\n Object.values(model.messages).sort((a, b) => (b.PublishTime).localeCompare(a.PublishTime)).forEach((message) => {\r\n items.push();\r\n });\r\n\r\n let moduleCss = this.getModuleCss('messagelognews', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n let mainPaneClass = isPad ? moduleCss.messageMainPane : `${moduleCss.messageMainPane} ${defaultCss.highlightColor}`;\r\n return
\r\n {!this.props.isPad ? () : ('')}\r\n {isPad ? : ''}\r\n
\r\n {items}\r\n
\r\n\r\n {!isPad ?
: ''}\r\n\r\n {this.props.children}\r\n
\r\n }\r\n\r\n\r\n}\r\n\r\n\r\nlet messageView = withRouter(MessageView);\r\nlet messageDetailView = withRouter(MessageDetailView);\r\n\r\nexport { messageView as MessageView, messageDetailView as MessageDetailView };\r\n","import React from 'react';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Trans } from 'react-i18next';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\nimport * as utils from '../../common/utils.js';\r\n\r\nclass LogItemView extends BaseView {\r\n render() {\r\n let moduleCss = this.getModuleCss('messagelognews', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n\r\n // return
\r\n //
{log.title}
\r\n //
{log.content}
\r\n //
\r\n\r\n\r\n let { model, log, isTitle, isPad } = this.props;\r\n let rowStyle = { lineHeight: \"2.5em\" };\r\n if (isPad) rowStyle.minHeight = \"2.5em\";\r\n if (isTitle && model && model.config) {\r\n rowStyle.backgroundColor = model.config.getValue('titleBackgroundColor');\r\n rowStyle.color = model.config.getValue('titleColor');\r\n }\r\n let rowClassName = isPad ? `${moduleCss.padMessageItemMainPane} ${defaultCss.defaultBorderColor}` : `${moduleCss.messageItemMainPane} ${defaultCss.defaultColor}`;\r\n let timeClassName = isPad ? moduleCss.padMessageItemTime : moduleCss.messageItemTime;\r\n let titleClassName = isPad ? moduleCss.padMessageItemTitle : moduleCss.messageItemTitle;\r\n let titleNotify = log && log.titleNotify ? log.titleNotify : '';\r\n if (isPad) {\r\n return
\r\n
{isTitle ? MainListView.Time : log.Time}
\r\n
{isTitle ? MainListView.Action : log.title + ' ' + titleNotify + ' ' + log.content}
\r\n
\r\n } else {\r\n return
\r\n {log.titleNotify ?
{log.titleNotify}
: ''}\r\n
{log.Time}   {log.Time == log.title ? '' : log.title}
\r\n
{log.content}
\r\n
\r\n }\r\n }\r\n}\r\n\r\nclass LogView extends BaseView {\r\n\r\n componentDidMount() { }\r\n\r\n render() {\r\n let { model, isPad } = this.props;\r\n if (!model || !model.systemSetting) {\r\n this.goto('/');\r\n return '';\r\n }\r\n\r\n let items = [];\r\n\r\n if (model.logs) {\r\n let logs = model.logs; //.sort((a, b) => b.Time.localeCompare(a.Time));\r\n logs.forEach((log) => {\r\n items.push();\r\n });\r\n };\r\n\r\n let moduleCss = this.getModuleCss('messagelognews', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n let mainPaneClass = isPad ? moduleCss.messageMainPane : `${moduleCss.messageMainPane} ${defaultCss.highlightColor}`;\r\n return
\r\n {!this.props.isPad ? () : ('')}\r\n\r\n {isPad ? : ''}\r\n
\r\n {items}\r\n
\r\n\r\n {!isPad ?
: ''}\r\n\r\n {this.props.children}\r\n
\r\n }\r\n\r\n}\r\n\r\n\r\nlet logView = withRouter(LogView);\r\nexport { logView as LogView, LogItemView };\r\n","import React from 'react';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Trans } from 'react-i18next';\r\nimport { Input, message as antMessage, Select, DatePicker } from 'antd';\r\n\r\nimport * as utils from '../../common/utils';\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\n\r\nimport colors from './colorpicker.json';\r\n\r\nconst { Option } = Select;\r\n\r\nclass ColorPickerView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n\r\n let items = [];\r\n if (props.value) {\r\n items.push()\r\n }\r\n colors.forEach((item) => {\r\n items.push()\r\n });\r\n\r\n\r\n this.state = { items: items, value: props.value };\r\n }\r\n\r\n componentDidMount() {\r\n\r\n }\r\n\r\n setProp(propName, value) {\r\n let prop = {};\r\n prop[propName] = value;\r\n this.setState(prop);\r\n }\r\n\r\n\r\n render() {\r\n let borderWidth = this.props.borderWidth ? this.props.borderWidth : \"1px\";\r\n let borderStyle = { width: '100%', borderWidth, borderStyle: \"solid\" };\r\n // let borderStyle={width:'100%'};\r\n\r\n return
\r\n \r\n
\r\n }\r\n}\r\n\r\nexport { ColorPickerView };\r\n","import React from 'react';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Trans, withTranslation } from 'react-i18next';\r\n\r\nimport moment from 'moment';\r\nimport { Input, message as antMessage, Select, DatePicker } from 'antd';\r\nimport { FormOutlined } from '@ant-design/icons';\r\n\r\nimport * as utils from '../../common/utils';\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\nimport { ColorPickerView } from './colorpickerview';\r\nimport { PriceAlertCondition } from '../../common/const.js';\r\n\r\nconst { Option } = Select;\r\n\r\nclass PriceAlertEditView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n let { model, isPad } = props;\r\n let alert = props.model.selectedPriceAlert;\r\n\r\n let instrumentSelect = [];\r\n let selectedInstrumentId = undefined;\r\n let price = '';\r\n let condition = alert ? alert.Condition : \"0\";\r\n Object.values(model.instruments).forEach((instrument) => {\r\n if (!selectedInstrumentId && instrument.lastQuotation && instrument.lastQuotation.Bid) {\r\n selectedInstrumentId = instrument.Id;\r\n price = this.getDefaultPrice(instrument, condition);\r\n }\r\n instrumentSelect.push()\r\n });\r\n\r\n this.state = {\r\n instrumentSelect: instrumentSelect,\r\n selectedInstrumentId: (alert ? alert.InstrumentId : selectedInstrumentId),\r\n condition: condition,\r\n price: (alert ? alert.Price : price),\r\n date: (alert ? moment(alert.ExpirationTime, \"YYYY-MM-DD HH:mm:ss\") : model.getServerTime().add(1, 'days')),\r\n color: (alert ? alert.Color : \"red\"),\r\n isChanged: alert ? false : true\r\n };\r\n }\r\n\r\n componentDidMount() { }\r\n\r\n setProp(propName, value) {\r\n if (propName == 'date' && value == null) return;\r\n \r\n let prop = { isChanged: true };\r\n prop[propName] = value;\r\n if (propName === \"selectedInstrumentId\" || propName === 'condition') {\r\n let instrument = this.props.model.instruments[propName === \"selectedInstrumentId\" ? value : this.state.selectedInstrumentId];\r\n if (instrument.lastQuotation) {\r\n // prop[\"price\"] = (this.state.condition <= 1 ? instrument.lastQuotation.Ask : instrument.lastQuotation.Bid);\r\n prop[\"price\"] = this.getDefaultPrice(instrument, propName === 'condition' ? value : this.state.condition);\r\n }\r\n }\r\n this.setState(prop);\r\n }\r\n\r\n getDefaultPrice(instrument, condition) {\r\n let lastPrice = ((condition == PriceAlertCondition.AskGreaterThan || condition == PriceAlertCondition.AskLessthan) ? instrument.lastQuotation.Ask : instrument.lastQuotation.Bid);\r\n let dealingPolicy = instrument.dealingPolicyDetail;\r\n let point = (dealingPolicy == null ? instrument.AcceptLmtVariation : dealingPolicy.AcceptLmtVariation);\r\n if (condition == PriceAlertCondition.AskLessthan || condition == PriceAlertCondition.BidLessThan) {\r\n point = -point;\r\n }\r\n\r\n return utils.formatPrice(parseFloat(lastPrice) + parseFloat(point) / parseFloat(instrument.Denominator), instrument.Denominator);\r\n }\r\n\r\n\r\n onSaveClick() {\r\n let { model, commService, isPad, t } = this.props;\r\n let account = model.selectedAccount;\r\n let quotePolicyId = (account.UseQuotePolicyId ? account.UseQuotePolicyId : account.PublicQuotePolicyId);\r\n let originAlert = model.selectedPriceAlert;\r\n let id = originAlert ? (originAlert.ID ? originAlert.ID : originAlert.Id) : utils.uuid();\r\n let instrument = model.instruments[this.state.selectedInstrumentId];\r\n let newPriceAlert = {\r\n ModifyFlag: originAlert ? \"1\" : \"0\",\r\n ID: id,\r\n Id: id,\r\n UserID: model.loginResult.UserId,\r\n UserId: model.loginResult.UserId,\r\n InstrumentID: this.state.selectedInstrumentId,\r\n InstrumentId: this.state.selectedInstrumentId,\r\n QuotePolicyID: quotePolicyId,\r\n QuotePolicyId: quotePolicyId,\r\n Price: utils.formatPrice(this.state.price, instrument.Denominator),\r\n Condition: this.state.condition,\r\n ExpirationTime: this.state.date.format(\"yyyy-MM-DD\"),\r\n Action: \"0\",\r\n Color: this.state.color,\r\n State: \"0\",\r\n }\r\n\r\n let count = 0;\r\n let hasSamePrice = false;\r\n if (model.priceAlerts) {\r\n Object.values(model.priceAlerts).forEach((priceAlert) => {\r\n if (priceAlert.InstrumentId == this.state.selectedInstrumentId || priceAlert.InstrumentID == this.state.selectedInstrumentId) {\r\n count++;\r\n let existedId = (priceAlert.ID ? priceAlert.ID : priceAlert.Id);\r\n if (existedId != newPriceAlert.Id && priceAlert.Condition == this.state.condition && parseFloat(priceAlert.Price) == parseFloat(this.state.price)) {\r\n hasSamePrice = true;\r\n }\r\n }\r\n });\r\n }\r\n if (hasSamePrice) {\r\n model.showModalDialog(DialogWindow.PriceAlert_SettingIsDuplicated);\r\n return;\r\n }\r\n\r\n if (!originAlert && count >= parseInt(model.settingData.SystemParameter.MaxAlertPricePerInstrument)) {\r\n model.showModalDialog(utils.format2(t('DialogWindow.PriceAlert_MaxAlertPricePerInstrument'), model.settingData.SystemParameter.MaxAlertPricePerInstrument));\r\n return;\r\n }\r\n\r\n let alerts = { PriceAlert: newPriceAlert };\r\n\r\n commService.updatePriceAlerts(utils.convertToXml(alerts, \"PriceAlerts\").toString(), (d) => {\r\n let data = JSON.parse(d);\r\n if (data.Result && data.Result.content_result && data.Result.content_result === 'true') {\r\n model.priceAlerts[alerts.PriceAlert.ID] = alerts.PriceAlert;\r\n if (isPad) {\r\n this.props.onClose();\r\n } else {\r\n this.goBack();\r\n }\r\n } else {\r\n antMessage.info(d);\r\n }\r\n\r\n });\r\n\r\n }\r\n\r\n onDeleteClick() {\r\n let { model, commService, isPad } = this.props;\r\n let originAlert = model.selectedPriceAlert;\r\n if (originAlert) {\r\n\r\n let alerts = {\r\n PriceAlert: {\r\n ModifyFlag: \"2\",\r\n ID: originAlert.Id,\r\n UserID: model.loginResult.UserId\r\n }\r\n };\r\n\r\n commService.updatePriceAlerts(utils.convertToXml(alerts, \"PriceAlerts\").toString(), (d) => {\r\n let data = JSON.parse(d);\r\n if (data.Result && data.Result.content_result && data.Result.content_result === 'true') {\r\n delete model.priceAlerts[alerts.PriceAlert.ID];\r\n\r\n if (isPad) {\r\n this.props.onClose();\r\n } else {\r\n this.goBack();\r\n }\r\n\r\n } else {\r\n antMessage.info(d);\r\n }\r\n });\r\n }\r\n }\r\n\r\n getDisabledDate(current) {\r\n return current <= this.props.model.getServerTime();\r\n }\r\n\r\n render() {\r\n let { model, isPad } = this.props;\r\n if (!model || !model.systemSetting) {\r\n this.goto('/');\r\n return '';\r\n }\r\n\r\n let moduleCss = this.getModuleCss('pricealert', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n let originPriceAlert = model.selectedPriceAlert;\r\n let inputClass = isPad ? `${moduleCss.editRowInput}` : `${defaultCss.defaultColor} ${defaultCss.defaultBorderColor} ${moduleCss.editRowInput}`;\r\n let mainPainClass = isPad ? moduleCss.mainPane : `${moduleCss.mainPane} ${defaultCss.defaultColor}`;\r\n let canSave = (this.state.isChanged && this.state.selectedInstrumentId && this.state.date && this.state.color && this.state.price && this.state.condition !== undefined);\r\n\r\n let saveButtonClass = (canSave ? `${moduleCss.addButton} ${defaultCss.defaultButtonColor}` : `${moduleCss.addButton} ${defaultCss.disabledColor}`);\r\n return
\r\n {!this.props.isPad ? () : ('')}\r\n\r\n
\r\n
\r\n
MainView.Instrument
\r\n \r\n
\r\n\r\n
\r\n
DialogWindow.Condition
\r\n \r\n
\r\n\r\n
\r\n
DialogWindow.Price
\r\n this.setProp('price', e.target.value)} />\r\n
\r\n\r\n\r\n
\r\n
DialogWindow.ExpirationTime
\r\n
\r\n this.setProp('date', date)} />\r\n
\r\n
\r\n\r\n\r\n
\r\n
DialogWindow.Color
\r\n this.setProp(\"color\", value)} />\r\n\r\n
\r\n\r\n
\r\n\r\n
\r\n \r\n {!originPriceAlert ? '' : }\r\n
\r\n {this.props.children}\r\n
\r\n }\r\n}\r\n\r\n\r\nclass PriceAlertItemView extends BaseView {\r\n render() {\r\n let moduleCss = this.getModuleCss('pricealert', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n let { model, priceAlert, isTitle, isPad } = this.props;\r\n //let rowStyle = (isTitle ? { fontWeight: \"bolder\" } : {});\r\n let rowStyle = { height: \"2.5em\", lineHeight: \"2.5em\" };\r\n if (isTitle && model && model.config) {\r\n rowStyle.backgroundColor = model.config.getValue('titleBackgroundColor');\r\n rowStyle.color = model.config.getValue('titleColor');\r\n }\r\n let rowClassName = isPad ? `${moduleCss.priceAlertRow} ${defaultCss.defaultBorderColor}` : `${moduleCss.priceAlertRow} ${defaultCss.defaultColor}`;\r\n\r\n let instrument = {}\r\n let condition = '';\r\n if (!isTitle) {\r\n instrument = model.instruments[priceAlert.InstrumentId];\r\n switch (parseInt(priceAlert.Condition)) {\r\n case 0:\r\n condition = DialogWindow.Bid<;\r\n break;\r\n case 1:\r\n condition = DialogWindow.Bid>;\r\n break;\r\n case 2:\r\n condition = DialogWindow.Ask<;\r\n break;\r\n case 3:\r\n condition = DialogWindow.Ask>;\r\n break;\r\n default:\r\n }\r\n }\r\n\r\n return
{ if (!isPad && !isTitle) this.props.onEditClick() }}>\r\n {isPad ?
{ if (isPad) this.props.onEditClick() }}>{isTitle ? DialogWindow.Modify : }
: ''}\r\n
{isTitle ? MainView.Instrument : instrument.Description}
\r\n
{isTitle ? DialogWindow.Condition : condition}
\r\n
{isTitle ? DialogWindow.Price : priceAlert.Price}
\r\n
{isTitle ? DialogWindow.ExpirationTime : priceAlert.ExpirationTime.substring(0, 10)}
\r\n
{isTitle ? DialogWindow.Color : \"\"}
\r\n
\r\n\r\n }\r\n}\r\n\r\nclass PriceAlertView extends BaseView {\r\n\r\n componentDidMount() { }\r\n\r\n onAddClick() {\r\n debugger;\r\n this.props.model.selectedPriceAlert = undefined;\r\n this.goto('/pricealertedit');\r\n }\r\n\r\n onEditClick(priceAlert) {\r\n this.props.model.selectedPriceAlert = priceAlert;\r\n this.goto('/pricealertedit');\r\n }\r\n\r\n render() {\r\n let { model, isPad } = this.props;\r\n if (!model || !model.systemSetting) {\r\n this.goto('/');\r\n return '';\r\n }\r\n\r\n let items = [];\r\n // items.push();\r\n if (model.priceAlerts) {\r\n Object.values(model.priceAlerts).forEach((priceAlert) => {\r\n items.push( this.onEditClick.bind(this)(priceAlert)} priceAlert={priceAlert} />);\r\n });\r\n }\r\n\r\n let moduleCss = this.getModuleCss('pricealert', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n let mainPaneClass = isPad ? moduleCss.mainPane : `${moduleCss.mainPane} ${defaultCss.highlightColor}`;\r\n\r\n let itemTableStyle = isPad ? { borderRightWidth: '1px', borderRightStyle: 'solid', display: 'inline-block', height: 'calc(100% - 6px)', width: 'calc(100% - 15em)', overflow: \"auto\" } : { height: \"calc(100% - 7em)\", overflow: \"auto\" };\r\n let addButtonStyle = isPad ? { display: 'inline-block', height: 'calc(100% - 6px)', width: '15em', textAlign: 'center' } : { textAlign: 'center' };\r\n return
\r\n {!this.props.isPad ? () : ('')}\r\n\r\n
\r\n \r\n
\r\n {items}\r\n
\r\n
\r\n\r\n\r\n
DialogWindow.Add
\r\n
\r\n }\r\n\r\n}\r\n\r\nlet priceAlertView = withRouter(PriceAlertView);\r\nlet priceAlertEditView = withTranslation()(withRouter(PriceAlertEditView));\r\n\r\nexport { priceAlertView as PriceAlertView, priceAlertEditView as PriceAlertEditView };\r\n","import React from 'react';\r\n// import { Board } from './board';\r\nimport { Breakpoint } from 'react-socks';\r\nimport { HashRouter as Router, Switch, Route } from \"react-router-dom\";\r\nimport { withTranslation, Trans } from 'react-i18next';\r\nimport { message as antMessage, Spin, Radio, Button } from 'antd';\r\nimport { CloseOutlined } from '@ant-design/icons';\r\n\r\nimport * as utils from '../common/utils.js';\r\nimport { OrderType } from '../common/const';\r\n\r\nimport BaseView from \"./baseview.js\";\r\n\r\nimport PlacingDqView from './placing/placingdqview';\r\nimport PlacingPendingView from './placing/placingpendingview';\r\nimport CloseOrderView from './openposition/closeorderview.js';\r\n\r\nimport { OpenPositionView, OpenPositionSumView } from './openposition/openpositionview';\r\n\r\nimport WorkingListView from './placing/workinglistview';\r\n\r\nimport OrderQueryView from './orderquery/orderqueryview.js';\r\nimport OrderQueryResultView from './orderquery/orderqueryresultview.js';\r\nimport PadStockView from './physical/padstockview';\r\nimport TodayExecuteView from './orderquery/todayexecuteview.js';\r\nimport { MessageView } from './messagelognews/messageview';\r\nimport { LogView } from './messagelognews/logview';\r\nimport { PriceAlertView, PriceAlertEditView } from '../view/setting/pricealertview';\r\n\r\nconst PlacePanelType = { None: 0, WorkingList: 1, PendingList: 2, SpotTrade: 3, PendingOrder: 4 };\r\nconst CloseOrderViewComponent = withTranslation()(CloseOrderView);\r\nconst PlacingDqViewComponent = withTranslation()(PlacingDqView);\r\n\r\nclass PadBottomTabView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = { bottomTabType: \"OpenPositionView\", prevBottomTabType: \"OpenPositionView\" };\r\n //this.state = {};\r\n }\r\n\r\n componentDidMount() {\r\n if (this.props.onSubComponentLoad) {\r\n this.props.onSubComponentLoad(\"padBottomTabView\", this);\r\n }\r\n let { model } = this.props;\r\n // this.setState({ hasPhysicalInstruments: model.hasPhysicalInstruments(), hasForexInstruments: model.hasForexInstruments() });\r\n console.log('PadBottomTabView.componentDidMount');\r\n delete this.isBuy;\r\n delete this.instrumentId;\r\n }\r\n\r\n onSubComponentLoad(name, comp) {\r\n let prop = {};\r\n prop[name] = comp;\r\n this.setState(prop);\r\n if (this.props.onSubComponentLoad) {\r\n this.props.onSubComponentLoad(name, comp);\r\n }\r\n }\r\n\r\n onCloseOrderClick() {\r\n // let instrument = this.props.model.placingData.selectedInstrument;\r\n // if (instrument.openPositions) {\r\n // let openPositions = Object.values(instrument.openPositions);\r\n // openPositions.forEach((order, index) => {\r\n // //if(Boolean.parseBoolean(order.IsBuy) === !this.props.isBuy ){\r\n // order.selectedLot = parseFloat(order.LotBalance);\r\n // //}\r\n // });\r\n\r\n // let orderTypes = instrument.getAvailableOrderTypes();\r\n // let isMarket = orderTypes.indexOf(OrderType.Market) >= 0;\r\n // let orderType = this.state.orderType;\r\n // if (isMarket && orderType === OrderType.SpotTrade) {\r\n // orderType = OrderType.Market;\r\n // }\r\n\r\n // this.props.model.placingData.orderType = orderType;\r\n // this.props.history.push('/closeorder');\r\n // }\r\n }\r\n\r\n onBuySellButtonClick(isBuy) {\r\n let { model, commService } = this.props;\r\n if (isBuy != this.isBuy || this.instrumentId != model.placingData.selectedInstrument.Id) {\r\n\r\n if (!model.placingData.selectedOrders || model.placingData.selectedOrders.length <= 0) {\r\n model.placingData.orderingNotifyId = utils.uuid();\r\n model.orderingNotify(model.placingData.orderingNotifyId, model.customer.Code, model.placingData.selectedInstrument.Code, isBuy.toString(), true, '1', (d) => {\r\n debugger;\r\n });\r\n }\r\n }\r\n this.isBuy = isBuy;\r\n this.instrumentId = model.placingData.selectedInstrument.Id;\r\n\r\n\r\n // if (model.placingData.isBuy === isBuy) return;\r\n\r\n this.props.model.placingData.isBuy = isBuy;\r\n let instrument = model.placingData.selectedInstrument;\r\n\r\n let canPlaceOrderSpot = model.canPlaceOrder(model.selectedAccount, instrument, OrderType.SpotTrade);\r\n let canPlaceOrderMarket = model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Market);\r\n let canPlaceOrderLimit = model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Limit);\r\n let canPlaceOrder = canPlaceOrderSpot || canPlaceOrderMarket || canPlaceOrderLimit;\r\n\r\n if (canPlaceOrder) {\r\n\r\n let orderType = this.props.model.placingData.orderType === undefined ? OrderType.SpotTrade : this.props.model.placingData.orderType;\r\n // let orderType = canPlaceOrderSpot ? OrderType.SpotTrade : (canPlaceOrderMarket ? OrderType.Market : OrderType.Limit);\r\n\r\n this.resetInput();\r\n // this.changeViewType(orderType);\r\n this.onOrderTypeChange(orderType); // not reset ui\r\n }\r\n this.forceUpdate();\r\n }\r\n\r\n onPlacingDqViewCloseSubmit() {\r\n this.state.closeOrderView.onSubmitClick();\r\n }\r\n\r\n onPlacingPendingViewCloseSubmit(limitPrice, stopPrice) {\r\n this.state.closeOrderView.onSubmitClick(limitPrice, stopPrice);\r\n }\r\n\r\n resetInput(props, isConstructor) {\r\n console.log(\"PadBottomTabView.resetInput\");\r\n let { model } = this.props;\r\n if (model.instruments) {\r\n Object.values(model.instruments).forEach((instrument) => {\r\n if (instrument.orders) {\r\n Object.values(instrument.orders).forEach((order) => {\r\n order.isSelected = false;\r\n order.selectedLot = order.allowedCloseLot = model.getMaxCloseLot(instrument, order); //parseFloat(order.LotBalance);\r\n });\r\n }\r\n });\r\n }\r\n\r\n model.closeLot = 0;\r\n\r\n if (this.state.placingDqView) {\r\n this.state.placingDqView.resetInput();\r\n }\r\n\r\n if (this.state.placingPendingView) {\r\n this.state.placingPendingView.resetInput();\r\n }\r\n\r\n if (this.state.closeOrderView) {\r\n this.state.closeOrderView.refreshOpenOrderLot();\r\n }\r\n // delete this.props.model.placingData.isBuy;\r\n }\r\n\r\n onOrderTypeChange(orderType) {\r\n let { model } = this.props;\r\n\r\n model.placingData.orderType = orderType;\r\n this.resetInput();\r\n // this.setState({ orderType: orderType, showPlacePanel: orderType === OrderType.Limit ? PlacePanelType.PendingOrder : PlacePanelType.SpotTrade }); \r\n this.setState({ bottomTabType: orderType.toString() });\r\n if (this.state.closeOrderView) {\r\n this.state.closeOrderView.refreshOpenOrderLot(undefined, false);\r\n }\r\n this.forceUpdate();\r\n }\r\n\r\n onConfirmClosed(isConfirmed, orderType) {\r\n // this.setState({ showPlacePanel: isConfirmed ? PlacePanelType.None : placePanelType });\r\n console.log('PadBottomTabView.onConfirmClosed', isConfirmed, orderType);\r\n if (isConfirmed) {\r\n // this.resetInput();\r\n // let orderType = this.props.model.placingData.orderType === undefined ? OrderType.SpotTrade : this.props.model.placingData.orderType;\r\n // let orderType = canPlaceOrderSpot ? OrderType.SpotTrade : (canPlaceOrderMarket ? OrderType.Market : OrderType.Limit);\r\n\r\n // this.resetInput();\r\n // this.changeViewType(orderType);\r\n // this.onOrderTypeChange(orderType); // not reset ui\r\n\r\n // this.onBuySellButtonClick(!this.props.model.placingData.isBuy);\r\n this.onBuySellButtonClick(this.props.model.placingData.isBuy);\r\n }\r\n }\r\n\r\n getBottomWorkingTab(bottomTabType) {\r\n let { model, commService } = this.props;\r\n\r\n if (!model || !model.isTradingDataLoaded) {\r\n return null;\r\n }\r\n\r\n if (!bottomTabType) {\r\n bottomTabType = this.state.bottomTabType;\r\n }\r\n\r\n let result = [];\r\n let moduleCss = this.getModuleCss('app');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n if (bottomTabType === \"OpenPositionView\") {\r\n result.push( );\r\n // result.push();\r\n } else if (bottomTabType === \"WorkingListView\") {\r\n result.push( { }} />);\r\n // result.push();\r\n } else if (bottomTabType === \"OpenPositionSumView\") {\r\n result.push( { }} />);\r\n // result.push();\r\n } else if (bottomTabType === \"OrderQueryView\") {\r\n result.push( );\r\n } else if (bottomTabType === \"OrderQueryResultView\") {\r\n result.push( );\r\n } else if (bottomTabType === \"PadStockView\") {\r\n result.push( );\r\n } else if (bottomTabType === OrderType.SpotTrade.toString() || bottomTabType === OrderType.Market.toString() || bottomTabType === OrderType.Limit.toString()) {\r\n let tradingView = null;\r\n if (bottomTabType === OrderType.SpotTrade.toString() || bottomTabType === OrderType.Market.toString()) {\r\n\r\n tradingView = { this.changeViewType.bind(this)(this.state.prevBottomTabType == OrderType.SpotTrade.toString() ? 'OpenPositionView' : this.state.prevBottomTabType) }} onConfirmClosed={(isConfirmed) => this.onConfirmClosed(isConfirmed, OrderType.SpotTrade.toString())} onRoutePathChange={this.props.onRoutePathChange} />;\r\n }\r\n else if (bottomTabType === OrderType.Limit.toString()) {\r\n tradingView = { if (this.state.closeOrderView) this.state.closeOrderView.refreshOpenOrderLot(); this.props.forceUpdate() }} model={this.props.model} commService={this.props.commService} closeLot={this.state.closeLot} onSubComponentLoad={this.onSubComponentLoad.bind(this)} isBuy={this.props.model.placingData.isBuy} onCloseOrderClick={this.onCloseOrderClick.bind(this)} onOrderTypeChange={this.onOrderTypeChange.bind(this)} onSubmit={this.onPlacingPendingViewCloseSubmit.bind(this)} onClosePaneClick={() => { this.changeViewType.bind(this)(this.state.prevBottomTabType == OrderType.Limit.toString() ? 'OpenPositionView' : this.state.prevBottomTabType) }} onConfirmClosed={(isConfirmed) => this.onConfirmClosed(isConfirmed, OrderType.Limit.toString())} onRoutePathChange={this.props.onRoutePathChange} />;\r\n }\r\n let closeOrderView = this.onConfirmClosed(isConfirmed, OrderType.Limit.toString())} onClosePaneClick={() => { this.isBuy = undefined; this.changeViewType.bind(this)(this.state.prevBottomTabType == OrderType.SpotTrade.toString() ? 'OpenPositionView' : this.state.prevBottomTabType) }} >;\r\n //let style = { width: \"calc(50% - 2px)\", display: \"inline-block\", height: \"100%\", overflow: \"auto\" }; \r\n result.push(
{tradingView}
{closeOrderView}
);\r\n } else if (bottomTabType === \"MessageView\") {\r\n result.push( );\r\n } else if (bottomTabType === \"LogView\") {\r\n result.push( );\r\n } else if (bottomTabType === \"PriceAlertView\") {\r\n result.push( );\r\n } else {\r\n console.log(\"getBottomWorkingTab error\");\r\n }\r\n\r\n return result;\r\n }\r\n\r\n onOrderSelectChanged(lot) {\r\n // this.setState({ closeLot: lot });\r\n this.props.model.closeLot = lot;\r\n this.forceUpdate();\r\n }\r\n\r\n changeViewType(viewType) {\r\n if (this.props.isPad && viewType.toLowerCase() == 'pendingorderview') {\r\n this.props.onRoutePathChange('pendingorderview');\r\n } else if (this.state.bottomTabType != viewType) {\r\n // window.setTimeout(() => this.setState({ bottomTabType: viewType }), 10000);\r\n console.log('padBottomTabView.changeViewType', viewType);\r\n let prevBottomTabType = this.state.bottomTabType;\r\n this.setState({ bottomTabType: viewType, tab: this.getBottomWorkingTab(viewType), prevBottomTabType: viewType });\r\n }\r\n }\r\n\r\n getItemClass(bottomTabType) {\r\n let moduleCss = this.getModuleCss('app');\r\n let defaultCss = this.getModuleCss('default');\r\n if (bottomTabType == this.state.bottomTabType) {\r\n return `${moduleCss.padBottomTabTitleItem} ${defaultCss.defaultBorderColor} ${defaultCss.bottomActiveItem} `;\r\n } else {\r\n return `${moduleCss.padBottomTabTitleItem} ${defaultCss.defaultBorderColor}`;\r\n }\r\n\r\n }\r\n\r\n render() {\r\n // console.log('PadBottomTabView.render()');\r\n\r\n let moduleCss = this.getModuleCss('app');\r\n let defaultCss = this.getModuleCss('default');\r\n let { model } = this.props;\r\n\r\n let instrument = (model && model.placingData ? model.placingData.selectedInstrument : undefined);\r\n if (!instrument) return '';\r\n let quotation = (instrument.quotation ? instrument.quotation : {});\r\n let dealingPolicy = instrument.dealingPolicyDetail;\r\n let maxDqLot = parseFloat(utils.isEmpty(dealingPolicy) ? instrument.MaxDQLot : dealingPolicy.MaxDQLot);\r\n let maxOtherLot = parseFloat(utils.isEmpty(dealingPolicy) ? instrument.MaxOtherLot : dealingPolicy.MaxOtherLot);\r\n\r\n let isTradingDataLoaded = (model && model.isTradingDataLoaded);\r\n let isPlacingView = this.state.bottomTabType === OrderType.Market.toString() || this.state.bottomTabType === OrderType.SpotTrade.toString() || this.state.bottomTabType === OrderType.Limit.toString();\r\n\r\n let tabTitle = null;\r\n let closeButton = null;\r\n let showLog = (!model.settingData ? false : Boolean.parseBoolean(model.customer.ShowLog));\r\n let isNoShowAccountStatus = utils.parseBoolean(this.props.model.customer.IsNoShowAccountStatus);\r\n let titleStyle = { borderLeftWidth: '1px', borderLeftStyle: 'solid' };\r\n if (model && model.config) {\r\n titleStyle.backgroundColor = model.config.getValue('titleBackgroundColor');\r\n titleStyle.color = model.config.getValue('titleColor');\r\n }\r\n\r\n let hasPhysicalInstruments = model.hasPhysicalInstruments();\r\n let hasForexInstruments = model.hasForexInstruments();\r\n // let itemClass = `${moduleCss.padBottomTabTitleItem} ${defaultCss.defaultBorderColor}`;\r\n if (!isPlacingView) {\r\n tabTitle =
\r\n {/* { this.changeViewType(e.target.value); }}>\r\n {isNoShowAccountStatus ? '' : MainView.OpenOrderTitle}\r\n {isNoShowAccountStatus ? '' : PageWindow.WorkingOrderTitle}\r\n {hasPhysicalInstruments ? PageWindow.PhysicalTitle : ''}\r\n {isNoShowAccountStatus ? '' : MainView.OrderQueryTitle}\r\n {showLog ? MainView.LogMenuName : ''}\r\n MainView.MessageMenuName\r\n DialogWindow.PriceAlert\r\n */}\r\n\r\n {isNoShowAccountStatus || !hasForexInstruments ? '' :
this.changeViewType('OpenPositionView')} > MainView.OpenOrderTitle
}\r\n {isNoShowAccountStatus ? '' :
this.changeViewType('WorkingListView')} > PageWindow.WorkingOrderTitle
}\r\n {isNoShowAccountStatus || !hasForexInstruments ? '' :
this.changeViewType('OpenPositionSumView')} > PageWindow.PositionTitle
}\r\n {!hasPhysicalInstruments ? '' :
this.changeViewType('PadStockView')}> PageWindow.PhysicalTitle
}\r\n {isNoShowAccountStatus ? '' :
this.changeViewType('OrderQueryView')} > MainView.OrderQueryTitle
}\r\n {!showLog ? '' :
this.changeViewType('LogView')} > MainView.LogMenuName
}\r\n
this.changeViewType('MessageView')} > MainView.MessageMenuName
\r\n
this.changeViewType('PriceAlertView')} > DialogWindow.PriceAlert
\r\n\r\n
;\r\n }\r\n\r\n if (this.state.bottomTabType === OrderType.Market.toString() || this.state.bottomTabType === OrderType.SpotTrade.toString() || this.state.bottomTabType === OrderType.Limit.toString()) {\r\n closeButton = this.changeViewType.bind(this)(this.state.prevBottomTabType)} />;\r\n }\r\n\r\n let canPlaceOrder = model.canPlaceOrder(model.selectedAccount, instrument, OrderType.SpotTrade)\r\n || model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Market)\r\n || model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Limit);\r\n\r\n let buyButtonColor = (canPlaceOrder && (model.placingData && model.placingData.isBuy === true)) ? moduleCss.buyColor : defaultCss.defaultColor;\r\n let sellButtonColor = (canPlaceOrder && (model.placingData && model.placingData.isBuy !== true)) ? moduleCss.sellColor : defaultCss.defaultColor;\r\n let buyTextStyle = { width: '4em', textAlign: 'left', paddingTop: '0', paddingLeft: '1em' };\r\n let priceStyle = { textAlign: 'center', paddingTop: '0', fontSize: \"1.8em\", fontFamily: \"auto\" };\r\n let subContainerStyle = isPlacingView ? { height: 'calc(100% - 4.5em)' } : {};\r\n\r\n return
\r\n\r\n
\r\n {/*
\r\n {closeButton} \r\n
*/}\r\n\r\n\r\n
{ model.placingData.selectedOrders = undefined; this.onBuySellButtonClick.bind(this)(false) }} >
MainView.Sell {quotation.Bid}
\r\n
{ model.placingData.selectedOrders = undefined; this.onBuySellButtonClick.bind(this)(true) }} >
MainView.Buy {quotation.Ask}
\r\n\r\n\r\n
\r\n
\r\n {this.getBottomWorkingTab()}\r\n
\r\n\r\n {tabTitle}\r\n\r\n
;\r\n }\r\n\r\n\r\n}\r\n\r\nexport { PadBottomTabView };","import React from 'react';\r\n\r\n// import ReactDOM from 'react-dom';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport i18n from 'i18next';\r\nimport { Translation, Trans } from 'react-i18next';\r\n\r\nimport { Button, message as antMessage, Checkbox } from 'antd';\r\n\r\nimport { CaretDownFilled, CaretRightOutlined } from '@ant-design/icons';\r\n\r\nimport BaseView from \"./baseview.js\";\r\nimport TitleBarView from './titlebarview';\r\n\r\nimport languageName from '../locale/mutilanguagesconfig.json';\r\nimport * as utils from '../common/utils.js';\r\nimport { CooKey } from \"../common/const.js\";\r\n\r\nclass LoginView extends BaseView {\r\n\r\n constructor(props) {\r\n console.log('LoginView.ctor');\r\n super(props);\r\n let userName = utils.loadCookie(CooKey.LoginName);\r\n let password = utils.loadCookie(CooKey.LoginPassword);\r\n let savePassword = !utils.isEmpty(password);\r\n this.state = {\r\n userName: userName,\r\n savePassword: savePassword,\r\n password: password\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n const { onRef } = this.props;\r\n if (onRef) {\r\n onRef(this);\r\n }\r\n\r\n let password = utils.loadCookie(CooKey.LoginPassword);\r\n this.setState({ password: password });\r\n }\r\n\r\n switchLanguage() {\r\n switch (i18n.language) {\r\n case 'en':\r\n return 'zh_cn';\r\n case 'zh_cn':\r\n return 'zh_tw'\r\n default:\r\n return 'en';\r\n }\r\n\r\n }\r\n\r\n getLanguageName() {\r\n switch (i18n.language) {\r\n case 'zh_tw':\r\n return languageName.zh_tw;\r\n case 'zh_cn':\r\n return languageName.zh_cn;\r\n default:\r\n return languageName.en;\r\n }\r\n }\r\n\r\n getLoginLanguage() {\r\n switch (i18n.language) {\r\n case 'zh_tw':\r\n return 'cht';\r\n case 'zh_cn':\r\n return 'chs';\r\n default:\r\n return 'eng';\r\n }\r\n }\r\n\r\n getRegistAccountLanguage() {\r\n switch (i18n.language) {\r\n case 'zh_tw':\r\n return 'zh-CHT';\r\n case 'zh_cn':\r\n return 'zh-CHS';\r\n default:\r\n return 'en';\r\n }\r\n }\r\n\r\n onUserNameChanged(e) {\r\n if (this.props.isPad) {\r\n this.setState({ userName: e.target.value, password: '' });\r\n } else {\r\n this.setState({ userName: e.target.value });\r\n }\r\n }\r\n\r\n onPasswordChanged(e) {\r\n this.setState({ password: e.target.value });\r\n }\r\n\r\n onLoginButtonClick() {\r\n // this.props.commService.sendMessage('SendMessage', '', 'quotation', 'dd');\r\n // debugger;\r\n let { model } = this.props;\r\n let isHideAgreement = utils.parseBoolean(model.config.getValue('isHideAgreement', 'false'));\r\n if (isHideAgreement || this.state.iAgreeChecked) {\r\n\r\n if (utils.isEmpty(this.state.userName)) {\r\n antMessage.destroy();\r\n antMessage.info(Login.Login name can not empty!);\r\n return;\r\n } else if (utils.isEmpty(this.state.password)) {\r\n antMessage.destroy();\r\n antMessage.info(Login.Password can not empty!);\r\n return;\r\n }\r\n // if (this.state.userName && this.state.password) \r\n else {\r\n // this.props.commService.initHub(()=> { \r\n if (model) model.isTradingDataLoaded = false;\r\n this.props.commService.login(this.state.userName, this.state.password, model.config.getValue('demoPath'), this.getLoginLanguage(), false);\r\n // );\r\n }\r\n\r\n utils.saveCookie(CooKey.LoginName, this.state.userName);\r\n if (this.state.savePassword) {\r\n utils.saveCookie(CooKey.LoginPassword, this.state.password);\r\n } else {\r\n utils.removeCookie(CooKey.LoginPassword);\r\n }\r\n }\r\n }\r\n\r\n onLoginSuccess() {\r\n this.goto('/');\r\n }\r\n\r\n gotoFrameWindow(url, title) {\r\n // this.props.model.iframeUrl = url;\r\n // this.props.model.iframeTitle = title;\r\n // this.props.onRoutePathChange('framewindow');\r\n this.props.gotoFrameWindow(url, title);\r\n }\r\n\r\n onIAgreeClick() {\r\n let { model, t, commService } = this.props;\r\n console.log('onIAgreeClick');\r\n\r\n // this.props.model.iframeUrl = \"https://cn.bing.com\";\r\n // this.props.model.iframeTitle = \"test\";\r\n // this.props.onRoutePathChange('framewindow');\r\n let url = './locale/Agreement.{1}.html';\r\n\r\n if (model && model.config) {\r\n url = model.config.getValue('agreementUrl', url);\r\n }\r\n\r\n url = utils.format(url, window.location.origin, this.getLoginLanguage());\r\n\r\n let options = {\r\n contentType: 'url',\r\n hideCancelButton: false,\r\n modelDialogWidth: 800,\r\n contentStyle: { height: '70vh' },\r\n //closable: false,\r\n okText: DialogWindow.Agree,\r\n cancelText: DialogWindow.Reject,\r\n cancelCallback: () => this.setState({ iAgreeChecked: false })\r\n };\r\n\r\n model.showModalDialog(url, () => this.setState({ iAgreeChecked: true }), options);\r\n\r\n\r\n // let options = {\r\n // contentType: 'html',\r\n // hideCancelButton: false,\r\n // //closable: false,\r\n // okText: DialogWindow.Agree,\r\n // cancelText: DialogWindow.Reject,\r\n // cancelCallback: () => this.setState({ iAgreeChecked: false })\r\n // };\r\n\r\n // model.showModalDialog(t('Login.Statements'), () => this.setState({ iAgreeChecked: true }), options);\r\n }\r\n\r\n render() {\r\n if (!this.props.commService) {\r\n this.goto('/');\r\n return '';\r\n }\r\n\r\n let moduleCss = this.getModuleCss('login', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n const { t, hideTitle, isPad, commService, model } = this.props;\r\n let config = model && model.config ? model.config : commService.state.config;\r\n \r\n let registerAccountUrl = config ? config.getValue('registerAccountUrl') : '';\r\n if (!utils.isEmpty(registerAccountUrl)) {\r\n registerAccountUrl += (\"&culture=\" + this.getRegistAccountLanguage());\r\n }\r\n let forgotPasswordUrl = config ? config.getValue('forgotPasswordUrl') : '';\r\n if (!utils.isEmpty(forgotPasswordUrl)) {\r\n forgotPasswordUrl += (\"&language=\" + this.getLoginLanguage().toUpperCase());\r\n }\r\n\r\n let addToHomeScreenUrl = config ? config.getValue('addToHomeScreen') : '';\r\n if (!utils.isEmpty(addToHomeScreenUrl)) {\r\n addToHomeScreenUrl += (\"?culture=\" + this.getRegistAccountLanguage());\r\n }\r\n\r\n let frameLinkButtonStyle = { display: 'inline-block', textDecoration: \"underline\" };\r\n\r\n let isHideAgreement = config ? utils.parseBoolean(config.getValue('isHideAgreement', 'false')) : 'false';\r\n let loginButtonClass = `${moduleCss.loginButton} ${defaultCss.defaultButtonColor} ${defaultCss.defaultBorderColor}`;\r\n if (!isHideAgreement && !this.state.iAgreeChecked) {\r\n loginButtonClass = `${moduleCss.loginButton} ${defaultCss.disabledColor} ${defaultCss.defaultBorderColor}`;\r\n }\r\n\r\n\r\n return
\r\n {hideTitle ? '' : }\r\n
\r\n\r\n
\r\n \r\n {t => }\r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n this.setState({ savePassword: e.target.checked })}>{this.state.savePassword ? 'Login.SavePassworded' : 'Login.SavePassword'}\r\n
\r\n\r\n


\r\n {isHideAgreement ? '' :
this.setState({ iAgreeChecked: e.target.checked })} >
{ this.setState({ iAgreeChecked: !this.state.iAgreeChecked }); this.onIAgreeClick.bind(this)() }} dangerouslySetInnerHTML={{ __html: t('Login.Agreed') }} />
}\r\n\r\n
{t('MainView.LoginOrAccountOpening')}
\r\n\r\n
\r\n\r\n
\r\n {utils.isEmpty(registerAccountUrl) ? '' : }\r\n {utils.isEmpty(forgotPasswordUrl) ? '' : }\r\n {utils.isEmpty(addToHomeScreenUrl) ? '' : }\r\n\r\n
\r\n\r\n {this.props.children}\r\n
\r\n
\r\n }\r\n\r\n}\r\n\r\n\r\nexport default withRouter(LoginView);\r\n","import React from 'react';\r\nimport i18n from 'i18next';\r\nimport { Trans } from 'react-i18next';\r\nimport { CaretRightOutlined, CaretDownOutlined } from '@ant-design/icons';\r\n\r\nimport * as utils from '../../common/utils.js';\r\nimport BaseView from \"../baseview.js\";\r\n\r\nexport default class BalanceView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = {};\r\n }\r\n\r\n componentDidMount() {\r\n console.log(\"BalanceView.componentDidMount\");\r\n }\r\n\r\n\r\n isLoggedIn() {\r\n let { model } = this.props;\r\n return model && model.loginResult; // && model.loginResult.isLogedin;\r\n }\r\n\r\n getFundRows(type) {\r\n if (utils.parseBoolean(this.props.model.customer.IsNoShowAccountStatus)) {\r\n if (type != 'balance')\r\n return '';\r\n }\r\n\r\n let { model, isPad } = this.props;\r\n let result = [];\r\n // let moduleCss = this.state.moduleCss; // getModuleCss('accountbriefview', 'common');\r\n let moduleCss = this.getModuleCss('accountbriefview', 'common');\r\n // let defaultCss = this.getModuleCss('default');\r\n\r\n let account = model.selectedAccount;\r\n if (Boolean.parseBoolean(account.IsMultiCurrency)) {\r\n Object.values(account.funds).forEach((item, index) => {\r\n let currency = model.currencies[item.CurrencyID];\r\n\r\n let currencyName = currency.Name;\r\n if (!utils.isEmpty(currency.Alias) && (i18n.language === 'zh_tw' || i18n.language === 'zh_cn')) {\r\n currencyName = currency.Alias;\r\n }\r\n currencyName = (utils.isEmpty(currencyName) ? currency.Code : currencyName);\r\n\r\n if (type === 'balance' && this.state.balanceVisible) {\r\n let balance = parseFloat(item.Balance);\r\n if (balance) {\r\n result.push(this.getFundRow(moduleCss, undefined, '', currencyName, utils.formatNumber(balance, currency.Decimals)));\r\n }\r\n } else if (type === 'necessary' && this.state.necessaryVisible) {\r\n if (item.Necessary) {\r\n result.push(this.getFundRow(moduleCss, undefined, '', currencyName, utils.formatNumber(parseFloat(item.Necessary), currency.Decimals)));\r\n }\r\n\r\n } else if (type === 'floating' && this.state.floatingVisible) {\r\n let floating = parseFloat(item.TradePLFloat + item.InterestPLFloat + item.StoragePLFloat);\r\n if (floating) {\r\n result.push(this.getFundRow(moduleCss, undefined, '', currencyName, utils.formatNumber(floating, currency.Decimals)));\r\n }\r\n\r\n } else if (type === 'notvalueinterest' && this.state.notvalueinterestVisible) {\r\n let notvalued = parseFloat(item.InterestPLNotValued) + parseFloat(item.StoragePLNotValued);\r\n if (notvalued) {\r\n result.push(this.getFundRow(moduleCss, undefined, '', currencyName, utils.formatNumber(notvalued, currency.Decimals)));\r\n }\r\n\r\n } else if (type === 'equity' && this.state.equityVisible) {\r\n if (item.Equity) {\r\n result.push(this.getFundRow(moduleCss, undefined, '', currencyName, utils.formatNumber(item.Equity, currency.Decimals)));\r\n }\r\n } else if (type === 'netAsset' && this.state.netAssetVisible) {\r\n if (item.NetAsset) {\r\n result.push(this.getFundRow(moduleCss, undefined, '', currencyName, utils.formatNumber(item.NetAsset, currency.Decimals)));\r\n }\r\n } else if (type === 'usable' && this.state.usableVisible) {\r\n result.push(this.getFundRow(moduleCss, undefined, '', currencyName, utils.formatNumber(item.Usable, currency.Decimals)));\r\n\r\n } else if (type === 'pedge' && this.state.pedgeVisible) {\r\n result.push(this.getFundRow(moduleCss, undefined, '', currencyName, utils.formatNumber(item.PedgeAmount, currency.Decimals)));\r\n\r\n } else if (type === 'paidAmount' && this.state.paidAmountVisible) {\r\n result.push(this.getFundRow(moduleCss, undefined, '', currencyName, utils.formatNumber(Math.abs(item.PaidPledgeBalance), currency.Decimals)));\r\n } else if (type === 'unpaidAmount' && this.state.unPaidAmountVisible) {\r\n result.push(this.getFundRow(moduleCss, undefined, '', currencyName, utils.formatNumber(item.UnpaidAmount, currency.Decimals)));\r\n }\r\n\r\n });\r\n }\r\n return result;\r\n }\r\n\r\n getFundRow(moduleCss, togglePropName, title, currencyCode, amount, rightArrow) {\r\n if (utils.parseBoolean(this.props.model.customer.IsNoShowAccountStatus)) {\r\n if (togglePropName != 'accountName' && togglePropName != 'balanceVisible')\r\n return '';\r\n }\r\n if (amount == 0 && togglePropName != 'floatingVisible') {\r\n return '';\r\n }\r\n\r\n // let moduleCss = this.getModuleCss('accountbriefview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n let amountClass = (parseFloat(amount) < 0 ? `${moduleCss.fundContent} ${defaultCss.negativeNumber}` : `${moduleCss.fundContent}`);\r\n return
togglePropName ? this.toggleProp(togglePropName) : false}>\r\n {title} {currencyCode} {amount}\r\n {rightArrow ? rightArrow : ''}\r\n
\r\n }\r\n\r\n toggleProp(propName) {\r\n let prop = {};\r\n prop[propName] = !this.state[propName];\r\n\r\n this.setState(prop);\r\n }\r\n\r\n getAlertLevelPropmpt() {\r\n switch (this.props.model.selectedAccount.AlertLevel) {\r\n case \"1\": return \"MainView.AlertLevel1Prompt\";\r\n case \"2\": return \"MainView.AlertLevel2Prompt\";\r\n case \"3\": return \"MainView.AlertLevel3Prompt\";\r\n default: return \"MainView.AlertLevel0Prompt\";\r\n }\r\n }\r\n\r\n hasNonePhysicalInstruments() {\r\n let result = false;\r\n if (this.instruments) {\r\n Object.values(this.instruments).forEach((instrument) => {\r\n if (utils.parseBoolean(instrument.IsActive) && !instrument.isPhysical()) {\r\n result = true;\r\n }\r\n });\r\n }\r\n return result;\r\n }\r\n\r\n render() {\r\n let { model, isPad } = this.props;\r\n\r\n if (!model || !model.isTradingDataLoaded) {\r\n return \"\";\r\n }\r\n let moduleCss = this.getModuleCss('accountbriefview', 'common');\r\n let account = model.selectedAccount;\r\n let currency = model.currencies[account.CurrencyID];\r\n let currencyName = currency.Name;\r\n\r\n if (!utils.isEmpty(currency.Alias) && (i18n.language === 'zh_tw' || i18n.language === 'zh_cn')) {\r\n currencyName = currency.Alias;\r\n }\r\n currencyName = (utils.isEmpty(currencyName) ? currency.Code : currencyName);\r\n\r\n let isMultiCurrency = Boolean.parseBoolean(account.IsMultiCurrency);\r\n let rightArrow = (isMultiCurrency ? : undefined);\r\n\r\n let enableNetAsset = Boolean.parseBoolean(model.settingData.SystemParameter.EnableNetAsset);\r\n\r\n let hasInterestPLNotValued = (account.InterestPLNotValued || account.StoragePLNotValued);\r\n let isNoShowAccountStatus = utils.parseBoolean(model.customer.IsNoShowAccountStatus);\r\n let necessaryTitle = this.hasNonePhysicalInstruments() ? MainView.Necessary : MainView.PartialPaymentPhysicalNecessary;\r\n let fundComponent =\r\n
\r\n {isPad ? this.getFundRow(moduleCss, 'accountName', MainView.AccountName, '', this.props.model.selectedAccount.Name) : ''}\r\n\r\n {this.getFundRow(moduleCss, 'balanceVisible', MainView.Balance, currencyName, utils.formatNumber(parseFloat(account.Balance), currency.Decimals), rightArrow)}\r\n {this.getFundRows('balance')}\r\n\r\n {isNoShowAccountStatus || !account.Necessary ? '' : this.getFundRow(moduleCss, 'necessaryVisible', necessaryTitle, currencyName, utils.formatNumber(parseFloat(account.Necessary), currency.Decimals), rightArrow)}\r\n {isNoShowAccountStatus || !account.Necessary ? '' : this.getFundRows('necessary')}\r\n\r\n {/*
\r\n MainView.Necessary {account.CurrencyCode} {parseFloat(account.Necessary).toFixed(currency.Decimals)}{rightArrow}\r\n
*/}\r\n {isNoShowAccountStatus ? '' : this.getFundRow(moduleCss, 'floatingVisible', MainView.TradePLFloat, currencyName, utils.formatNumber(parseFloat(account.TradePLFloat), currency.Decimals), rightArrow)}\r\n {isNoShowAccountStatus ? '' : this.getFundRows('floating')}\r\n\r\n {isNoShowAccountStatus || !hasInterestPLNotValued ? '' : this.getFundRow(moduleCss, 'notvalueinterestVisible', MainView.TotalUnrealisedSwap, currencyName, utils.formatNumber(parseFloat(account.InterestPLNotValued) + parseFloat(account.StoragePLNotValued), currency.Decimals), rightArrow)}\r\n {isNoShowAccountStatus || !hasInterestPLNotValued ? '' : this.getFundRows('notvalueinterest')}\r\n\r\n {isNoShowAccountStatus ? '' : this.getFundRow(moduleCss, 'equityVisible', MainView.Equity, currencyName, utils.formatNumber(account.Equity, currency.Decimals), rightArrow)}\r\n {isNoShowAccountStatus ? '' : this.getFundRows('equity')}\r\n {isNoShowAccountStatus || !enableNetAsset ? '' : this.getFundRow(moduleCss, 'netAssetVisible', MainView.NetAsset, currencyName, utils.formatNumber(account.NetAsset, currency.Decimals), rightArrow)}\r\n {isNoShowAccountStatus || !enableNetAsset ? '' : this.getFundRows('netAsset')}\r\n\r\n {this.getFundRow(moduleCss, 'usableVisible', MainView.Usable, currencyName, utils.formatNumber(account.Usable, currency.Decimals), rightArrow)}\r\n {this.getFundRows('usable')}\r\n\r\n {this.getFundRow(moduleCss, 'creditVisible', MainView.CreditAmount, currencyName, utils.formatNumber(account.CreditAmount, currency.Decimals))}\r\n {!account.Ratio ? '' : this.getFundRow(moduleCss, 'ratioVisible', MainView.Ratio, currencyName, utils.formatNumber(account.Ratio * 100, currency.Decimals) + '%', '')}\r\n {!account.PaidPledgeBalance ? '' : this.getFundRow(moduleCss, 'paidAmountVisible', MainView.TotalPaidAmount, currencyName, utils.formatNumber(Math.abs(account.PaidPledgeBalance), currency.Decimals), rightArrow)}\r\n {!account.PaidPledgeBalance ? '' : this.getFundRows('paidAmount')}\r\n\r\n {!account.UnpaidAmount ? '' : this.getFundRow(moduleCss, 'unpaidAmountVisible', MainView.TotalUnpaidAmount, currencyName, utils.formatNumber(account.UnpaidAmount, currency.Decimals), rightArrow)}\r\n {!account.UnpaidAmount ? '' : this.getFundRows('unpaidAmount')}\r\n\r\n {!account.PedgeAmount ? '' : this.getFundRow(moduleCss, 'pedgeVisible', MainView.PledgeAmount, currencyName, utils.formatNumber(account.PedgeAmount, currency.Decimals), rightArrow)}\r\n {!account.PedgeAmount ? '' : this.getFundRows('pedge')}\r\n\r\n\r\n
\r\n MainView.AlertLevel\r\n {this.getAlertLevelPropmpt()}\r\n
\r\n
;\r\n\r\n return
\r\n\r\n {this.isLoggedIn() ? fundComponent : ''}\r\n\r\n\r\n {this.props.children}\r\n {!isPad ?
 
: ''}\r\n
\r\n }\r\n\r\n\r\n}\r\n\r\n\r\n\r\n","import React from 'react';\r\nimport { Trans, withTranslation } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\n// import { Button, InputNumber, Checkbox, Input } from 'antd';\r\nimport { CaretRightOutlined } from '@ant-design/icons';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\nimport BalanceView from './balanceview';\r\nimport { CooKey } from \"../../common/const\"\r\nimport * as utils from '../../common/utils.js';\r\n\r\n// import blackCss from \"../style/black/accountbriefview.module.css\";\r\n// import whiteCss from \"../style/white/accountbriefview.module.css\";\r\n\r\nclass AccountBriefView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = {};\r\n console.log('AccountBriefView.ctor');\r\n }\r\n\r\n componentDidMount() {\r\n let { model } = this.props;\r\n if (!model || !model.loginResult || !model.selectedAccount) {\r\n this.goto('/login');\r\n return
;\r\n } else {\r\n this.setState({ hasPhysicalInstruments: model.hasPhysicalInstruments(), hasForexInstruments: model.hasForexInstruments() });\r\n }\r\n }\r\n\r\n\r\n isLoggedIn() {\r\n let { model } = this.props;\r\n return model && model.isLogedin();\r\n }\r\n\r\n render() {\r\n let { model } = this.props;\r\n if (!model || !model.loginResult || !model.selectedAccount) {\r\n this.goto('/login');\r\n return
;\r\n }\r\n let account = model.selectedAccount;\r\n let moduleCss = this.getModuleCss('accountbriefview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n let enableFund = true;\r\n if (Boolean.parseBoolean(model.customer.IsEmployee)) {\r\n enableFund = Boolean.parseBoolean(model.selectedAccount.AllowSalesPayment) || Boolean.parseBoolean(model.selectedAccount.AllowSalesDeposit);\r\n }\r\n // else if (model.customer.Id != model.selectedAccount.CustomerId) {\r\n // enableFund = false;\r\n // }\r\n let loginResult = model.loginResult;\r\n\r\n let userInfoComponent =
\r\n \r\n {model.selectedAccount.Code} \r\n {model.selectedAccount.Name} \r\n \r\n
;\r\n\r\n let loginButtonComponent =
\r\n \r\n \r\n
;\r\n let currency = model.currencies[account.CurrencyID];\r\n let isNoShowAccountStatus = utils.parseBoolean(this.props.model.customer.IsNoShowAccountStatus);\r\n return
\r\n {!this.props.isPad ? () : ('')}\r\n\r\n\r\n {this.isLoggedIn() ? userInfoComponent : loginButtonComponent}\r\n\r\n {!this.isLoggedIn() ? '' :
\r\n {isNoShowAccountStatus ? '' :
this.onOpenOrderClick()} style={{ display: loginResult && loginResult.UserId ? 'inline-block' : 'none' }} >\r\n \r\n
{MainView.OpenOrderTitle}
\r\n
}\r\n\r\n
this.onTodayExecuteClick()}>\r\n \r\n
{MainView.TodayExecuteTitle}
\r\n
\r\n\r\n
this.onTodayPendingClick()}>\r\n \r\n
{MainView.TodayPendingTitle}
\r\n
\r\n\r\n
this.onOrderQueryClick()}>\r\n \r\n
{MainView.OrderQueryTitle}
\r\n
\r\n\r\n {!enableFund ? '' :
this.onMarginTitleClick()}>\r\n \r\n
{MainView.MarginTitle}
\r\n
}\r\n\r\n
this.onReportTitleClick()}>\r\n \r\n
{MainView.ReportTitle}
\r\n
\r\n
}\r\n\r\n {!this.isLoggedIn() ? '' :\r\n
\r\n
MainView.FundStatus
\r\n \r\n
\r\n }\r\n\r\n\r\n\r\n {this.props.children}\r\n
\r\n }\r\n\r\n onLoginClick() {\r\n utils.removeCookie(CooKey.Login);\r\n this.props.history.push('/login');\r\n }\r\n\r\n onLogoutClick() {\r\n window.history.pushState(null, null, '#/login');\r\n window.history.replaceState(undefined, undefined, '#/login');\r\n this.props.onLogout('/login');\r\n\r\n // window.onpopstate = function () {\r\n // window.history.go(1);\r\n // };\r\n\r\n // try {\r\n // browser.history.deleteAll();\r\n // } catch (ex) {\r\n\r\n // }\r\n // utils.removeCookie(CooKey.Login, true);\r\n // this.props.commService.logout(() => {\r\n // this.goto('/login');\r\n // window.location.reload();\r\n // }); \r\n }\r\n\r\n gotoView(url) {\r\n if (this.isLoggedIn()) {\r\n this.props.history.push(url);\r\n } else {\r\n utils.removeCookie(CooKey.Login);\r\n this.goto('/login');\r\n }\r\n }\r\n\r\n onOpenOrderClick() {\r\n this.gotoView('/openposition');\r\n }\r\n\r\n onTodayExecuteClick() {\r\n let model = this.props.model;\r\n // this.props.commService.queryOrder(model.selectedAccount.Id, '', \"1\", \"0\", this.todayExecuteCallback.bind(this));\r\n this.gotoView('/todayexecute');\r\n }\r\n\r\n todayExecuteCallback(jsonMessage) {\r\n let data = JSON.parse(jsonMessage);\r\n let ordersGroupedByInstrument = {};\r\n if (data.Result.content_result.OrderQueryResults != null) {\r\n let model = this.props.model;\r\n let orders = data.Result.content_result.OrderQueryResults.OrderQueryResult;\r\n let instruments = [];\r\n orders.forEach((order, index) => {\r\n let group = ordersGroupedByInstrument[order.InstrumentCode];\r\n if (!group) {\r\n group = [];\r\n ordersGroupedByInstrument[order.InstrumentCode] = group;\r\n }\r\n group.push(order);\r\n });\r\n\r\n // this.setState({ordersGroupedByInstrument: ordersGroupedByInstrument});\r\n this.props.model.viewData_TodayExecuteView = ordersGroupedByInstrument;\r\n this.gotoView('/todayexecute');\r\n }\r\n }\r\n\r\n\r\n onTodayPendingClick() {\r\n this.gotoView('/pendingorder');\r\n }\r\n\r\n onOrderQueryClick() {\r\n this.gotoView('/orderquery');\r\n }\r\n\r\n onMarginTitleClick() {\r\n this.gotoView('/fund');\r\n }\r\n\r\n onReportTitleClick() {\r\n this.gotoView('/report');\r\n }\r\n\r\n}\r\n\r\n\r\nexport default withRouter(AccountBriefView);\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { message as antMessage, Button } from 'antd';\r\nimport { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\nimport * as utils from '../../common/utils.js';\r\nimport { CooKey } from '../../common/const';\r\n\r\nclass ChangePasswordView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n console.log('ChangePasswordView.ctor');\r\n this.state = {\r\n oldPassword: '',\r\n oldPasswordMask: true,\r\n newPasswordMask: true,\r\n confirmPasswordMask: true\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n console.log('ChangePasswordView.componentDidMount');\r\n this.setState({ oldPassword: '' });\r\n }\r\n\r\n setProp(name, value) {\r\n // console.log('ChangePasswordView.setProp', name, value);\r\n let data = {};\r\n data[name] = value;\r\n this.setState(data);\r\n }\r\n\r\n onSubmitClick() {\r\n let { model, isPad } = this.props;\r\n if (this.state.oldPassword == this.state.newPassword) {\r\n antMessage.info(DialogWindow.MaxPasswordReserve);\r\n }\r\n else if (model.loginResult.loginParam.password == this.state.oldPassword && this.state.newPassword == this.state.confirmPassword) {\r\n model.commService.updatePassword2(model.loginResult.loginParam.loginID, this.state.newPassword, model.systemSetting.MaxPasswordReserveCount, (d) => {\r\n let result = JSON.parse(d).Result.content_result;\r\n\r\n if (utils.parseBoolean(result.isSucceed)) {\r\n let isActiveAccount = Boolean.parseBoolean(model.loginResult.IsActivateAccount);\r\n let isUniqueClient = utils.parseBoolean(model.settingData.SystemParameter.IsUniqueClient);\r\n\r\n utils.removeCookie(CooKey.Login, true);\r\n utils.removeCookie(CooKey.Login, false);\r\n if (isActiveAccount || !isUniqueClient) {\r\n antMessage.info(DialogWindow.RecoverPassword_Success);\r\n model.loginResult.IsActivateAccount = \"False\";\r\n model.loginResult.loginParam.password = this.state.newPassword;\r\n utils.saveCookie(CooKey.Login, JSON.stringify(model.loginResult.loginParam), true);\r\n utils.saveCookie(CooKey.Login, JSON.stringify(model.loginResult.loginParam), false);\r\n\r\n if (isPad) {\r\n this.props.onClose();\r\n } else {\r\n this.goBack();\r\n }\r\n } else {\r\n model.showModalDialog(Common.ChangePassword_Success, () => {\r\n model.commService.logout(() => window.location.reload());\r\n }, { hideCancelButton: true, closable: false });\r\n\r\n }\r\n } else if (result.errorCode == '1') {\r\n antMessage.info(DialogWindow.MaxPasswordReserve);\r\n } else {\r\n // utils.removeCookie(CooKey.Login, true);\r\n window.location.reload();\r\n }\r\n });\r\n }\r\n }\r\n\r\n isInputValid() {\r\n let { model, isPad } = this.props;\r\n return !utils.isEmpty(this.state.oldPassword)\r\n && !utils.isEmpty(this.state.newPassword)\r\n && !utils.isEmpty(this.state.confirmPassword)\r\n && model.loginResult.loginParam.password == this.state.oldPassword\r\n && this.state.newPassword == this.state.confirmPassword;\r\n }\r\n\r\n render() {\r\n if (!this.props.model) {\r\n this.goto('/');\r\n return '';\r\n }\r\n\r\n let { model } = this.props;\r\n let moduleCss = this.getModuleCss('settingview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n let oldErrorClass = !utils.isEmpty(this.state.oldPassword) && model.loginResult.loginParam.password !== this.state.oldPassword ? defaultCss.errorColor : '';\r\n let newErrorClass = !utils.isEmpty(this.state.newPassword) && this.state.confirmPassword !== this.state.newPassword ? defaultCss.errorColor : '';\r\n\r\n let isActiveAccount = Boolean.parseBoolean(model.loginResult.IsActivateAccount);\r\n let isPasswordExpired = (model && model.loginResult && Boolean.parseBoolean(model.loginResult.IsPasswordExpired));\r\n let title = (isActiveAccount ? \"DialogWindow.AccountActivation\" : \"DialogWindow.ChangePassword\");\r\n let isInputValid = this.isInputValid();\r\n let inputStyle = { background: 'inherit', width: 'calc(38% - 1em)' };\r\n return
\r\n {!this.props.isPad ? () : ''}\r\n
DialogWindow.ChangePassword_OldPassword
\r\n { console.log('textBox change'); this.setProp('oldPassword', e.target.value) }} /> this.setState({ oldPasswordMask: !this.state.oldPasswordMask })}> {this.state.oldPasswordMask ? : }\r\n
\r\n
DialogWindow.ChangePassword_NewPassword
this.setProp('newPassword', e.target.value)}> this.setState({ newPasswordMask: !this.state.newPasswordMask })}> {this.state.newPasswordMask ? : }
\r\n
DialogWindow.ChangePassword_ConfirmPassword
this.setProp('confirmPassword', e.target.value)}> this.setState({ confirmPasswordMask: !this.state.confirmPasswordMask })}> {this.state.confirmPasswordMask ? : }
\r\n\r\n {isActiveAccount || isPasswordExpired ?
{isPasswordExpired ? \"DialogWindow.ActivateAccount_Header_ByPasswordExpired\" : \"DialogWindow.ActivateAccount_Header\"}
: ''}\r\n\r\n \r\n
\r\n }\r\n\r\n}\r\n\r\nexport default withRouter(ChangePasswordView);\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Button } from 'antd';\r\n\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport { OrderType, InstrumentStatus } from '../../common/const';\r\nimport * as utils from '../../common/utils.js';\r\nimport TitleBarView from '../titlebarview';\r\n\r\n\r\nclass OpenContractView extends BaseView {\r\n\r\n componentDidMount() {\r\n console.log('OpenContractView.componentDidMount');\r\n let model = this.props.model;\r\n if (model !== undefined && model.placingData.selectedOrders !== undefined && model.placingData.selectedOrders.length > 0) {\r\n\r\n if (parseFloat(model.placingData.selectedOrders[0].LotBalance) === 0) {\r\n this.goBack();\r\n }\r\n else {\r\n let instruments = model.instruments;\r\n let selectOrder = model.placingData.selectedOrders[0];\r\n let instrument = instruments[selectOrder.Transaction.InstrumentID];\r\n let openPositions = Object.values(instrument.openPositions);\r\n openPositions.forEach((order, index) => {\r\n order.isSelected = false;\r\n });\r\n selectOrder.isSelected = true;\r\n }\r\n }\r\n\r\n\r\n }\r\n\r\n onPlacingButtonClick(orderType) {\r\n // this.props.model.placingData.selectedOrders[0];\r\n this.props.model.placingData.orderType = orderType;\r\n\r\n // this.props.history.push('/closeorder');\r\n this.goto('/closeorder');\r\n }\r\n\r\n render() {\r\n\r\n if (this.props.model === undefined || this.props.model.placingData === undefined || this.props.model.placingData.selectedOrders === undefined) {\r\n this.goto('/');\r\n return
;\r\n }\r\n\r\n let { model } = this.props;\r\n let moduleCss = this.getModuleCss('openpositionview', 'common');\r\n\r\n let order = undefined;\r\n let instrumentCode = '';\r\n let instruments = this.props.model.instruments;\r\n let interestRate = 0;\r\n let canPlaceDqOrder = false;\r\n let canPlaceLimitOrder = false;\r\n let isMarket = false; // orderTypes.indexOf(OrderType.Market) >= 0;\r\n let currency = undefined;\r\n\r\n if (model.placingData.selectedOrders !== undefined && this.props.model.placingData.selectedOrders.length > 0) {\r\n order = model.placingData.selectedOrders[0];\r\n\r\n let instrument = instruments[order.Transaction.InstrumentID];\r\n let orderTypes = instrument.getAvailableOrderTypes();\r\n isMarket = orderTypes.indexOf(OrderType.Market) >= 0;\r\n\r\n instrumentCode = instrument.Description;\r\n if (instrument.status == InstrumentStatus.DayOpen || instrument.status == InstrumentStatus.SessionOpen) {\r\n if (model.canPlaceOrder(model.selectedAccount, instrument, OrderType.SpotTrade) || model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Market)) {\r\n canPlaceDqOrder = true;\r\n }\r\n }\r\n\r\n model.getMaxCloseLot(instrument, order, OrderType.Limit);\r\n if (model.canPlaceOrder(model.selectedAccount, instrument, OrderType.Limit)) {\r\n canPlaceLimitOrder = true;\r\n if (order.allowedCloseLot_LimitOrStop == 0) {\r\n canPlaceLimitOrder = false;\r\n }\r\n }\r\n\r\n\r\n let account = model.accounts[order.Transaction.AccountID];\r\n let tradePolicyDetail = account.TradePolicyDetails[instrument.Id];\r\n let isBuy = (order && utils.parseBoolean(order.IsBuy));\r\n let interestRatePolicy = model.interestRates[tradePolicyDetail.InterestRateId];\r\n interestRate = isBuy ? interestRatePolicy.Buy : interestRatePolicy.Sell;\r\n\r\n if (Boolean.parseBoolean(model.selectedAccount.IsMultiCurrency)) {\r\n currency = model.currencies[instrument.CurrencyId];\r\n // this.Decimals = currency.Decimals;\r\n }\r\n else {\r\n currency = model.currencies[model.selectedAccount.CurrencyId];\r\n }\r\n }\r\n\r\n let enableRebate = utils.parseBoolean(model.config.getValue('enableRebate', \"false\"));\r\n let commission = (order.Commission > 0 ? order.Commission : 0);\r\n let levy = (order.Levy > 0 ? order.Levy : 0);\r\n let rebate = utils.formatNumber(Math.abs((order.Commission < 0 ? order.Commission : 0) + (order.Levy < 0 ? order.Levy : 0)), currency.Decimals);\r\n let enableInterest = utils.parseBoolean(model.config.getValue('enableInterest', \"true\"));\r\n return
\r\n {!this.props.isPad ? () : ('')}\r\n\r\n
DialogWindow.OrderCode{order === undefined ? '' : order.Code}
\r\n
DialogWindow.InstrumentCode{instrumentCode}
\r\n
DialogWindow.BuyOrSell{Boolean.parseBoolean(order.IsBuy) ? (MainView.Buy) : (MainView.Sell)}
\r\n
DialogWindow.Quantity{order === undefined ? '' : parseFloat(order.LotBalance)}
\r\n
DialogWindow.ExecutePrice{order === undefined ? '' : order.ExecutePrice}
\r\n
DialogWindow.ExecuteTime{order === undefined ? '' : order.Transaction.ExecuteTime}
\r\n
DialogWindow.ContractSize{order === undefined ? '' : parseFloat(order.Transaction.ContractSize)}
\r\n {!enableInterest ? '' :
DialogWindow.InterestRate{order === undefined ? '' : interestRate}
}\r\n
MainListView.CommissionSum{order === undefined ? '' : utils.formatNumber(order.EstimateCloseCommission, currency.Decimals)}
\r\n {!enableRebate ? '' :
DialogWindow.Rebate{order === undefined ? '' : rebate}
}\r\n\r\n {!order.pendingLimitClosedLot ? '' :
DialogWindow.Pending(DialogWindow.LMT){order.pendingLimitClosedLot} X {order.pendingLimitAvgPrice}
}\r\n {!order.pendingStopClosedLot ? '' :
DialogWindow.Pending(DialogWindow.STP){order.pendingStopClosedLot} X {order.pendingStopAvgPrice}
}\r\n\r\n
\r\n \r\n \r\n
\r\n\r\n {/* { this.bottomBarComponent = ref;}} /> */}\r\n\r\n\r\n
\r\n }\r\n\r\n\r\n\r\n}\r\n\r\nexport default withRouter(OpenContractView);\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Spin, message as antMessage } from 'antd';\r\n\r\n// import moduleCss from \"../../style/todayexecute.module.css\";\r\n\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\n\r\nimport * as utils from '../../common/utils.js';\r\nimport { Phase, TradeOption, OrderDetailViewType } from '../../common/const.js';\r\n// import BottomBar from './bottombar';\r\n\r\n\r\n\r\nclass PendingOrderView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n this.state = { ordersGroupedByInstrument: {} };\r\n }\r\n\r\n componentDidMount() {\r\n console.log('PendingOrderView.componentDidMount');\r\n // this.getData();\r\n }\r\n\r\n componentWillUnmount() {\r\n if (this.props.model) {\r\n this.props.model.viewData_PendingOrderView = undefined;\r\n }\r\n }\r\n\r\n getData() {\r\n let viewData_PendingOrderView = {};\r\n if (this.props.model && this.props.model.instruments) {\r\n let instruments = this.props.model.instruments;\r\n for (let instrumentId in instruments) {\r\n let instrument = instruments[instrumentId];\r\n if (instrument.orders) {\r\n Object.values(instrument.orders).forEach((order, index) => {\r\n let phase = parseInt(order.Transaction.Phase);\r\n if (parseInt(order.TradeOption) !== TradeOption.Invalid && (phase === Phase.Placed || phase === Phase.Placing)) {\r\n let orderDate = order.Transaction.SubmitTime.substring(0, 10);\r\n let key = instrument.Code + orderDate;\r\n let group = viewData_PendingOrderView[key];\r\n if (!group) {\r\n group = [];\r\n group['instrumentCode'] = instrument.Description;\r\n group['date'] = orderDate;\r\n viewData_PendingOrderView[key] = group;\r\n }\r\n group.push(order);\r\n }\r\n });\r\n }\r\n } // end of for instrument\r\n // this.props.model.viewData_PendingOrderView = viewData_PendingOrderView;\r\n // this.forceUpdate();\r\n return viewData_PendingOrderView;\r\n }\r\n\r\n }\r\n\r\n\r\n render() {\r\n if (this.props.model === undefined) {\r\n this.goto('/');\r\n return
;\r\n }\r\n\r\n // console.info('openpositionView.render'); \r\n let { model } = this.props;\r\n\r\n let orderGroups = [];\r\n let viewData_PendingOrderView = this.getData(); // this.props.model.viewData_PendingOrderView;\r\n let moduleCss = this.getModuleCss('PendingOrderView', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n if (viewData_PendingOrderView) {\r\n let instrumentCodes = Object.keys(viewData_PendingOrderView).sort((a, b) => b.localeCompare(a)).reverse();\r\n if (instrumentCodes && instrumentCodes.length > 0) {\r\n instrumentCodes.forEach((key, i1) => {\r\n let todayOrders = viewData_PendingOrderView[key].reverse();\r\n orderGroups.push(
{todayOrders['instrumentCode']} {todayOrders['date']}
);\r\n\r\n todayOrders.forEach((order, index) => {\r\n let isBuy = Boolean.parseBoolean(order.IsBuy);\r\n let isOpen = Boolean.parseBoolean(order.IsOpen);\r\n orderGroups.push(
this.onPendingOrderClick(order)}>\r\n\r\n
{isBuy ? 'MainView.Buy' : 'MainView.Sell'}
\r\n
{isOpen ? \"DialogWindow.OpenOrder\" : \"DialogWindow.CloseOrder\"}
\r\n
{parseFloat(order.Lot)}
\r\n
{order.SetPrice}
\r\n
{order.Transaction.SubmitTime.substring(11, 19)}
\r\n
{utils.getPhaseLanguageKey(order.Phase)}
\r\n\r\n
);\r\n });\r\n\r\n });\r\n }\r\n }\r\n\r\n return
\r\n {!this.props.isPad ? () : ('')}\r\n
\r\n
DialogWindow.BuyOrSell
\r\n
DialogWindow.OpenCloseOrder
\r\n
DialogWindow.Quantity
\r\n
DialogWindow.Price
\r\n
DialogWindow.SubmitTime
\r\n
MainView.Phase
\r\n
\r\n
\r\n {viewData_PendingOrderView ? '' :
}\r\n {orderGroups}\r\n\r\n {this.props.children}\r\n
\r\n {/* { this.bottomBarComponent = ref;}} /> */}\r\n\r\n\r\n
\r\n }\r\n\r\n onPendingOrderClick(order) {\r\n let { model, isPad } = this.props;\r\n model.placingData.selectedOrders = [order];\r\n model.placingData.orderDetailViewType = OrderDetailViewType.Modify;\r\n if (isPad) {\r\n this.props.onRoutePathChange('pendingorderdetail');\r\n } else {\r\n \r\n this.goto('/pendingorderdetail');\r\n }\r\n }\r\n\r\n handleGoBack() {\r\n this.props.history.goBack();\r\n }\r\n\r\n\r\n}\r\n\r\nexport default withRouter(PendingOrderView);\r\n","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { message as antMessage, Button, Checkbox, Modal } from 'antd';\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport InputNumberComponent from '../inputnumbercomponent';\r\nimport { TransactionType, TransactionSubType, OrderType, TradeOption, LimitOrStop, BuySell, InstrumentCategory, Phase, OrderDetailViewType, PhysicalTradeSide, PhysicalInstalmentType, RecalculateRateType, getEnumLangaugeKey } from '../../common/const';\r\nimport { getOrderTypeLanguageKey } from '../../model/orderHelper.js';\r\nimport { getCancelReasonLanguageKey } from '../../model/cancelReasonHelper.js';\r\nimport TitleBarView from '../titlebarview';\r\n\r\nimport * as utils from '../../common/utils.js';\r\nimport { getPendingPriceSetting } from '../../model/placingpricesetting';\r\n\r\nclass PendingOrderDetailView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n this.state = { modalVisible: false };\r\n }\r\n\r\n componentDidMount() {\r\n console.log('PendingOrderDetailView.componentDidMount');\r\n }\r\n\r\n\r\n onModifyOrderClick() {\r\n this.goto('/pendingordermodify');\r\n }\r\n\r\n onCancelOrderClick() {\r\n let { model } = this.props;\r\n let order = model.placingData.selectedOrders[0];\r\n\r\n model.commService.cancel(order.Transaction.ID, order.Transaction.AccountID, (e) => {\r\n console.log(e);\r\n try {\r\n let transactionError = JSON.parse(e).Result.content_result.transactionError;\r\n if (transactionError != 'OK') {\r\n utils.logError(DialogWindow.TransactionError_{transactionError});\r\n }\r\n } catch (e) {\r\n utils.logError(e);\r\n }\r\n this.goBack();\r\n });\r\n }\r\n\r\n onWorkingListClearClick() {\r\n if (this.canClearWorkingList()) {\r\n try {\r\n let { model } = this.props;\r\n let order = model.placingData.selectedOrders[0];\r\n let instrument = model.instruments[order.Transaction.InstrumentID];\r\n\r\n delete instrument.workingList[order.ID];\r\n } catch (e) {\r\n utils.logError(e);\r\n }\r\n this.goBack();\r\n }\r\n }\r\n\r\n canClearWorkingList() {\r\n let o = this.props.model.placingData.selectedOrders[0];\r\n if (o.Phase != Phase.Placing && o.Phase != Phase.Placed) {\r\n return true;\r\n }\r\n }\r\n\r\n getToolbar(moduleCss, modifyVisible, modifyDisabled, cancelVisible) {\r\n let isWorkingList = this.props.model.placingData.orderDetailViewType == OrderDetailViewType.WorkingList;\r\n return
\r\n {!modifyVisible || isWorkingList ? '' : }\r\n {!cancelVisible || isWorkingList ? '' : }\r\n {!this.canClearWorkingList() ? '' : }\r\n
;\r\n }\r\n\r\n render() {\r\n let { model, isPad } = this.props;\r\n\r\n // if (model === undefined || model.placingData === undefined || model.placingData.selectedOrders === undefined) {\r\n // this.goto('/');\r\n // return
;\r\n // }\r\n\r\n let moduleCss = this.getModuleCss('openpositionview', 'common');\r\n\r\n let order = model.placingData.selectedOrders[0];\r\n let instrument = model.instruments[order.Transaction.InstrumentID];\r\n let account = model.accounts[order.Transaction.AccountID];\r\n let tradePolicy = account.TradePolicyDetails[instrument.Id];\r\n\r\n let instrumentCode = instrument.Description;\r\n let isBuy = Boolean.parseBoolean(order.IsBuy);\r\n let isOpen = Boolean.parseBoolean(order.IsOpen);\r\n let currency = model.currencies[Boolean.parseBoolean(account.IsMultiCurrency) ? instrument.CurrencyId : account.CurrencyId];\r\n let phase = parseInt(order.Transaction.Phase);\r\n let isTradingAllowed = model.allowTrading(account); // Boolean.parseBoolean(account.IsTradingAllowed) && !Boolean.parseBoolean(model.customer.DisallowTrade);\r\n let modifyDisabled = (phase !== Phase.Placed && phase !== Phase.Placing && !isTradingAllowed);\r\n let canPlaceOrder = model.canPlaceOrder(account, instrument, order.Transaction.OrderType);\r\n if (canPlaceOrder && (order.Transaction.Type == TransactionType.OneCancelOther)) {\r\n canPlaceOrder = model.canPlaceOcoOrder(instrument, isOpen);\r\n }\r\n let modifyVisible = canPlaceOrder && (phase === Phase.Placed && isTradingAllowed && Boolean.parseBoolean(tradePolicy.ChangePlacedOrderAllowed));\r\n let cancelVisible = isTradingAllowed && (phase === Phase.Placed || phase === Phase.Placing);\r\n\r\n let priceRows = [];\r\n let orderTypeText = getOrderTypeLanguageKey(order); // (order.TradeOption == TradeOption.Better ? \"MainView.OrderType_Limit\" : \"MainView.OrderType_Stop\");\r\n if (order.Transaction.Type == TransactionType.OneCancelOther) {\r\n // orderTypeText = (order.TradeOption == TradeOption.Better ? \"MainView.LimitOfOCO\" : \"MainView.StopOfOCO\");\r\n if (instrument.workingList) {\r\n Object.values(instrument.workingList).forEach((ocoOrder) => {\r\n if (ocoOrder.Transaction.ID == order.Transaction.ID && (ocoOrder.Phase == Phase.Placed || ocoOrder.Phase == Phase.Placing)) {\r\n if (parseInt(ocoOrder.TradeOption) === TradeOption.Better) {\r\n priceRows.push(
DialogWindow.Price(MainView.OrderType_Limit){ocoOrder.SetPrice}
);\r\n } else {\r\n priceRows.push(
DialogWindow.Price(MainView.OrderType_Stop){ocoOrder.SetPrice}
);\r\n }\r\n }\r\n });\r\n }\r\n } else {\r\n if (model.placingData.orderDetailViewType == OrderDetailViewType.Modify) {\r\n let price = (order.Phase == Phase.Executed || order.Phase == Phase.Completed) ? order.ExecutePrice : order.SetPrice;\r\n priceRows.push(
DialogWindow.Price{price}
);\r\n } else {\r\n priceRows.push(
DialogWindow.Price{order.SetPrice}
);\r\n priceRows.push(
DialogWindow.ExecutePrice{order.ExecutePrice}
);\r\n }\r\n\r\n }\r\n\r\n let priceDoneLimit = undefined;\r\n let priceDoneStop = undefined;\r\n if (instrument.workingList) {\r\n Object.values(instrument.workingList).forEach((doneOrder) => {\r\n if (doneOrder.Transaction.AssigningOrderID == order.ID && (doneOrder.Phase == Phase.Placed || doneOrder.Phase == Phase.Placing)) {\r\n if (doneOrder.TradeOption == TradeOption.Better) {\r\n priceDoneLimit = doneOrder.SetPrice;\r\n } else if (doneOrder.TradeOption == TradeOption.Stop) {\r\n priceDoneStop = doneOrder.SetPrice;\r\n }\r\n }\r\n });\r\n }\r\n\r\n let openOrderInfo = [];\r\n if (order.OrderRelations && order.OrderRelations.OrderRelation) {\r\n Object.values(utils.forceToArray(order.OrderRelations.OrderRelation)).forEach((relation, index) => {\r\n if (!utils.isEmpty(relation.OpenOrderExecutePrice)) {\r\n openOrderInfo.push(
{utils.format(\"{0}x{1}x{2}\", relation.OpenOrderExecuteTime.substring(0, 10), relation.ClosedLot, relation.OpenOrderExecutePrice)}
);\r\n } else {\r\n let openOrder = instrument.orders[relation.OpenOrderID];\r\n if (openOrder) {\r\n let time = (utils.isEmpty(openOrder.Transaction.ExecuteTime) ? openOrder.Transaction.SubmitTime : openOrder.Transaction.ExecuteTime);\r\n let price = (utils.isEmpty(openOrder.ExecutePrice) ? openOrder.SetPrice : openOrder.ExecutePrice);\r\n openOrderInfo.push(
{utils.format(\"{0}x{1}x{2}\", time.substring(0, 10), relation.ClosedLot, price)}
);\r\n } else {\r\n openOrderInfo.push(
); // done order price is empty\r\n }\r\n }\r\n });\r\n }\r\n let remark = '';\r\n if (order.Phase == Phase.Canceled) {\r\n remark = getCancelReasonLanguageKey(order.CancelReason);\r\n }\r\n\r\n let physicalRows = [];\r\n if (parseInt(instrument.Category) === InstrumentCategory.Physical && instrument.physicalInventory) {\r\n physicalRows = [
DialogWindow.Physical_InstalmentType{order.PhysicalInstalmentType == PhysicalInstalmentType.EqualInstalment ? \"DialogWindow.Physical_EqualInstalment\" : \"DialogWindow.Physical_EqualPrincipal\"}
,\r\n
DialogWindow.Physical_Frequency{getEnumLangaugeKey(\"InstalmentFrequence\", parseInt(order.Frequence))}
,\r\n
DialogWindow.Physical_InterestRecalculationRateType{getEnumLangaugeKey(\"RecalculateRateType\", parseInt(order.RecalculateRateType))}
,\r\n
DialogWindow.Physical_Period{order.Period}
,\r\n
DialogWindow.Physical_DownPayment{parseFloat(order.DownPayment)}
,\r\n ]\r\n\r\n }\r\n\r\n let enableRebate = utils.parseBoolean(model.config.getValue('enableRebate', \"false\"));\r\n let commission = utils.formatNumber((order.Commission > 0 ? order.Commission : 0), currency.Decimals);\r\n let levy = utils.formatNumber((order.Levy > 0 ? order.Levy : 0), currency.Decimals);\r\n let rebate = utils.formatNumber(Math.abs((order.Commission < 0 ? order.Commission : 0) + (order.Levy < 0 ? order.Levy : 0)), currency.Decimals);\r\n\r\n return
\r\n {!this.props.isPad ? () : ('')}\r\n\r\n
DialogWindow.OrderCode{order.Code}
\r\n
DialogWindow.InstrumentCode{instrumentCode}
\r\n
DialogWindow.BuyOrSell{isBuy ? \"MainView.Buy\" : \"MainView.Sell\"}
\r\n
DialogWindow.Quantity{order.Lot}
\r\n
DialogWindow.OpenCloseOrder{isOpen ? \"DialogWindow.OpenOrder\" : \"DialogWindow.CloseOrder\"}
\r\n\r\n {/*
DialogWindow.Price{order.SetPrice}
*/}\r\n {priceRows}\r\n\r\n
{(model.placingData.orderDetailViewType == OrderDetailViewType.Modify) ? \"DialogWindow.TimeStamp\" : \"DialogWindow.SubmitTime\"}{order.Transaction.SubmitTime}
\r\n
DialogWindow.EndTime{order.Transaction.EndTime}
\r\n
DialogWindow.OrderType{orderTypeText}
\r\n
DialogWindow.Currency{currency.Code}
\r\n
DialogWindow.Commission{commission}
\r\n {!enableRebate ? '' :
DialogWindow.Rebate{rebate}
}\r\n
DialogWindow.Levy{levy}
\r\n\r\n {!priceDoneLimit ? '' :
DialogWindow.IfDone(DialogWindow.Limit){priceDoneLimit}
}\r\n {!priceDoneStop ? '' :
DialogWindow.IfDone(DialogWindow.Stop){priceDoneStop}
}\r\n {openOrderInfo.length === 0 ? '' :
DialogWindow.OpenPositions{openOrderInfo}
}\r\n\r\n {physicalRows}\r\n
DialogWindow.Remarks {utils.isInteger(remark) ? '[' + remark.toString() + ']' : {remark}}
\r\n\r\n {this.getToolbar(moduleCss, modifyVisible, modifyDisabled, cancelVisible)}\r\n\r\n {/* {this.props.model.placingData.hideToolbarOnOrderDetail ? '' :
\r\n {!modifyVisible ? '' : }\r\n \r\n
} */}\r\n\r\n {/* { this.bottomBarComponent = ref;}} /> */}\r\n\r\n this.setState({ modalVisible: false })} afterClose={() => document.body.style.overflow = \"auto\"} footer={null}>\r\n\r\n
\r\n
\r\n DialogWindow.ConfirmCancelOrder\r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n }\r\n\r\n\r\n}\r\n\r\nclass PendingOrderModifyView extends BaseView {\r\n constructor(props) {\r\n super(props);\r\n console.log(\"PendingOrderModifyView.ctor\");\r\n\r\n let { model } = props;\r\n if (!model || !model.placingData) return;\r\n\r\n let order = model.placingData.selectedOrders[0];\r\n let instrument = model.instruments[order.Transaction.InstrumentID];\r\n\r\n let state = {\r\n order: order,\r\n instrument: instrument\r\n };\r\n\r\n if (order.Transaction.Type == TransactionType.OneCancelOther) {\r\n state.ocoChecked = true;\r\n utils.forceToArray(order.Transaction.Orders.Order).forEach((o) => {\r\n this.setStatePrice(o, state);\r\n if (instrument.workingList) {\r\n Object.values(instrument.workingList).forEach((doneOrder) => {\r\n if (doneOrder.Transaction.AssigningOrderID == o.ID && (doneOrder.Phase == Phase.Placed || doneOrder.Phase == Phase.Placing)) {\r\n this.setStateDonePrice(o, doneOrder, state);\r\n state.ifDoneChecked = true;\r\n }\r\n });\r\n }\r\n\r\n });\r\n } else {\r\n this.setStatePrice(order, state);\r\n if (instrument.workingList) {\r\n Object.values(instrument.workingList).forEach((doneOrder) => {\r\n if (doneOrder.Transaction.AssigningOrderID == order.ID && (doneOrder.Phase == Phase.Placed || doneOrder.Phase == Phase.Placing)) {\r\n this.setStateDonePrice(order, doneOrder, state);\r\n state.ifDoneChecked = true;\r\n }\r\n });\r\n }\r\n }\r\n state.limitPriceOfOrder = state.limitPrice; // limitPrice will changed between order.setPrice and instrument ask/bid on checkbox checked\r\n state.limitPriceDoneLimitOfOrder = state.limitPriceDoneLimit;\r\n state.limitPriceDoneStopOfOrder = state.limitPriceDoneStop;\r\n\r\n state.stopPriceOfOrder = state.stopPrice;\r\n state.stopPriceDoneLimitOfOrder = state.stopPriceDoneLimit;\r\n state.stopPriceDoneStopOfOrder = state.stopPriceDoneStop;\r\n\r\n this.state = state;\r\n }\r\n\r\n setStatePrice(order, state) {\r\n if (order.TradeOption == TradeOption.Better) {\r\n state.limitPrice = order.SetPrice;\r\n } else if (order.TradeOption == TradeOption.Stop) {\r\n state.stopPrice = order.SetPrice;\r\n }\r\n }\r\n\r\n setStateDonePrice(ifOrder, order, state) {\r\n let prefix = (ifOrder.TradeOption == TradeOption.Better ? 'limitPrice' : 'stopPrice');\r\n if (order.TradeOption == TradeOption.Better) {\r\n state[prefix + 'DoneLimit'] = order.SetPrice;\r\n } else if (order.TradeOption == TradeOption.Stop) {\r\n state[prefix + 'DoneStop'] = order.SetPrice;\r\n }\r\n }\r\n\r\n\r\n setStateProp(propName, propValue) {\r\n if (propName.endsWith('Price') && propValue == '') { // price input cleared\r\n return;\r\n }\r\n let { model } = this.props;\r\n let prop = {};\r\n prop[propName] = propValue;\r\n\r\n if (propName == \"ifDoneChecked\" && !propValue) {\r\n prop[\"limitPriceDoneLimitChecked\"] = false;\r\n prop[\"limitPriceDoneStopChecked\"] = false;\r\n prop[\"stopPriceDoneLimitChecked\"] = false;\r\n prop[\"stopPriceDoneStopChecked\"] = false;\r\n\r\n delete this.state.limitPriceDoneLimit;\r\n delete this.state.limitPriceDoneStop;\r\n\r\n delete this.state.stopPriceDoneLimit;\r\n delete this.state.stopPriceDoneStop;\r\n }\r\n\r\n let order = this.state.order;\r\n let instrument = this.state.instrument;\r\n let isBuy = Boolean.parseBoolean(order.IsBuy);\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n // let basePrice = (isBuy === isNormal ? instrument.quotation.Ask : instrument.quotation.Bid);\r\n let isOpen = Boolean.parseBoolean(order.IsOpen);\r\n let canPlaceOcoOrder = model.canPlaceOcoOrder(instrument, isOpen);\r\n if (canPlaceOcoOrder) {\r\n if ((propName == \"limitPriceChecked\" && !utils.isEmpty(this.state.stopPrice))\r\n || (propName == \"stopPriceChecked\" && !utils.isEmpty(this.state.limitPrice))) {\r\n this.state.ocoChecked = propValue;\r\n }\r\n } else {\r\n this.state.ocoChecked = false;\r\n if ((propName == \"limitPriceChecked\" && utils.isEmpty(this.state.limitPrice))\r\n || (propName == \"stopPriceChecked\" && utils.isEmpty(this.state.stopPrice))) {\r\n return;\r\n }\r\n }\r\n\r\n if (propName == \"limitPriceChecked\") {\r\n this.setLimitStopPriceProp(prop, instrument, isBuy, isNormal, LimitOrStop.Limit, propValue);\r\n }\r\n if (propName == \"limitPriceDoneLimitChecked\") {\r\n this.setDonePriceProp(prop, instrument, isBuy, LimitOrStop.Limit, LimitOrStop.Limit, propValue);\r\n }\r\n if (propName == \"limitPriceDoneStopChecked\") {\r\n this.setDonePriceProp(prop, instrument, isBuy, LimitOrStop.Limit, LimitOrStop.Stop, propValue);\r\n }\r\n\r\n if (propName == \"stopPriceChecked\") {\r\n this.setLimitStopPriceProp(prop, instrument, isBuy, isNormal, LimitOrStop.Stop, propValue);\r\n }\r\n if (propName == \"stopPriceDoneLimitChecked\") {\r\n this.setDonePriceProp(prop, instrument, isBuy, LimitOrStop.Stop, LimitOrStop.Limit, propValue);\r\n }\r\n if (propName == \"stopPriceDoneStopChecked\") {\r\n this.setDonePriceProp(prop, instrument, isBuy, LimitOrStop.Stop, LimitOrStop.Stop, propValue);\r\n }\r\n\r\n this.setState(prop);\r\n\r\n console.log(propName, propValue);\r\n return true;\r\n }\r\n\r\n setLimitStopPriceProp(prop, instrument, isBuy, isNormal, limitOrStop, checked) {\r\n //if (propName == \"limitPriceChecked\") {\r\n let basePrice = (isBuy === isNormal ? instrument.quotation.Ask : instrument.quotation.Bid);\r\n let priceSetting = getPendingPriceSetting(this.props.model, instrument, basePrice, 0, limitOrStop, isBuy ? BuySell.Buy : BuySell.Sell, false);\r\n let pricePropName = (limitOrStop == LimitOrStop.Limit ? \"limitPrice\" : \"stopPrice\");\r\n prop[pricePropName] = checked ? priceSetting.default : this.state[pricePropName + \"OfOrder\"];\r\n if (!checked) {\r\n prop[pricePropName + \"DoneLimitChecked\"] = false;\r\n prop[pricePropName + \"DoneStopChecked\"] = false;\r\n }\r\n\r\n let doneLimitPricePropName = pricePropName + \"DoneLimit\";\r\n let doneStopPricePropName = pricePropName + \"DoneStop\";\r\n prop[doneLimitPricePropName] = !this.state[doneLimitPricePropName + 'Checked'] ? this.state[doneLimitPricePropName + 'OfOrder'] : getPendingPriceSetting(this.props.model, instrument, prop[pricePropName] ? prop[pricePropName] : this.state[pricePropName], 0, LimitOrStop.Limit, !isBuy ? BuySell.Buy : BuySell.Sell, true).default;\r\n prop[doneStopPricePropName] = !this.state[doneStopPricePropName + 'Checked'] ? this.state[doneStopPricePropName + 'OfOrder'] : getPendingPriceSetting(this.props.model, instrument, prop[pricePropName] ? prop[pricePropName] : this.state[pricePropName], 0, LimitOrStop.Stop, !isBuy ? BuySell.Buy : BuySell.Sell, true).default;\r\n //}\r\n }\r\n\r\n setDonePriceProp(prop, instrument, isBuy, ifOrderLimitOrStop, doneOrderLimitOrStop, checked) {\r\n let ifPricePropName = (ifOrderLimitOrStop == LimitOrStop.Limit ? \"limitPrice\" : \"stopPrice\");\r\n let donePricePropName = ifPricePropName + 'Done' + (doneOrderLimitOrStop == LimitOrStop.Limit ? \"Limit\" : \"Stop\"); // limitPriceDoneLimit\r\n //if (propName == \"limitPriceDoneLimitChecked\") {\r\n prop[donePricePropName + 'Checked'] = (this.state[ifPricePropName + 'Checked'] ? checked : false);\r\n prop[donePricePropName] = !checked ? this.state[donePricePropName + 'OfOrder'] : getPendingPriceSetting(this.props.model, instrument, prop[ifPricePropName] ? prop[ifPricePropName] : this.state[ifPricePropName], 0, doneOrderLimitOrStop, !isBuy ? BuySell.Buy : BuySell.Sell, true).default;\r\n //}\r\n\r\n // if (propName == \"limitPriceDoneStopChecked\") {\r\n // prop[propName] = (this.state.limitPriceChecked ? propValue : false);\r\n // prop[\"limitPriceDoneStop\"] = !propValue ? this.state.limitPriceDoneStopOfOrder : getPendingPriceSetting(this.props.model, instrument, prop[\"limitPrice\"] ? prop[\"limitPrice\"] : this.state.limitPrice, 0, LimitOrStop.Stop, !isBuy ? BuySell.Buy : BuySell.Sell, true).default;\r\n // }\r\n }\r\n\r\n getRowComponent(moduleCss, stateProp, checkBoxContent, priceSetting) {\r\n let { model } = this.props;\r\n let inputRow = !priceSetting ? '' : this.setStateProp(stateProp, value)}> ;\r\n\r\n let order = model.placingData.selectedOrders[0];\r\n let instrument = model.instruments[order.Transaction.InstrumentID];\r\n let isOpen = Boolean.parseBoolean(order.IsOpen);\r\n let checkboxDisabled = false;\r\n let canPlaceOcoOrder = model.canPlaceOcoOrder(instrument, isOpen);\r\n if ((stateProp == \"oco\" && !this.state.ocoChecked && !canPlaceOcoOrder)\r\n || (stateProp.indexOf('PriceDone') > 0 && !this.state.ifDoneChecked)) {\r\n checkboxDisabled = true;\r\n }\r\n\r\n if (stateProp == \"oco\") { // && order.Transaction.Type == TransactionType.OneCancelOther){\r\n checkboxDisabled = true;\r\n }\r\n\r\n // if (!this.state.ocoChecked) {\r\n // if ((stateProp == 'limitPrice' && !utils.isEmpty(this.state.stopPrice))\r\n // || (stateProp == 'stopPrice' && !utils.isEmpty(this.state.limitPrice))) {\r\n // checkboxDisabled = true;\r\n // }\r\n // }\r\n let defaultCss = this.getModuleCss('default');\r\n // let rowClass = `${moduleCss.modifyRowContent} ${(checkboxDisabled ? defaultCss.disabledColor : '')}`;\r\n let rowClass = moduleCss.modifyRowContent;\r\n return \r\n { { return stateProp == \"oco\" && !canPlaceOcoOrder ? false : this.setStateProp(stateProp + 'Checked', e.target.checked) }}>{checkBoxContent}}\r\n {inputRow}\r\n \r\n\r\n // return { this.setStateProp(stateProp, e.target.checked) }}>{content};\r\n }\r\n\r\n onSubmitButtonClick() {\r\n let { model, commService } = this.props;\r\n let order = model.placingData.selectedOrders[0];\r\n let instrument = model.instruments[order.Transaction.InstrumentID];\r\n\r\n let phase = parseInt(order.Transaction.Phase);\r\n let modifyDisabled = (phase !== Phase.Placed && phase !== Phase.Placing);\r\n if ((!this.state.limitPriceChecked && !this.state.stopPriceChecked) || modifyDisabled) {\r\n return false;\r\n }\r\n\r\n let isBuy = Boolean.parseBoolean(order.IsBuy);\r\n let isOpen = Boolean.parseBoolean(order.IsOpen);\r\n\r\n let state = this.state;\r\n let limitPrices = { setPrice: state.limitPriceChecked ? state.limitPrice : state.limitPriceOfOrder, doneLimitPrice: state.limitPriceDoneLimitChecked ? state.limitPriceDoneLimit : state.limitPriceDoneLimitOfOrder, doneStopPrice: state.limitPriceDoneStopChecked ? state.limitPriceDoneStop : state.limitPriceDoneStopOfOrder };\r\n let stopPrices = { setPrice: state.stopPriceChecked ? state.stopPrice : state.stopPriceOfOrder, doneLimitPrice: state.stopPriceDoneLimitChecked ? state.stopPriceDoneLimit : state.stopPriceDoneLimitOfOrder, doneStopPrice: state.stopPriceDoneStopChecked ? state.stopPriceDoneStop : state.stopPriceDoneStopOfOrder };\r\n\r\n let transactionType = (this.state.ocoChecked ? TransactionType.OneCancelOther : TransactionType.Single);\r\n let orderType = (this.state.ocoChecked ? OrderType.OneCancelOther : OrderType.Limit);\r\n let openOrders = isOpen ? undefined : [];\r\n if (!isOpen) {\r\n utils.forceToArray(order.OrderRelations.OrderRelation).forEach((relation) => {\r\n let openOrder = instrument.orders[relation.OpenOrderID];\r\n openOrder.selectedLot = relation.ClosedLot;\r\n openOrders.push(openOrder);\r\n });\r\n }\r\n let trans = model.buildTransactions(instrument, transactionType, orderType, isBuy, order.Lot, openOrders, undefined, limitPrices, stopPrices, order.Transaction.ExpireType, order.Transaction.EndTime);\r\n\r\n trans.forEach((tran, index) => {\r\n tran.SubType = TransactionSubType.Amend;\r\n tran.AssigningOrderID = order.ID;\r\n tran.EndTime = order.Transaction.EndTime;\r\n let xmlDoc = utils.convertToXml(tran, 'Transaction');\r\n\r\n console.log(xmlDoc.toString());\r\n commService.place(tran);\r\n });\r\n\r\n if (this.props.onClose) {\r\n this.props.onClose();\r\n } else {\r\n this.goBack(-2);\r\n }\r\n }\r\n\r\n render() {\r\n let { model } = this.props;\r\n window.scrollTo(0, 0);\r\n // if (model === undefined || model.placingData === undefined || model.placingData.selectedOrders === undefined) {\r\n // this.goto('/');\r\n // return
;\r\n // }\r\n\r\n let moduleCss = this.getModuleCss('pendingorderview', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n let order = model.placingData.selectedOrders[0];\r\n let instrument = model.instruments[order.Transaction.InstrumentID];\r\n let account = model.accounts[order.Transaction.AccountID];\r\n\r\n let instrumentCode = instrument.Description;\r\n let isBuy = Boolean.parseBoolean(order.IsBuy);\r\n let isNormal = Boolean.parseBoolean(instrument.IsNormal);\r\n let basePrice = (isBuy === isNormal ? instrument.quotation.Ask : instrument.quotation.Bid);\r\n let isOpen = Boolean.parseBoolean(order.IsOpen);\r\n let currency = model.currencies[Boolean.parseBoolean(account.IsMultiCurrency) ? instrument.CurrencyId : account.CurrencyId];\r\n let phase = parseInt(order.Transaction.Phase);\r\n let modifyDisabled = (phase !== Phase.Placed && phase !== Phase.Placing);\r\n let buttonClass = `${moduleCss.modifyRowButton} ${(this.state.limitPriceChecked || this.state.stopPriceChecked) && !modifyDisabled ? '' : defaultCss.disabledColor}`;\r\n\r\n let limitPriceSetting = getPendingPriceSetting(model, instrument, basePrice, 0, LimitOrStop.Limit, isBuy ? BuySell.Buy : BuySell.Sell, false);\r\n let limitPriceDoneLimitSetting = getPendingPriceSetting(model, instrument, this.state.limitPrice, 0, LimitOrStop.Limit, !isBuy ? BuySell.Buy : BuySell.Sell, true);\r\n let limitPriceDoneStopSetting = getPendingPriceSetting(model, instrument, this.state.limitPrice, 0, LimitOrStop.Stop, !isBuy ? BuySell.Buy : BuySell.Sell, true);\r\n\r\n\r\n let stopPriceSetting = getPendingPriceSetting(model, instrument, basePrice, 0, LimitOrStop.Stop, isBuy ? BuySell.Buy : BuySell.Sell, false);\r\n let stopPriceDoneLimitSetting = getPendingPriceSetting(model, instrument, this.state.stopPrice, 0, LimitOrStop.Limit, !isBuy ? BuySell.Buy : BuySell.Sell, true);\r\n let stopPriceDoneStopSetting = getPendingPriceSetting(model, instrument, this.state.stopPrice, 0, LimitOrStop.Stop, !isBuy ? BuySell.Buy : BuySell.Sell, true);\r\n let canPlaceIfDoneOrder = isOpen && model.canPlaceIfDoneOrder(instrument, false);\r\n let orderTypeText = getOrderTypeLanguageKey(order);\r\n return
\r\n {!this.props.isPad ? () : ('')}\r\n\r\n
\r\n DialogWindow.LimitReference\r\n {this.getRowComponent(moduleCss, \"limitPrice\", undefined, limitPriceSetting)}\r\n
\r\n\r\n {!canPlaceIfDoneOrder ? '' :
\r\n DialogWindow.PlacingOrder_LimitPrice\r\n {this.getRowComponent(moduleCss, \"limitPriceDoneLimit\", undefined, limitPriceDoneLimitSetting)}\r\n
}\r\n\r\n {!canPlaceIfDoneOrder ? '' :
\r\n DialogWindow.PlacingOrder_StopPrice\r\n {this.getRowComponent(moduleCss, \"limitPriceDoneStop\", undefined, limitPriceDoneStopSetting)}\r\n
}\r\n\r\n
\r\n DialogWindow.StopReference\r\n {this.getRowComponent(moduleCss, \"stopPrice\", undefined, stopPriceSetting)}\r\n
\r\n\r\n\r\n {!canPlaceIfDoneOrder ? '' :
\r\n DialogWindow.PlacingOrder_LimitPrice\r\n {this.getRowComponent(moduleCss, \"stopPriceDoneLimit\", undefined, stopPriceDoneLimitSetting)}\r\n
}\r\n\r\n {!canPlaceIfDoneOrder ? '' :
\r\n DialogWindow.PlacingOrder_StopPrice\r\n {this.getRowComponent(moduleCss, \"stopPriceDoneStop\", undefined, stopPriceDoneStopSetting)}\r\n
}\r\n\r\n\r\n\r\n\r\n
\r\n {this.getRowComponent(moduleCss, \"oco\", DialogWindow.OCO)} \r\n {canPlaceIfDoneOrder ? {this.getRowComponent(moduleCss, \"ifDone\", DialogWindow.IfDone)} : ''}\r\n
\r\n\r\n
\r\n DialogWindow.TimeExpired\r\n {order.Transaction.EndTime}\r\n
\r\n\r\n
\r\n
DialogWindow.Submit
\r\n
\r\n\r\n {/* { this.bottomBarComponent = ref;}} /> */}\r\n\r\n\r\n
\r\n }\r\n}\r\n\r\nlet pendingOrderDetailView = withRouter(PendingOrderDetailView)\r\nlet pendingOrderModifyView = withRouter(PendingOrderModifyView)\r\nexport { pendingOrderDetailView as PendingOrderDetailView, pendingOrderModifyView as PendingOrderModifyView };\r\n","import { CancelReason } from '../common/const.js';\r\n// import * as utils from '../common/utils.js';\r\n\r\nexport function getCancelReasonLanguageKey(cancelReason) {\r\n cancelReason = parseInt(cancelReason);\r\n console.log('getCancelReasonLanguageKey()');\r\n let message = \"\";\r\n if (cancelReason == CancelReason.ExceedOpenLotBalance) {\r\n message = \"DialogWindow.TransactionError_ExceedOpenLotBalance\";\r\n }\r\n else if (cancelReason == CancelReason.InvalidPrice) {\r\n message = \"DialogWindow.TransactionError_InvalidPrice\";\r\n }\r\n else if (cancelReason == CancelReason.AccountIsNotTrading) {\r\n message = \"DialogWindow.TransactionError_AccountIsNotTrading\";\r\n }\r\n else if (cancelReason == CancelReason.AccountResetFailed) {\r\n message = \"DialogWindow.TransactionError_AccountResetFailed\";\r\n }\r\n else if (cancelReason == CancelReason.InstrumentIsNotAccepting) {\r\n message = \"DialogWindow.TransactionError_InstrumentIsNotAccepting\";\r\n }\r\n else if (cancelReason == CancelReason.TimingIsNotAcceptable) {\r\n message = \"DialogWindow.TransactionError_TimingIsNotAcceptable\";\r\n }\r\n else if (cancelReason == CancelReason.OrderTypeIsNotAcceptable) {\r\n message = \"DialogWindow.TransactionError_OrderTypeIsNotAcceptable\";\r\n }\r\n else if (cancelReason == CancelReason.HasNoAccountsLocked) {\r\n message = \"DialogWindow.TransactionError_HasNoAccountsLocked\";\r\n }\r\n else if (cancelReason == CancelReason.IsLockedByAgent) {\r\n message = \"DialogWindow.TransactionError_IsLockedByAgent\";\r\n }\r\n else if (cancelReason == CancelReason.LossExecutedOrderInOco) {\r\n message = \"DialogWindow.TransactionError_LossExecutedOrderInOco\";\r\n }\r\n else if (cancelReason == CancelReason.NecessaryIsNotWithinThreshold) {\r\n message = \"DialogWindow.TransactionError_NecessaryIsNotWithinThreshold\";\r\n }\r\n else if (cancelReason == CancelReason.MarginIsNotEnough) {\r\n message = \"DialogWindow.TransactionError_MarginIsNotEnough\";\r\n }\r\n\r\n else if (cancelReason == CancelReason.AccountIsInAlerting) {\r\n message = \"DialogWindow.TransactionError_AccountIsInAlerting\";\r\n }\r\n else if (cancelReason == CancelReason.LimitStopAddPositionNotAllowed) {\r\n message = \"DialogWindow.TransactionError_StopAddPositionNotAllowed\";\r\n }\r\n else if (cancelReason == CancelReason.MooMocNewPositionNotAllowed) {\r\n message = \"DialogWindow.TransactionError_LmtMooMocNewPositionNotAllowed\";\r\n }\r\n else if (cancelReason == CancelReason.TransactionCannotBeBooked) {\r\n message = \"DialogWindow.TransactionError_TransactionCannotBeBooked\";\r\n }\r\n else if (cancelReason == CancelReason.OnlySptMktIsAllowedForPreCheck) {\r\n message = \"DialogWindow.TransactionError_OnlySptMktIsAllowedForPreCheck\";\r\n }\r\n else if (cancelReason == CancelReason.InvalidTransactionPhase) {\r\n message = \"DialogWindow.TransactionError_InvalidTransactionPhase\";\r\n }\r\n else if (cancelReason == CancelReason.TransactionExpired) {\r\n message = \"DialogWindow.TransactionError_TransactionExpired\";\r\n }\r\n else if (cancelReason == CancelReason.RiskMonitorDelete) {\r\n message = \"DialogWindow.TransactionError_RiskMonitorDelete\";\r\n }\r\n else if (cancelReason == CancelReason.DealerCanceled) {\r\n message = \"DialogWindow.TransactionError_DealerCanceled\";\r\n }\r\n else if (cancelReason == CancelReason.OneCancelOther) {\r\n message = \"DialogWindow.TransactionError_OneCancelOtherPrompt\";\r\n }\r\n else if (cancelReason == CancelReason.CustomerCanceled) {\r\n message = \"DialogWindow.TransactionError_CustomerCanceled\";\r\n }\r\n else if (cancelReason == CancelReason.PriceChanged) {\r\n message = \"DialogWindow.CancelReason_PriceChanged\";\r\n }\r\n else if (cancelReason == CancelReason.MarketPausedOrClosed) {\r\n message = \"DialogWindow.CancelReason_MarketPausedOrClosed\";\r\n }\r\n else if (cancelReason == CancelReason.PriceMustBeGreaterThanZero) {\r\n message = \"DialogWindow.CancelReason_PriceMustBeGreaterThanZero\";\r\n }\r\n else if (cancelReason == CancelReason.MarketPriceOrdersNotSupportedByOppositeLimit) {\r\n message = \"DialogWindow.CancelReason_MarketPriceOrdersNotSupportedByOppositeLimit\";\r\n }\r\n else if (cancelReason == CancelReason.SellOrderStopPriceMustBeBelowLastTradePrice) {\r\n message = \"DialogWindow.CancelReason_SellOrderStopPriceMustBeBelowLastTradePrice\";\r\n }\r\n else if (cancelReason == CancelReason.BuyOrderStopPriceMustBeAboveLastTradePrice) {\r\n message = \"DialogWindow.CancelReason_BuyOrderStopPriceMustBeAboveLastTradePrice\";\r\n }\r\n else if (cancelReason == CancelReason.OrderTypeNotPermittedInPreOpen) {\r\n message = \"DialogWindow.CancelReason_OrderTypeNotPermittedInPreOpen\";\r\n }\r\n else if (cancelReason == CancelReason.OrderPriceOutsideTheLimits) {\r\n message = \"DialogWindow.CancelReason_OrderPriceOutsideTheLimits\";\r\n }\r\n else if (cancelReason == CancelReason.OrderPriceOutsideBands) {\r\n message = \"DialogWindow.CancelReason_OrderPriceOutsideBands\";\r\n }\r\n else if (cancelReason == CancelReason.OrderTypeNotPermittedForGroup) {\r\n message = \"DialogWindow.CancelReason_OrderTypeNotPermittedForGroup\";\r\n }\r\n else if (cancelReason == CancelReason.OrderCannotBeModifiedInNoCancel) {\r\n message = \"DialogWindow.CancelReason_OrderCannotBeModifiedInNoCancel\";\r\n }\r\n else if (cancelReason == CancelReason.OpenOrderIsClosed) {\r\n message = \"DialogWindow.CancelReason_OpenOrderIsClosed\";\r\n }\r\n else if (cancelReason == CancelReason.ReplacedWithMaxLot) {\r\n message = \"DialogWindow.TransactionError_ReplacedWithMaxLot\";\r\n }\r\n else if (cancelReason == CancelReason.ShortSellNotAllowed) {\r\n message = \"DialogWindow.TransactionError_ShortSellNotAllowed\";\r\n }\r\n else if (cancelReason == CancelReason.ExceedMaxPhysicalValue) {\r\n message = \"DialogWindow.TransactionError_ExceedMaxPhysicalValue\";\r\n }\r\n else if (cancelReason == CancelReason.BalanceOrEquityIsShort) {\r\n message = \"DialogWindow.TransactionError_BalanceOrEquityIsShort\";\r\n }\r\n else if (cancelReason == CancelReason.ExistPendingLimitCloseOrder) {\r\n message = \"DialogWindow.TransactionError_ExistPendingLimitCloseOrder\";\r\n }\r\n else if (cancelReason == CancelReason.InvalidInstalmentTrade) {\r\n message = \"DialogWindow.TransactionError_InvalidInstalmentTrade\";\r\n }\r\n else if (cancelReason == CancelReason.HitIsReseted) {\r\n message = \"DialogWindow.TransactionError_HitIsReseted\";\r\n }\r\n else if (cancelReason == CancelReason.SplittedForHasShortSell) {\r\n message = \"DialogWindow.TransactionError_SplittedForHasShortSell\";\r\n }\r\n else if (cancelReason == CancelReason.ExceedHighLowPrice) {\r\n message = \"DialogWindow.TransactionError_ExceedHighLowPrice\";\r\n }\r\n else if (cancelReason == CancelReason.ExceedDQVariation) {\r\n message = \"DialogWindow.TransactionError_ExceedDQVariation\";\r\n }\r\n else if (cancelReason == CancelReason.NotPaidoffInstalmentOrderCanNotBeClosed) {\r\n message = \"DialogWindow.TransactionError_NotPaidoffInstalmentOrderCanNotBeClosed\";\r\n }\r\n else if (cancelReason == CancelReason.OrderBatchExecuteFailed) {\r\n message = \"DialogWindow.TransactionError_OrderBatchExecuteFailed\";\r\n }\r\n else {\r\n message = cancelReason;\r\n }\r\n return message;\r\n // return utils.format(\"{0}[{1}]\", message, cancelReason);\r\n}","import React from 'react';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { Trans } from 'react-i18next';\r\n\r\n// import moduleCss from \"../style/bottombar.module.css\";\r\n\r\nimport BaseView from \"./baseview.js\";\r\n\r\n\r\nclass BottomBar extends BaseView {\r\n\r\n componentDidMount() {\r\n const { onRef } = this.props;\r\n if (onRef) {\r\n onRef(this);\r\n }\r\n }\r\n\r\n getClass(location) {\r\n let moduleCss = this.getModuleCss('bottombar', 'common');\r\n let defaultCss = this.getModuleCss('default'); \r\n return `${moduleCss.menuItem} ${window.location.hash.endsWith(location) ? defaultCss.bottomActiveItem : ''}`;\r\n }\r\n\r\n render() {\r\n let moduleCss = this.getModuleCss('bottombar', 'common'); \r\n let defaultCss = this.getModuleCss('default');\r\n //const { t } = this.props;\r\n if (this.props.ishidden) {\r\n return '';\r\n }\r\n\r\n else {\r\n let showLog = (!this.props.model.settingData ? false : Boolean.parseBoolean(this.props.model.customer.ShowLog));\r\n\r\n return
\r\n
\r\n
\r\n
\r\n
this.goto('/')}> MainView.QuotationMenuName
\r\n
this.goto('/accountbrief')}> MainView.TradingMenuName
\r\n\r\n {/*
  • this.goto('/messageview')}> MainView.NewsMenuName
  • */}\r\n\r\n\r\n {!showLog ? '' :
    this.goto('/log')}> MainView.LogMenuName
    }\r\n
    this.goto('/message')}> MainView.MessageMenuName
    \r\n
    this.goto('/setting')}> MainView.SettingMenuName
    \r\n
    \r\n
    \r\n
    \r\n }\r\n }\r\n\r\n // goto(path) {\r\n // console.info('BottomBar.goto')\r\n // this.goto(path);\r\n // }\r\n\r\n}\r\n\r\nexport default withRouter(BottomBar);","import React from 'react';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\nimport moment from 'moment';\r\n\r\nimport { Select, DatePicker, Switch, message as antMessage } from 'antd';\r\nimport axios from 'axios';\r\n\r\nimport * as utils from \"../../common/utils\";\r\nimport { DeliveryRequestStatus } from \"../../common/const\";\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\n\r\nconst { Option } = Select;\r\n\r\nclass ReportView extends BaseView {\r\n\r\n constructor(props) {\r\n super(props);\r\n\r\n console.log('ReportView.ctor');\r\n\r\n if (props.model && props.model.isTradingDataLoaded) {\r\n let deliveryRequestOptions = [];\r\n let deliveryRequestId = undefined;\r\n if (props.model.selectedAccount.DeliveryRequests && props.model.selectedAccount.DeliveryRequests.DeliveryRequest) {\r\n let deliveryRequests = utils.forceToArray(props.model.selectedAccount.DeliveryRequests.DeliveryRequest).sort((a, b) => a.Code.localeCompare(b.Code));\r\n deliveryRequests.forEach((item) => {\r\n if (item.AccountId == props.model.selectedAccount.Id && parseInt(item.Status) == DeliveryRequestStatus.Approved) {\r\n if (!deliveryRequestId) {\r\n deliveryRequestId = item.Id;\r\n }\r\n deliveryRequestOptions.push();\r\n }\r\n });\r\n }\r\n this.state = {\r\n viewAsPdf: true,\r\n reportType: \"statement\",\r\n dayType: 'day',\r\n // now: props.model.getServerTime(),\r\n currentTradeDay: moment(props.model.tradeDay.CurrentDay),\r\n tradeDayBegin: moment(props.model.tradeDay.CurrentDay), //props.model.getServerTime()\r\n tradeDayEnd: moment(props.model.tradeDay.CurrentDay),\r\n reportGroupDetail: {},\r\n deliveryRequestOptions: deliveryRequestOptions,\r\n deliveryRequestId: deliveryRequestId\r\n };\r\n }\r\n }\r\n\r\n componentDidMount() {\r\n // debugger;\r\n // this.setState( {orderGroupByInstrument : this.props.orderGroupByInstrument });\r\n let { model } = this.props;\r\n let reportGroupDetail = {};\r\n if (model && model.settingData && model.settingData.ReportGroupDetails && model.settingData.ReportGroupDetails.ReportGroupDetail) {\r\n utils.forceToArray(model.settingData.ReportGroupDetails.ReportGroupDetail).forEach((detail) => {\r\n reportGroupDetail[detail.Name] = detail.Name;\r\n });\r\n }\r\n this.setState({ reportGroupDetail: reportGroupDetail });\r\n }\r\n\r\n onCalendarChange(date, propName) {\r\n if (date != null) {\r\n let p = {};\r\n\r\n if (propName == \"tradeDayBegin\") {\r\n p[\"tradeDayEnd\"] = this.getMaxTradeDayEnd(this.state.dayType, date);\r\n } else if (propName == \"tradeDayEnd\") {\r\n let maxTradeDayEnd = this.getMaxTradeDayEnd(this.state.dayType, this.state.tradeDayBegin);\r\n if (date > maxTradeDayEnd) {\r\n date = maxTradeDayEnd;\r\n }\r\n }\r\n p[propName] = date; //.format('YYYY-MM-DD');\r\n\r\n this.setState(p);\r\n }\r\n }\r\n\r\n getBeginDisabledDate(current) {\r\n let { model } = this.props;\r\n let serverTime = model.getServerTime().clone();\r\n let isTraderReportDeadline = Boolean.parseBoolean(model.settingData.SystemParameter.IsTraderReportDeadline);\r\n if (isTraderReportDeadline && current <= serverTime) {\r\n if (this.state.reportType == 'ledger' || this.state.reportType == 'statement' || this.state.reportType == 'accountsummary') {\r\n let monthStart = serverTime.clone().subtract(1, 'months').startOf('month');\r\n // if (this.state.dayType === 'week') {\r\n // monthStart = serverTime.clone().startOf('month');\r\n // }\r\n return current < monthStart;\r\n }\r\n }\r\n\r\n return current >= serverTime;\r\n }\r\n\r\n getEndDisabledDate(current) {\r\n return current >= this.props.model.getServerTime() || current < this.state.tradeDayBegin;\r\n }\r\n\r\n getMaxTradeDayEnd(dayType, tradeDayBegin) {\r\n let result = tradeDayBegin.clone();\r\n\r\n if (dayType === 'day') {\r\n result = tradeDayBegin;\r\n } else if (dayType === 'week') {\r\n result = result.day(7);\r\n if (result.month() != tradeDayBegin.month()) {\r\n result = tradeDayBegin.clone().endOf('month');\r\n }\r\n\r\n } else if (dayType === 'month') {\r\n result = result.endOf('month');\r\n }\r\n return (result > this.state.currentTradeDay ? this.state.currentTradeDay : result);\r\n }\r\n\r\n setStateProp(name, value) {\r\n let prop = {};\r\n prop[name] = value;\r\n\r\n if (name == 'dayType') {\r\n prop[\"tradeDayEnd\"] = this.getMaxTradeDayEnd(value, this.state.tradeDayBegin);\r\n }\r\n this.setState(prop);\r\n }\r\n\r\n getDayTypeClassName(dayType) {\r\n let defaultCss = this.getModuleCss('default');\r\n let moduleCss = this.getModuleCss('report', 'common');\r\n return `${moduleCss.paramDatePeriod} ${(this.state.dayType === dayType ? defaultCss.bottomActiveItem : '')}`;\r\n }\r\n\r\n onQueryClick(e) {\r\n let { model, commService } = this.props;\r\n model.showLoadingSpin(true);\r\n // let timeZone = model.getServerTime().toDate().getTimezoneOffset();\r\n model.reportParameter = {\r\n reportParameter: {\r\n CompanyName: model.loginResult.PathName, //commService.state.loginParam.validPathName,\r\n Language: commService.state.loginParam.language.toUpperCase(),\r\n ReportType: this.state.reportType,\r\n TradeDayBeginString: this.state.tradeDayBegin.format('yyyy-MM-DD'),\r\n TradeDayEndString: this.state.tradeDayEnd.format('yyyy-MM-DD'),\r\n AccountIds: [model.selectedAccount.Id],\r\n UserId: model.loginResult.UserId\r\n }\r\n };\r\n if (this.state.deliveryRequestId) {\r\n model.reportParameter.reportParameter.DeliveryRequestId = this.state.deliveryRequestId;\r\n }\r\n\r\n let url = utils.format(this.props.commService.state.config.getValue('traderReport'), window.location.origin).toLowerCase().replace(\"reportviewer.aspx\", \"reportserviceajax.svc/SetReportParameter\");\r\n // console.log(JSON.stringify(this.props.model.reportParameter)); \r\n axios.post(url, this.props.model.reportParameter, { headers: { 'content-type': 'application/json' } })\r\n .then(res => {\r\n console.log(res.data)\r\n\r\n //this.setState({ parameterId: res.data.SetReportParameterResult })\r\n model.reportParameterId = res.data.SetReportParameterResult;\r\n model.reportViewAsPdf = this.state.viewAsPdf;\r\n model.showLoadingSpin(false);\r\n\r\n let formatParam = this.state.viewAsPdf ? \"isUsePdf=true&viewAsPage=true\" : \"isUseHtml=true\";\r\n url = utils.format(this.props.commService.state.config.getValue('traderReport'), window.location.origin) + \"?runModel=1&\" + formatParam + \"¶meterId=\" + model.reportParameterId;\r\n if (this.state.openInNewWindow) {\r\n window.open(url);\r\n } else {\r\n // let formatParam = model.reportViewAsPdf ? \"isUsePdf=true&viewAsPage=true\" : \"isUseHtml=true\";\r\n // url = utils.format(this.props.commService.state.config.getValue('traderReport'), window.location.origin) + \"?runModel=1&\" + formatParam + \"¶meterId=\" + model.reportParameterId;\r\n model.iframeUrl = url;\r\n model.iframeTitle = MainView.ReportTitle;\r\n this.goto('/framewindow');\r\n }\r\n\r\n\r\n }).catch((error) => {\r\n console.error(error);\r\n model.showLoadingSpin(false);\r\n });\r\n\r\n\r\n }\r\n\r\n isSubmitEnable() {\r\n let disableDeliveryReport = this.state.reportType == 'physicaldelivery' && this.state.deliveryRequestId == undefined;\r\n return !disableDeliveryReport;\r\n }\r\n\r\n render() {\r\n if (!this.props.model) return '';\r\n\r\n let { model } = this.props;\r\n let moduleCss = this.getModuleCss('report', 'common');\r\n let defaultCss = this.getModuleCss('default');\r\n\r\n let showEmployeeReport = Boolean.parseBoolean(model.customer.IsEmployee);\r\n let hasPhysicalInstruments = model.hasPhysicalInstruments();\r\n let submitButtonClass = `${moduleCss.queryButton} ${defaultCss.defaultButtonColor} ${this.isSubmitEnable() ? '' : defaultCss.disabledColor}`;\r\n return
    \r\n {!this.props.isPad ? () : ('')}\r\n\r\n
    \r\n
    MainView.ReportType
    \r\n
    \r\n \r\n
    \r\n
    \r\n
    MainView.From
    \r\n\r\n this.onCalendarChange.bind(this)(d, \"tradeDayBegin\")} />\r\n\r\n
    \r\n
    MainView.To
    \r\n this.onCalendarChange.bind(this)(d, \"tradeDayEnd\")} />\r\n
    \r\n\r\n {this.state.reportType != 'physicaldelivery' ? '' :\r\n
    DialogWindow.Physical_Delivery
    \r\n
    \r\n \r\n
    \r\n
    }\r\n\r\n
    \r\n
    Common.ReportOpenInNewWindow
    \r\n this.setStateProp('openInNewWindow', checked)} />\r\n
    \r\n\r\n
    \r\n
    Common.ViewAsPdf
    \r\n this.setStateProp('viewAsPdf', checked)} />\r\n
    \r\n\r\n
    \r\n
    this.setStateProp('dayType', 'day')}>MainView.Day
    \r\n
    this.setStateProp('dayType', 'week')}>MainView.Week
    \r\n
    this.setStateProp('dayType', 'month')}>MainView.Month
    \r\n
    \r\n\r\n
    {this.state.openInNewWindow ? Common.ReportNeedNewWindowTip : ''}
    \r\n\r\n \r\n
    \r\n\r\n {this.props.children}\r\n {/* { this.bottomBarComponent = ref;}} /> */}\r\n\r\n\r\n
    \r\n }\r\n\r\n}\r\n\r\nexport default withRouter(ReportView);\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport { Trans } from 'react-i18next';\r\nimport { withRouter } from \"react-router-dom\";\r\n\r\n// import axios from 'axios'\r\nimport { Spin } from 'antd';\r\n\r\nimport * as utils from \"../../common/utils\";\r\n\r\nimport BaseView from \"../baseview.js\";\r\nimport TitleBarView from '../titlebarview';\r\n// import BottomBar from './bottombar';\r\n\r\n\r\n\r\n// const BottomBarComponent = withTranslation()(BottomBar);\r\n\r\nclass FrameView extends BaseView {\r\n\r\n constructor(props) {\r\n console.log('iFrameView.ctor');\r\n super(props);\r\n this.state = {};\r\n }\r\n\r\n componentWillUnmount() {\r\n delete this.props.model.iframeUrl;\r\n }\r\n\r\n componentDidMount() {\r\n this.setState({ iframeUrl: this.props.model.iframeUrl });\r\n }\r\n\r\n render() {\r\n if (!this.props.model) return '';\r\n\r\n let { model, isPad } = this.props;\r\n let moduleCss = this.getModuleCss('report', 'common');\r\n // let formatParam = model.reportViewAsPdf ? \"isUsePdf=true&viewAsPage=true\" : \"isUseHtml=true\";\r\n // let url = utils.format(this.props.commService.state.config.getValue('traderReport'), window.location.origin) + \"?runModel=1&\" + formatParam + \"¶meterId=\" + model.reportParameterId;\r\n\r\n //let titleKey = model.reportParameter.reportParameter.ReportType == \"ledger\" ? \"MainView.Report_Ledger\" : \"MainView.Report_Statement\";\r\n return
    \r\n {!this.props.isPad ? () : ('')}\r\n {/* {this.state.loaded ? '' :
    } */}\r\n\r\n {this.state.iframeUrl ?