Forex_Strategy_Builder.Data.Log C# (CSharp) Method

Log() public static method

Saves a text line in the log file.
public static Log ( string logLine ) : void
logLine string
return void
        public static void Log(string logLine)
        {
            if (toLog == true)
            {
                swLogFile.WriteLine(DateTime.Now.ToString() + "   " + logLine);
                swLogFile.Flush();
            }

            return;
        }

Usage Example

示例#1
0
        /// <summary>
        /// Duplicates an logic condition.
        /// </summary>
        public void DuplicateFilter(int slotToDuplicate)
        {
            Data.Log("Duplicate a Filter");

            if (Slot[slotToDuplicate].SlotType == SlotTypes.OpenFilter && OpenFilters < MaxOpenFilters ||
                Slot[slotToDuplicate].SlotType == SlotTypes.CloseFilter && CloseFilters < MaxCloseFilters)
            {
                IndicatorSlot tempSlot = Slot[slotToDuplicate].Clone();

                if (Slot[slotToDuplicate].SlotType == SlotTypes.OpenFilter)
                {
                    int iAddedslot = AddOpenFilter();
                    Slot[iAddedslot] = tempSlot.Clone();
                }

                if (Slot[slotToDuplicate].SlotType == SlotTypes.CloseFilter)
                {
                    int addedslot = AddCloseFilter();
                    Slot[addedslot] = tempSlot.Clone();
                }

                // Sets the slot numbers.
                for (int slot = 0; slot < Slots; slot++)
                {
                    indicatorSlot[slot].SlotNumber = slot;
                }
            }

            return;
        }
All Usage Examples Of Forex_Strategy_Builder.Data::Log