Exemplo n.º 1
0
        //NinjaTrader.Indicator.PriceActionSwingOscillator so = null;

        #endregion

        /// <summary>
        /// This method is used to configure the strategy and is called once before any strategy method is called.
        ///
        /// </summary>
        protected override void Initialize()
        {
            //int dtbStrength = Iparm1;
            //int swingSize = Iparm2;
            //atrTimes = dparm1;
            //atrPeriod = period1;

            atr = ATRTrailing(atrTimes, AtrPeriod, Ratched);
            atr.PaintPriceMarkers = false;
            atr.AutoScale         = false;
            Add(atr);

            ema = EMA(period1);
            Add(ema);

            hma = HMARick(period2, 100);
            Add(hma);

//			dc = DonchianChannel(Period1);
//			dc.Displacement = 1;
//			dc.PaintPriceMarkers = false;
//			Add(dc);

            Add(PitColor(Color.Blue, 80000, 15, 140000));

            //SetProfitTarget(CalculationMode.Ticks, Iparm1);
            //SetStopLoss(CalculationMode.Ticks, Iparm2);
            //SetTrailStop(CalculationMode.Ticks, Iparm2);

            Unmanaged           = false;
            BarsRequired        = 10;
            CalculateOnBarClose = true;
            ExitOnClose         = true;
            IncludeCommission   = true;
        }
Exemplo n.º 2
0
        double priceEst       = 0.0;    // used to estimate where the signal line will be before that bar is created

        #endregion

        protected override void OnStartUp()
        {
            signal       = HMA(signalLinePeriod);
            dynamicTrend = HMARick(trendBand, Threshold);
            priceTrigger = SMARick(priceTriggerPeriod);
            slowSignal   = SMA(slowSignalPeriod);

            dynamicTrend.DownColor         = Color.Purple;
            dynamicTrend.UpColor           = Color.DarkCyan;
            dynamicTrend.PaintPriceMarkers = false;
        }
Exemplo n.º 3
0
        /// <summary>
        /// This method is used to configure the strategy and is called once before any strategy method is called.
        /// </summary>
        protected override void Initialize()
        {
            t3 = this.T3(14, 3, 0.7);
            Add(t3);

            hma = this.HMARick(55, 50);
            Add(hma);

            Add(VHF(14, 0.35));

            Add(PitColor(Color.Black, 80000, 25, 161500));

            CalculateOnBarClose = true;
        }
Exemplo n.º 4
0
        /// <summary>
        /// This method is used to configure the strategy and is called once before any strategy method is called.
        ///
        /// E-Mini Scalper: Trying to simulate trade2live.com or eminiTradingStrategy.com autotrader
        ///
        /// Puts on positions on a pull back of a strong trend.
        ///
        /// Ref:
        ///  http://trade2live.com/
        ///  http://scalpingemini.com/
        ///
        /// </summary>
        protected override void Initialize()
        {
            // Secondary bar which will be used when entering trades
            // this will be the bar which contains the buy/sell orders
            Add("ES 03-15", PeriodType.Minute, 5);

            // Indicator Setup
            // ---------------
            hma = HMARick(Period1, 100);
            hma.PaintPriceMarkers = false;
            Add(hma);

            Add(PitColor(Color.Black, 83000, 25, 161500));

            atr = ATR(Period2);
            Add(atr);

            atrTrailing = ATRTrailing(atrTimes, Period2, Ratched);
            //Add(atrTrailing);

            kc = KeltnerChannel(offsetMultiplier, Period3);
            //Add(kc);

            Add(FiveBarPattern());

//			dc = DonchianChannel(donchianPeriod);
//			dc.Displacement = 2;
//			dc.PaintPriceMarkers = false;
//			Add(dc);

            Unmanaged = true;                                   // Use unmanaged order methods
            // Methods BarsSinceEntry() and BarsSinceExit() are usuable in Unmanaged orders

            // Managed Properties
            // --------------------
            //EntriesPerDirection = 2;
            //EntryHandling = EntryHandling.UniqueEntries;
            //SetProfitTarget("", CalculationMode.Percent, dparm2);
            //SetStopLoss("", CalculationMode.Percent, dparm2, false);
            //SetTrailStop("", CalculationMode.Percent, dparm2, false);

            //Slippage = 2;
            BarsRequired        = 22;
            CalculateOnBarClose = true;         // Onbar update happens only on the start of a new bar vrs each tick
            ExitOnClose         = true;         // Closes open positions at the end of the session
            IncludeCommission   = true;         // Commissions are used in the calculation of the profit/loss
            TraceOrders         = false;        // Trace orders in the output window, used for debugging, normally false
        }
Exemplo n.º 5
0
        /// <summary>
        /// This method is used to configure the strategy and is called once before any strategy method is called.
        /// </summary>
        protected override void Initialize()
        {
            ClearOutputWindow();
            // re-trigger on each tick - may not be required with unmanaged order entry, yet to be determined
            CalculateOnBarClose = false;
            // Use Unmanaged order methods
            Unmanaged = true;

            // Triggers the exit on close function 60 min prior to session end
            // Note: This property is a real-time only property.
            ExitOnClose        = true;
            ExitOnCloseSeconds = 3600;                  // 60 min before session close
            TimeInForce        = Cbi.TimeInForce.Day;

            Add(PitColor(Color.Black, 83000, 25, 161500));
            Add(TickCounter(true, false));

            switch (selectedMAType)
            {
            case MAType.HMARick:
            {
                trendPlot                        = HMARick(TrendPlotPeriod, Threshold);
                trendPlot.DownColor              = Color.Purple;
                trendPlot.UpColor                = Color.DarkCyan;
                trendPlot.NeutralColor           = Color.WhiteSmoke;
                trendPlot.Plots[0].Pen.DashStyle = DashStyle.Solid;
                trendPlot.Plots[0].Pen.Width     = 2;
                trendPlot.PaintPriceMarkers      = false;
                Add(trendPlot);
                break;
            }
//				case MAType.SMARick:
//				{
//					trendPlot = SMARick(TrendPlotPeriod);
//					trendPlot.PaintPriceMarkers = false;
//					Add(trendPlot);
//					break;
//				}
            }


//			signal = HMARick(signalLinePeriod, 60);
//			signal.Plots[0].Pen.Color = Color.DimGray;
//			signal.Plots[0].Pen.DashStyle = DashStyle.Solid;
//			signal.Plots[0].Pen.Width = 2;
//			signal.PaintPriceMarkers = false;
//			Add(signal);

//			slowSignal = EMA(slowSignalPeriod);
//			slowSignal.Plots[0].Pen.Color = Color.DimGray;
//			slowSignal.PaintPriceMarkers = false;
//			Add(slowSignal);

            //MAType maType = SMARick.class;
            stoc = StochasticsCycles(stocD, stocK, MAType.HMARick, false, false, stocS, Threshold, 3, TrendPlotPeriod);
            Add(stoc);

            macd = MACDRick2(Color.Green, Color.Red, true, macdFast, 25, macdSlow, macdSmooth);
            macd.Lines[0].Pen.Width = 10;
            Add(macd);


//
//			Add(HMARick(70, 70));


//			stoc = StochasticsCycles(stocD, stocK, false, false, stocS, Threshold, 3, TrendPlotPeriod);
//			stoc.Plots[0].Pen.Color = Color.Blue; // D color
//			stoc.Plots[0].Pen.Width = 2;
//			stoc.Lines[0].Pen.Color = Color.Black; // Lower
//          stoc.Lines[0].Pen.DashStyle = DashStyle.Dot;
//			stoc.Lines[0].Pen.Width = 2;
//			stoc.Plots[1].Pen.Color = Color.Black; // K color
//			stoc.Lines[1].Pen.Color = Color.Black; // Upper
//			stoc.Lines[1].Pen.DashStyle = DashStyle.Dot;
//			stoc.Lines[1].Pen.Width = 2;
//          Add(stoc);

            TraceOrders = enableTraceOrders;
        }