NexusFi: Find Your Edge


Home Menu

 





PriceActionSwing discussion


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Silvester17 with 177 posts (570 thanks)
    2. looks_two dorschden with 99 posts (1,124 thanks)
    3. looks_3 Big Mike with 52 posts (90 thanks)
    4. looks_4 jmont1 with 51 posts (23 thanks)
      Best Posters
    1. looks_one dorschden with 11.4 thanks per post
    2. looks_two Silvester17 with 3.2 thanks per post
    3. looks_3 Big Mike with 1.7 thanks per post
    4. looks_4 sudhirc with 1.7 thanks per post
    1. trending_up 965,260 views
    2. thumb_up 2,947 thanks given
    3. group 613 followers
    1. forum 2,093 posts
    2. attach_file 615 attachments




 
Search this Thread

PriceActionSwing discussion

  #611 (permalink)
 
Silvester17's Avatar
 Silvester17 
Columbus, OH
Market Wizard
 
Experience: None
Platform: NT 8, TOS
Trading: ES
Posts: 3,603 since Aug 2009
Thanks Given: 5,139
Thanks Received: 11,527


Nowshad View Post
I knew about the Gann paint bars but I was looking for standard swing options paint bars.

@Nowshad,

I added the paint bars. if you would like to try them send me a pm.

out of respect, I'm not going to post that modified indicator here.


Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
Deepmoney LLM
Elite Quantitative GenAI/LLM
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Futures True Range Report
The Elite Circle
 
  #612 (permalink)
 davidepalmer01 
Duluth GA USA
 
Experience: Intermediate
Platform: Ninjatrader
Trading: 6e and YM
Posts: 33 since Jul 2012
Thanks Given: 78
Thanks Received: 36

Nowshad, Thx for your help here. I would appreciate getting the updated indicator for PAS with the color candles for std swings. I use std swings also and really appreciate your work here. A post in the thread would be fine great. Thx for sharing.
David Palmer

Reply With Quote
Thanked by:
  #613 (permalink)
 
Nowshad's Avatar
 Nowshad 
Los Angeles, California
 
Experience: Intermediate
Platform: Tradestation Ninja TOS
Broker: AMP Tradestation TOS
Trading: ES NQ CL 6E
Posts: 46 since May 2010
Thanks Given: 15
Thanks Received: 14


Davidepalmer01, Silvester says he created the standard paintbars options for PAS (see above post) but its only available privately "out of respect" to the original . You should contact him about it.

Reply With Quote
  #614 (permalink)
 davidepalmer01 
Duluth GA USA
 
Experience: Intermediate
Platform: Ninjatrader
Trading: 6e and YM
Posts: 33 since Jul 2012
Thanks Given: 78
Thanks Received: 36

I will.
David Palmer

Reply With Quote
  #615 (permalink)
charllie1
london
 
Posts: 9 since Nov 2012
Thanks Given: 2
Thanks Received: 1

Hi,

I am trying to get a trailing stop to trail swing lows/high by x amount of ticks.

I am also trying to draw the Swings in a back test environment what code would i need for this.

Thanks in advance for any help !!

BW

C

Reply With Quote
  #616 (permalink)
 
Nowshad's Avatar
 Nowshad 
Los Angeles, California
 
Experience: Intermediate
Platform: Tradestation Ninja TOS
Broker: AMP Tradestation TOS
Trading: ES NQ CL 6E
Posts: 46 since May 2010
Thanks Given: 15
Thanks Received: 14

I wish I could paint the bars to match the PriceActionSwingOscillator's wave volume color. I know it adjusts the color after confirmation but it would be logical and asthetically awesome to look at the price bars and wave volume in harmony. Unfortunately I am not a programming guru.

Reply With Quote
  #617 (permalink)
 resist 
Berlin Germany /Alicante Spain
 
Experience: Intermediate
Platform: NinjaTrader
Broker: DDT/Rithmic, Global/CQG, IB, Mirus(Ninja)/MarketDelta
Trading: Futures
Posts: 141 since Jan 2010
Thanks Given: 362
Thanks Received: 67

Dear members,
I want to take the trend direction from the PAS Oscillator as a basic of a simple trend following strategy. As I am no programmer I try to use the strategy wizard to do this but I think I have to copy a little code in because I cannot find a value for long or short trend in the oscillator indicator rows to compare in the wizard.

Could anyone send me the code for the rules I have to copy in the strategy code for long trend and short trend?

I really looked throug all 60 or more pages of this thread, on page 18 and following I think I found something about DT, DB, HH and LL but I really want to keep it simple, only making long trades when trend or swings show long and shorts when they how short.

Thank you for helping,
kind regards.
resist

Reply With Quote
  #618 (permalink)
charllie1
london
 
Posts: 9 since Nov 2012
Thanks Given: 2
Thanks Received: 1

Hi Folks,

I am playing around with the code below, i can get it compile using the pasO, however using this indicator the SwingRelation and SwingTrend seem to signal daily, not sure why this !!

Trying to use then on the pasPro i get the following errors

'NinjaTrader.Indicator.PriceActionSwing' does not contain a definition for 'SwingTrend' and no extension method 'SwingTrend' accepting a first argument of type 'NinjaTrader.Indicator.PriceActionSwing' could be found (are you missing a using directive or an assembly reference?)

and

'NinjaTrader.Indicator.PriceActionSwing' does not contain a definition for 'SwingRelation' and no extension method 'SwingRelation' accepting a first argument of type 'NinjaTrader.Indicator.PriceActionSwing' could be found (are you missing a using directive or an assembly reference?)

I have tried looking at the source code of the pasPro, read everything on this thread regarding this issue and have draw a blank. Any help would be greatly appreciated !!

Many thanks

Charlie



 
Code
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
using PriceActionSwing.Utility;

#endregion

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
    /// <summary>
    /// Enter the description of your strategy here
    /// </summary>
    [Description("Enter the description of your strategy here")]
    public class SwingTrendx : Strategy
{
        #region Variables
        // Wizard generated variables
		private int swingSize = 3; 
		private SwingTypes swingType = SwingTypes.Gann
		private int dtbStrength = 15; 
		private IDataSeries swingTrend; 
		private IDataSeries swingRelation; 
        private double dpt = 190.000; // Default setting for Daily Profit Target
        private int profit = 10; // Default setting for Profit
        private int stop = 15; // Default setting for Stop
        private int saftyStopLoss = 30; // 
        private double multBBs = 0.100;
        private double drdw = 600.000; // Default setting for Max Draw Down per Day
        private double maxtrades = 40.000; // Default setting for Max Trades
        int entryBar = 0;
        bool alreadyEnteredThisBar = false;
        private int priorTradesCount = 0;
        private double priorTradesCumProfit = 0;


        // User defined variables (add any user defined variables below)
        #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()
        {
            SetStopLoss("", CalculationMode.Ticks, SaftyStopLoss, false);
            //SetProfitTarget("", CalculationMode.Ticks, Profit);
            //SetTrailStop("", CalculationMode.Ticks, Stop, false);
            // SetStopLoss("", CalculationMode.Ticks, Stop, false);

            CalculateOnBarClose = true;
            TraceOrders = true;
        }

//        protected override void OnOrderTrace(DateTime timestamp, string message)
//        {
//            log("{0} Trace Order: {1}", timestamp, message);
//        }

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {

			
            // At the start of a new session
            if (Bars.FirstBarOfSession)
            {
                priorTradesCount = Performance.AllTrades.Count;
                priorTradesCumProfit = Performance.AllTrades.TradesPerformance.Currency.CumProfit;

            }

//            if (Performance.AllTrades.TradesPerformance.Currency.CumProfit - priorTradesCumProfit >= DPT
//                    || Performance.AllTrades.TradesPerformance.Currency.CumProfit - priorTradesCumProfit <= -DRDW
//                    || Performance.AllTrades.Count - priorTradesCount == MaxTrades)
//            {
//                CancelAllOrders(true, false);
//                ExitMarket("DailyLimits");
//                return;
//            }

			if (CurrentBar < 1) 
			{ 
				if (swingTrend == null) 
		if (swingTrend == null) 
				swingTrend = PriceActionSwing(Input, dtbStrength, swingSize, swingType).SwingTrend; 
				if (swingRelation == null) 
				swingRelation = PriceActionSwing(Input, dtbStrength, swingSize, swingType).SwingRelation; 
			} 
			int trend = Convert.ToInt32(swingTrend[0]); 
			switch (trend) 
			{ 
			case -1: 
				// Down trend - do something 
			
				if (Position.MarketPosition == MarketPosition.Flat &&

                  ToTime(Time[0]) > ToTime(9, 00, 00)
                  && ToTime(Time[0]) < ToTime(14, 0, 0)
                  && CurrentBar != entryBar && alreadyEnteredThisBar == false
                  && MACD(12, 26, 5)[0] <= 0 
                 
                  && Close[0] < EMA(52)[0]
                  
                  && High[0] + 5.5 * TickSize >= EMA(52)[0]
                  && Close[0] == Low[0])
            {
                alreadyEnteredThisBar = true;
                entryBar = CurrentBar;


                EnterShort(DefaultQuantity, "S1");

            }
				
					break; 
			case 1: 
				// Up trend - do something 
				
					if (Position.MarketPosition == MarketPosition.Flat &&

                ToTime(Time[0]) > ToTime(9, 00, 00)
                && ToTime(Time[0]) < ToTime(14, 0, 0)
                && CurrentBar != entryBar && alreadyEnteredThisBar == false
                && MACD(12, 26, 5)[0] >= 0
                
                && Close[0] > EMA(52)[0]
                
                 && Low[0] + -5.5 * TickSize <= EMA(52)[0]
                 && Close[0] == High[0])
            {
                alreadyEnteredThisBar = true;
                entryBar = CurrentBar;

                EnterLong(DefaultQuantity, "L1");
                //EnterLong(DefaultQuantity, "Lg 1");

            }
					
					
					
					
					break; 
			default: 
				// No trend - do something or nothing 
				break; 
			} 

			
			

            alreadyEnteredThisBar = false;
            //*************************  exit condition 

           
            if (Position.MarketPosition != MarketPosition.Flat)
            {
                int pnl = (int) Math.Round(Position.GetProfitLoss(Close[0], PerformanceUnit.Points) / TickSize);

                if (Close[0] <= EMA(52)[0] + -3 * TickSize
                    || pnl <= Stop * -1 
                    || pnl >= Profit)
                {
                    ExitLong("X1", "L1");
                }


                if (Close[0] >= EMA(52)[0] + 3 * TickSize
                    || pnl <= Stop * -1
                    || pnl >= Profit)
                {
                    ExitShort("Xs1", "S1");
                }


            }
            //
        }

        #region Properties
        [Description("")]
        [GridCategory("Parameters")]
        public double MultBBs
        {
            get { return multBBs; }
            set { multBBs = Math.Max(0.0001, value); }
        }

        [Description("")]
        [GridCategory("Parameters")]
        public double DPT
        {
            get { return dpt; }
            set { dpt = Math.Max(1, value); }
        }
        [Description("")]
        [GridCategory("Parameters")]
        public double DRDW
        {
            get { return drdw; }
            set { drdw = Math.Max(1, value); }
        }
        [Description("")]
        [GridCategory("Parameters")]
        public double MaxTrades
        {
            get { return maxtrades; }
            set { maxtrades = Math.Max(1, value); }
        }
        [Description("")]
        [GridCategory("Parameters")]
        public int Profit
        {
            get { return profit; }
            set { profit = Math.Max(1, value); }
        }

        [Description("")]
        [GridCategory("Parameters")]
        public int Stop
        {
            get { return stop; }
            set { stop = Math.Max(1, value); }
        }

        [Description("")]
        [GridCategory("Parameters")]
        public int SaftyStopLoss
        {
            get { return saftyStopLoss; }
            set { saftyStopLoss = Math.Max(5, value); }
        }

        #endregion
    }
}

Reply With Quote
  #619 (permalink)
 Aregon 
Queensland, Australia
 
Experience: Intermediate
Platform: NinjaTrader
Broker: NinjaTrader Brokerage
Trading: micro emini's
Posts: 62 since Sep 2009
Thanks Given: 374
Thanks Received: 88

I'm trying to utilise the AB=CD audio alerts but nothing shows up in the "Alerts Window" or triggers the wav files.
I have the wav files in the respective folder.
I've included an example of a 6E 15min chart where 2 swings are equal.
Have I overlooked something ?
Any help would be greatly appreciated !!

Attached Thumbnails
Click image for larger version

Name:	PASPro audio alerts.png
Views:	316
Size:	66.0 KB
ID:	95420  
Reply With Quote
  #620 (permalink)
 
cal1152's Avatar
 cal1152 
Charleston, SC
 
Experience: Intermediate
Platform: NT7, TS2
Broker: FXCM
Trading: GC, CL, 6E, FX
Posts: 68 since Sep 2011
Thanks Given: 497
Thanks Received: 65



Aregon View Post
I'm trying to utilise the AB=CD audio alerts but nothing shows up in the "Alerts Window" or triggers the wav files.
I have the wav files in the respective folder.
I've included an example of a 6E 15min chart where 2 swings are equal.
Have I overlooked something ?
Any help would be greatly appreciated !!

@Aregon

Have you configured the Market Analyzer Alerts section for audio alerts yet? I get alerts on my MA screen, then I also get Alerts on the NT7 Alert screen, and I get audio alerts when there is a AB=CD formation, which includes what time frame the formation occurred. To do that you will need to configure the column and alert properties in MA.

If that is what you're wanting check out posts 520 through 523. That info should help. Also, I attached a few screenshots.

Cal






Reply With Quote




Last Updated on January 7, 2024


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts