Exemple #1
0
 internal Stop(Position position, double level, StopType type, StopMode mode)
 {
     this.position = position;
     FreeQuant.Trading.StopType stopType = EnumConverter.Convert(type);
     FreeQuant.Trading.StopMode stopMode = EnumConverter.Convert(mode);
     this.stop = new ATSStop(position.position, level, stopType, stopMode);
     ((StopBase)this.stop).TrailOnHighLow = true;
     ((StopBase)this.stop).TraceOnBarOpen = true;
     ((StopBase)this.stop).TraceOnBar     = true;
     ((StopBase)this.stop).TraceOnQuote   = true;
     ((StopBase)this.stop).TraceOnTrade   = true;
 }
Exemple #2
0
        internal static StopType Convert(FreeQuant.Trading.StopType stopType)
        {
            switch (stopType)
            {
            case FreeQuant.Trading.StopType.Fixed:
                return(StopType.Fixed);

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

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

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