Exemple #1
0
        private void stop_StatusChanged(StopEventArgs args)
        {
            ATSStop atsStop = args.Stop as ATSStop;

            if (((StopBase)atsStop).Status != null)
            {
                this.activeStops[((StopBase)atsStop).Instrument].Remove(atsStop);
                // ISSUE: method pointer
                atsStop.StatusChanged -= new StopEventHandler(this.stop_StatusChanged);
            }
            if (((StopBase)atsStop).Status != FreeQuant.Trading.StopStatus.Executed)
            {
                return;
            }
            try
            {
                Strategy strategy = (Strategy)null;
                if (!this.strategies.TryGetValue(((StopBase)atsStop).Instrument, out strategy))
                {
                    return;
                }
                strategy.OnStopExecuted(Map.FQ_OQ_Stop[(object)atsStop] as OpenQuant.API.Stop);
            }
            catch (Exception ex)
            {
                this.EmitError(ex);
            }
        }
Exemple #2
0
        public StopView(ATSStop stop, Pad pad)
        {
            this.J5OcWhbyeL     = Color.Yellow;
            this.jxFcFido6J     = Color.MediumSeaGreen;
            this.nFpcIDd3Ej     = Color.Gray;
            this.nkbcpi5r41     = stop;
            this.pad            = pad;
            this.ToolTipEnabled = true;
            this.ToolTipFormat  = stop.Position.Instrument.PriceDisplay;
            int index1 = pad.Series.GetIndex(stop.CreationTime, EIndexOption.Prev);

            if (index1 == -1)
            {
                return;
            }
            this.chartFirstDate = pad.Series.GetDateTime(index1);
            if (stop.Status != StopStatus.Active)
            {
                int index2 = pad.Series.GetIndex(stop.CompletionTime, EIndexOption.Prev);
                this.chartLastDate = pad.Series.GetDateTime(index2);
            }
            else
            {
                this.chartLastDate = DateTime.MaxValue;
            }
        }
Exemple #3
0
 internal Stop(Position position, DateTime dateTime)
 {
     this.position = position;
     this.stop     = new ATSStop(position.position, dateTime);
     ((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 #4
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 #5
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;
 }
Exemple #6
0
        private void Map_StopAdded(object sender, EventArgs args)
        {
            object[] objArray = sender as object[];
            ATSStop  stop     = objArray[0] as ATSStop;

            this.strategies[objArray[1] as string].SetStopAdded(stop);
            this.stops.Add(stop);
            if (this.StopAdded == null)
            {
                return;
            }
            this.StopAdded.Invoke(new StopEventArgs((IStop)stop));
        }
Exemple #7
0
        public void SetStopAdded(ATSStop stop)
        {
            this.stops.Add(stop);
            List <ATSStop> list = (List <ATSStop>)null;

            if (!this.activeStops.TryGetValue(((StopBase)stop).Instrument, out list))
            {
                list = new List <ATSStop>();
                this.activeStops[((StopBase)stop).Instrument] = list;
            }
            list.Add(stop);
            // ISSUE: method pointer
            stop.StatusChanged += new StopEventHandler(this.stop_StatusChanged);
            if (this.StopAdded == null)
            {
                return;
            }
            this.StopAdded.Invoke(new StopEventArgs((IStop)stop));
        }
Exemple #8
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;
		}
Exemple #9
0
		internal Stop(Position position, DateTime dateTime)
		{
			this.position = position;
			this.stop = new ATSStop(position.position, dateTime);
			this.stop.TrailOnHighLow = true;
			this.stop.TraceOnBarOpen = true;
			this.stop.TraceOnBar = true;
			this.stop.TraceOnQuote = true;
			this.stop.TraceOnTrade = true;
		}