/// <summary> /// Create Short Order and Stop. /// </summary> private void DoEnterShort() { _orderentershort = SubmitOrder(new StrategyOrderParameters { Direction = OrderDirection.Sell, Type = OrderType.Market, Quantity = GlobalUtilities.AdjustPositionToRiskManagement(this.Root.Core.AccountManager, this.Root.Core.PreferenceManager, this.Instrument, Bars[0].Close), SignalName = this.GetType().Name + " " + PositionType.Short + "_" + this.Instrument.Symbol + "_" + Bars[0].Time.Ticks.ToString(), Instrument = this.Instrument, TimeFrame = this.TimeFrame }); SetUpStopLoss(_orderentershort.Name, CalculationMode.Price, Bars[0].Close * 1.05, false); SetUpProfitTarget(_orderentershort.Name, CalculationMode.Price, Bars[0].Close / 1.11); }
/// <summary> /// Create Long Order and Stop. /// </summary> private void DoEnterLong() { _orderenterlong = EnterLong(GlobalUtilities.AdjustPositionToRiskManagement(this.Root.Core.AccountManager, this.Root.Core.PreferenceManager, this.Instrument, Bars[0].Close), this.GetType().Name + " " + PositionType.Long + "_" + this.Instrument.Symbol + "_" + Bars[0].Time.Ticks.ToString(), this.Instrument, this.TimeFrame); //SetStopLoss(_orderenterlong.Name, CalculationMode.Price, this._orb_indicator.RangeLow, false); //SetStopLoss(_orderenterlong.Name, CalculationMode.Price, Bars[0].Close * 0.95, false); //SetStopLoss(_orderenterlong.Name, CalculationMode.Price, this._orb_indicator.RangeLow, false); //SetProfitTarget(_orderenterlong.Name, CalculationMode.Price, this._orb_indicator.TargetLong); }
private void DoEnterShort() { _orderentershort = SubmitOrder(new StrategyOrderParameters { Direction = OrderDirection.Sell, Type = OrderType.Market, Quantity = GlobalUtilities.AdjustPositionToRiskManagement(this.Root.Core.AccountManager, this.Root.Core.PreferenceManager, this.Instrument, Bars[0].Close), SignalName = "PopGun_Short_" + this.Instrument.Symbol + "_" + Bars[0].Time.Ticks.ToString(), Instrument = this.Instrument, TimeFrame = this.TimeFrame }); if (UseStopLoss) { SetUpStopLoss(_orderentershort.Name, CalculationMode.Price, this._popgun_indicator.PopGunTriggerLong, false); } if (UseTrailingStop) { SetUpTrailStop(_orderenterlong.Name, CalculationMode.Ticks, 10, false); } //SetUpProfitTarget(_orderentershort.Name, CalculationMode.Price, <<<<TARGET>>>>); }
/// <summary> /// Create Short Order and Stop. /// </summary> private void DoEnterShort() { if (this._orderentershort == null) { string entryreason = "ORB_Short_" + this.Instrument.Symbol + "_" + Bars[0].Time.Ticks.ToString(); _orderentershort = SubmitOrder(new StrategyOrderParameters { Direction = OrderDirection.Sell, Type = OrderType.Market, Quantity = GlobalUtilities.AdjustPositionToRiskManagement(this.Root.Core.AccountManager, this.Root.Core.PreferenceManager, this.Instrument, Bars[0].Close), SignalName = entryreason, Instrument = this.Instrument, TimeFrame = this.TimeFrame }); if (this.UseStopLoss) { SetUpStopLoss(_orderentershort.Name, CalculationMode.Price, this._orb_indicator.RangeHigh, false); } if (this.UseProfitTarget) { SetUpProfitTarget(_orderentershort.Name, CalculationMode.Price, this._orb_indicator.TargetShort); } if (this.StatisticBacktesting) { _statisticshort = new Statistic(this, PositionType.Short); this._statisticshort.SetEntry(entryreason, _orderentershort.Quantity, Bars[0].Close, Bars[0].Time, OrderType.Market); } } }
/// <summary> /// Create Short Order and Stop. /// </summary> private void DoEnterShort() { _orderentershort = EnterShort(GlobalUtilities.AdjustPositionToRiskManagement(this.Root.Core.AccountManager, this.Root.Core.PreferenceManager, this.Instrument, Bars[0].Close), "ORB_Short_" + this.Instrument.Symbol + "_" + Bars[0].Time.Ticks.ToString(), this.Instrument, this.TimeFrame); SetStopLoss(_orderentershort.Name, CalculationMode.Price, this._orb_indicator.RangeHigh, false); SetProfitTarget(_orderentershort.Name, CalculationMode.Price, this._orb_indicator.TargetShort); }
/// <summary> /// Create SHORT order. /// </summary> private void DoEnterShort() { if (_orderentershort == null) { _orderentershort = SubmitOrder(new StrategyOrderParameters { Direction = OrderDirection.Sell, Type = OrderType.Market, Quantity = GlobalUtilities.AdjustPositionToRiskManagement(this.Root.Core.AccountManager, this.Root.Core.PreferenceManager, this.Instrument, Bars[0].Close), SignalName = this.DisplayName + "_" + OrderDirection.Sell + "_" + this.Instrument.Symbol + "_" + Bars[0].Time.Ticks.ToString(), Instrument = this.Instrument, TimeFrame = this.TimeFrame }); //SetUpStopLoss(_orderentershort.Name, CalculationMode.Price, this._orb_indicator.RangeHigh, false); //SetUpProfitTarget(_orderentershort.Name, CalculationMode.Price, this._orb_indicator.TargetShort); } }