Ejemplo n.º 1
0
        private string[] CreateActualPosTableDataRowFromFut(Futures fut)
        {
            string[] rowData    = new string[10];
            int      indexCount = 4;

            rowData[0] = "F";
            rowData[1] = "0";
            rowData[2] = Convert.ToString(fut.Position.EnterPrice);
            rowData[3] = Convert.ToString(fut.Position.Quantity);
            rowData[4] = Convert.ToString(fut.Position.GetMarketPriceToClose(fut.GetTradeBlotter()));
            rowData[5] = Convert.ToString(fut.Position.CalcCurrentPnL(fut.GetTradeBlotter()));
            rowData[6] = Convert.ToString(fut.Position.CalcCurrentPnLInCurrency(fut.GetTradeBlotter(), fut.PriceStep, fut.PriceStepValue));
            rowData[7] = Convert.ToString(0.0);
            rowData[8] = Convert.ToString(0.0);
            rowData[9] = Convert.ToString(dataCollector.GetBasicFutures().MarginRequirement);

            return(rowData);
        }
Ejemplo n.º 2
0
        public double[] GetRenderDataFromFutures(Futures futures)
        {
            if (futures == null)
            {
                throw new RenderingDerivativesException("instrument is null, can't render it.");
            }

            double[] result = new double[]
            {
                futures.Position.GetMarketPriceToClose(futures.GetTradeBlotter()),
                0.0,
                Math.Round(futures.Position.CalcCurrentPnL(futures.GetTradeBlotter()), 2),
                Math.Round(futures.Position.CalcCurrentPnLInCurrency(futures.GetTradeBlotter(), futures.PriceStep, futures.PriceStepValue), 0),
                futures.Position.Quantity,
                0.0,
                0.0,
                0.0,
            };

            return(result);
        }
 public double CalculateActualStrike()
 {
     return(Math.Round(basicFutures.GetTradeBlotter().AskPrice / Settings.Default.StrikeStep, 0) * Settings.Default.StrikeStep);
 }