Exemplo n.º 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;
 }
Exemplo n.º 2
0
        internal static StopMode Convert(FreeQuant.Trading.StopMode stopMode)
        {
            switch (stopMode)
            {
            case FreeQuant.Trading.StopMode.Absolute:
                return(StopMode.Absolute);

            case FreeQuant.Trading.StopMode.Percent:
                return(StopMode.Percent);

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