public void Reset() { TotalNegativePnL = 0; StartTime = null; LastTime = null; Mode = PnLStopLossEngineMode.Idle; }
public PnLStopLossEngine(PnLStopLossSettings pnLStopLossSettings) { Interval = pnLStopLossSettings.Interval; Threshold = pnLStopLossSettings.Threshold; Markup = pnLStopLossSettings.Markup; PnLStopLossSettingsId = null; TotalNegativePnL = 0; StartTime = null; LastTime = null; Mode = PnLStopLossEngineMode.Idle; }
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); }
public void Enable() { Mode = PnLStopLossEngineMode.Idle; }
public void Disable() { Reset(); Mode = PnLStopLossEngineMode.Disabled; }