Example #1
0
 public void Reset()
 {
     TotalNegativePnL = 0;
     StartTime        = null;
     LastTime         = null;
     Mode             = PnLStopLossEngineMode.Idle;
 }
Example #2
0
 public PnLStopLossEngine(PnLStopLossSettings pnLStopLossSettings)
 {
     Interval              = pnLStopLossSettings.Interval;
     Threshold             = pnLStopLossSettings.Threshold;
     Markup                = pnLStopLossSettings.Markup;
     PnLStopLossSettingsId = null;
     TotalNegativePnL      = 0;
     StartTime             = null;
     LastTime              = null;
     Mode = PnLStopLossEngineMode.Idle;
 }
Example #3
0
        public bool Refresh()
        {
            if (StartTime == null)
            {
                return(false);
            }

            if (LastTimeExpired || StartTimeExpired && !ThresholdExceeded)
            {
                Reset();
                return(true);
            }

            if (ThresholdExceeded && Mode != PnLStopLossEngineMode.Active)
            {
                Mode = PnLStopLossEngineMode.Active;
                return(true);
            }

            return(false);
        }
Example #4
0
 public void Enable()
 {
     Mode = PnLStopLossEngineMode.Idle;
 }
Example #5
0
        public void Disable()
        {
            Reset();

            Mode = PnLStopLossEngineMode.Disabled;
        }