internal static void PerformAllTableCalculation(Share share, string atFilename) { AllTable[] atSegment = new AllTable[10402]; atSegment = AllTable.GetAllTableRows(atFilename, 10402); Calculations.PerformShareCalculations(share, ref atSegment); Calculations.Row1Calcs(share, ref atSegment); AllTable.SaveAllTable(atFilename, ref atSegment); }
private void SaatKontrol(int allTableId) { AllTable masa = _uow.GetRepo <AllTable>().GetById(allTableId); if (masa.RezerveTarihi < DateTime.Now) { masa.IsFill = false; } }
internal static void OverviewFromLastRow(Share share, ref Overview oview, AllTable atLast) { //col 3: Sum of volumes (LastDayVolume) (49) oview.LastDayVol = atLast.FV; //col 4: Price of row 10401 (11) oview.LastPrice = atLast.FP; //col 5: Price of row 1040-104-1 oview.DayBeforePrice = atLast.Col_10; // atSegment[10401 - 104].FP; ============> PROBLEM !!!! //col 6: Price of row 10401 / Price of row 10297 if (oview.DayBeforePrice > 0) { oview.PriceFactor = oview.LastPrice / oview.DayBeforePrice; } // col 7: Price-Gradient PGc of row 1040 (23) oview.LastPGc = atLast.PGc; // col 8: Price-Gradient PGd of row 10401 oview.LastPGd = atLast.PGd; // col 9: 13 The biggest PGa of row 10298 to 10401 oview.BigLastDayPGa = atLast.PGa; // col 10: 18 The biggest PGF of All-table column 15 to 17, row 10298 to 10401 oview.BigLastDayPGF = atLast.BigPGF; // col 11: 30 The DHLFPc of row 10401 oview.LastDHLFPc = atLast.DHLFPc; //col 12: 34 The DHLFPd of row 10401 oview.LastDHLFPd = atLast.DHLFPd; //col 13 unused //col 14: 40 The DLLFPc of row 10401 oview.LastDLLFPc = atLast.DLLFPc; //col 15: 44 The DLLFPd of row 10401 oview.LastDLLFPd = atLast.DLLFPd; //col 16: 64 Sum of Points Gradient a of row 10298 to 10401 oview.LastDaySumOfPGa = atLast.PtsGradA; //col 17: 66 Sum of Points Gradient b of row 10298 to 10401 oview.LastDaySumOfPGb = atLast.PtsGradB; //col 18: 68 Sum of Points Gradient c of row 10298 to 10401 oview.LastDaySumOfPGc = atLast.PtsGradC; //col 19: 73 Sum of Points Volume a of row 10298 to 10401 oview.LastDaySumOfPtsVola = atLast.PtsVola; //col 20: 75 Sum of Points Volume b of row 10298 to 10401 oview.LastDaySumOfPtsVolb = atLast.PtsVolb; //col 21: 77 Sum of Points Volume c of row 10298 to 10401 oview.LastDaySumOfPtsVolc = atLast.PtsVolc; //col 22: 79 Sum of Points Volume d of row 10298 to 10401 oview.LastDaySumOfPtsVold = atLast.PtsVold; //col 23: 70 Sum of Points Points High Line HLc of row 10298 to 10401 oview.LastDaySumOfPtsHLc = atLast.PtsHLc; //col 24: 71 Sum of Points Points High Line HLd of row 10298 to 10401 oview.LastDaySumOfPtsHLd = atLast.PtsHLd; //col 25: duplicate of col 19??? //col 26: duplicate of col 20??? //col 27: ask Gunther //col 28: ask Gunther oview.BigLastDaySVFac = atLast.SVFac; oview.BigLastDaySVFbd = atLast.SVFbd; }
//Here we instantiate an initial Overview object for a share and determine its Laziness internal static Overview CreateInitialOverviewForShare(Share share, AllTable atRow1) { //var lazyShareParams = Helper.UserSettings().ParamsLazyShare; // col 2. Instantiate an Overview object and assign Name of share Overview oview = new Overview(share.Name, share.Number); // Lazy flag - we now assume the Laziness has been precalculated and can be found in passed in Row1 oview.Lazy = atRow1.Col_2 > 0; return(oview); }
// Performs the full series of Calculations internal static void PerformShareCalculations(Share share, ref AllTable[] atSegment) { var slowPriceParams = Helper.UserSettings().ParamsSlowPrice; Calculations.MakeSlowPrices(ref atSegment, slowPriceParams, 2, 10401, out string[] auditSummary); Calculations.MakeFiveMinutesPriceGradients(ref atSegment, 2, 10401, out auditSummary); var directionAndTurningParams = Helper.UserSettings().ParamsDirectionAndTurning; Calculations.FindDirectionAndTurning(ref atSegment, directionAndTurningParams, 10298, 10401, out auditSummary); var fiveMinsGradientFigParam = Helper.UserSettings().ParamsFiveMinsGradientFigure; Calculations.FindFiveMinsGradientsFigurePGF(ref atSegment, fiveMinsGradientFigParam, 2, 10401, out auditSummary); Calculations.RelatedVolumeFigureOfBiggestPGF(ref atSegment, 10298, 10401, out auditSummary); var highLineParam = Helper.UserSettings().ParamsMakeHighLine; Calculations.MakeHighLineHL(ref atSegment, highLineParam, 2, 10401, out auditSummary); var lowLineParam = Helper.UserSettings().ParamsMakeLowLine; Calculations.MakeLowLineLL(ref atSegment, lowLineParam, 2, 10401, out auditSummary); var slowVolumeParam = Helper.UserSettings().ParamsMakeSlowVolume; Calculations.MakeSlowVolume(ref atSegment, slowVolumeParam, 2, 10401, out auditSummary); var slowVolFigSVFacParam = Helper.UserSettings().ParamsSlowVolFigSVFac; Calculations.SlowVolumeFigureSVFac(ref atSegment, slowVolFigSVFacParam, 2, 10401, out auditSummary); var slowVolFigSVFbdParam = Helper.UserSettings().ParamsSlowVolFigSVFbd; Calculations.SlowVolumeFigureSVFbd(ref atSegment, slowVolFigSVFbdParam, 2, 10401, out auditSummary); // we store the results of our Laziness determination in Col_2 row 1 so that the Overview // can initially be compiled without having to recalculate it var lazyShareParam = Helper.UserSettings().ParamsLazyShare; bool isLazy = OverviewCalcs.isLazyLast10Days(atSegment, lazyShareParam); //finally, copy row 10401 to row 1 AllTable.CopySourceToTargetAllTableRow(ref atSegment, 10401, 1); //fix Row number atSegment[1].Row = 1; //and slot in the islazy flag atSegment[1].Col_2 = isLazy ? 1.0 : 0; }
//updates prices and volumes from hash for given alltable and if able to find //trades for the band, returns price just assigned //else returns the price it carried in private static double FillAllTableRowFromTradehash( int shareNum, AllTable atRec, int timeBand, Dictionary <string, Trade> tradeHash, double carryInPrice) { //find the AllTable price and volume data we need for this date & band in the tradehash string key = $"{shareNum},{atRec.Date},{timeBand}"; if (tradeHash.ContainsKey(key)) { atRec.FP = tradeHash[key].Price; atRec.FV = tradeHash[key].Volume; return(atRec.FP);; } return(carryInPrice); }
internal static void SerializeAllTableRecord(FileStream fs, AllTable atRec) { // Construct a BinaryFormatter and use it to serialize the data to the stream. BinaryFormatter formatter = new BinaryFormatter(); try { formatter.Serialize(fs, atRec); } catch (SerializationException e) { Helper.Log("Error", "Failed to serialize. Reason: " + e.Message); throw; } }