コード例 #1
0
ファイル: Stop.cs プロジェクト: zhuzhenping/OpenQuant.API
 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;
 }
コード例 #2
0
        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);
            }
        }