internal Stop(Position position, double level, StopType type, StopMode mode) { this.position = position; SmartQuant.Trading.StopType type2 = EnumConverter.Convert(type); SmartQuant.Trading.StopMode mode2 = EnumConverter.Convert(mode); this.stop = new ATSStop(position.position, level, type2, mode2); this.stop.TrailOnHighLow = true; this.stop.TraceOnBarOpen = true; this.stop.TraceOnBar = true; this.stop.TraceOnQuote = true; this.stop.TraceOnTrade = true; }
internal static StopMode Convert(SmartQuant.Trading.StopMode stopMode) { switch (stopMode) { case SmartQuant.Trading.StopMode.Absolute: return(StopMode.Absolute); case SmartQuant.Trading.StopMode.Percent: return(StopMode.Percent); default: throw new NotImplementedException("Stop mode is not supported : " + stopMode); } }