Beispiel #1
0
 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 StopType Convert(SmartQuant.Trading.StopType stopType)
        {
            switch (stopType)
            {
            case SmartQuant.Trading.StopType.Fixed:
                return(StopType.Fixed);

            case SmartQuant.Trading.StopType.Trailing:
                return(StopType.Trailing);

            case SmartQuant.Trading.StopType.Time:
                return(StopType.Time);

            default:
                throw new NotImplementedException("Stop type is not supported : " + stopType);
            }
        }