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,025 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

  #661 (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

@lolu,

yes. all I did was posting a version with the changes below.



dorschden View Post

GomCD:

To use cumulative delta for the swings or divergence you have to uncomment all GomCD regions in the source code. Press "ctrl + F" or the "Find/Replace" button and search for "region GomCD" and uncomment all the regions and compile it. Of course you have to install the Gom package before.


Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Deepmoney LLM
Elite Quantitative GenAI/LLM
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Futures True Range Report
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
Battlestations: Show us your trading desks!
26 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
  #662 (permalink)
 solondon 
London, UK
 
Experience: Intermediate
Platform: ninja,TS,Meta,Tradeguider
Trading: FX,Metals
Posts: 38 since Sep 2011
Thanks Given: 9
Thanks Received: 6

Hi again

trying to pick up and color background with this code but i cant find a good example to code from for dataseries, from the databox i can see VHigh or VLow is set and N/A appears in the one not set so i thought I might have to use a dataseries and test with contains value . However in debugging VHigh allways seems to contain a value. If anyone can help it would be appreciated

 
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.Gui.Chart;
using PriceActionSwingOscillator.Utility;
#endregion

// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
    /// <summary>
    /// Enter the description of your new custom indicator here
    /// </summary>
    [Description("Enter the description of your new custom indicator here")]
    public class aaPASOSCbackcolor : Indicator
    {
        #region Variables
        // Wizard generated variables
        // User defined variables (add any user defined variables below)
			private SwingTypes swingType = SwingTypes.Gann;
			private DataSeries myDataSeries; // Define a DataSeries variable
			private double vhighVal;
		#endregion

        /// <summary>
        /// This method is used to configure the indicator and is called once before any bar data is loaded.
        /// </summary>
        protected override void Initialize()
        {
            Overlay				= true;
			myDataSeries = new DataSeries(this); // "this" refers to the indicator
        }

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            // Use this method for calculating your indicator values. Assign a value to each
            // plot below by replacing 'Close[0]' with your own formula.
			if (CurrentBar < 20) return;
				
			vhighVal=PriceActionSwingOscillator(15, 5, swingType).VHigh[0];
			Print(CurrentBar + "  " + Time[0].ToString()+ " VHigh: " + " " + vhighVal); 
			myDataSeries.Set(vhighVal);
			
			if (myDataSeries.ContainsValue(0))
            {
	            BackColor = Color.FromArgb(50,201,4,14);
            }
            else
            {
                BackColor = Color.FromArgb(50,26,166,10);
            }
        }

        #region Properties

        #endregion
    }
}

#region NinjaScript generated code. Neither change nor remove.
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
    public partial class Indicator : IndicatorBase
    {
        private aaPASOSCbackcolor[] cacheaaPASOSCbackcolor = null;

        private static aaPASOSCbackcolor checkaaPASOSCbackcolor = new aaPASOSCbackcolor();

        /// <summary>
        /// Enter the description of your new custom indicator here
        /// </summary>
        /// <returns></returns>
        public aaPASOSCbackcolor aaPASOSCbackcolor()
        {
            return aaPASOSCbackcolor(Input);
        }

        /// <summary>
        /// Enter the description of your new custom indicator here
        /// </summary>
        /// <returns></returns>
        public aaPASOSCbackcolor aaPASOSCbackcolor(Data.IDataSeries input)
        {
            if (cacheaaPASOSCbackcolor != null)
                for (int idx = 0; idx < cacheaaPASOSCbackcolor.Length; idx++)
                    if (cacheaaPASOSCbackcolor[idx].EqualsInput(input))
                        return cacheaaPASOSCbackcolor[idx];

            lock (checkaaPASOSCbackcolor)
            {
                if (cacheaaPASOSCbackcolor != null)
                    for (int idx = 0; idx < cacheaaPASOSCbackcolor.Length; idx++)
                        if (cacheaaPASOSCbackcolor[idx].EqualsInput(input))
                            return cacheaaPASOSCbackcolor[idx];

                aaPASOSCbackcolor indicator = new aaPASOSCbackcolor();
                indicator.BarsRequired = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                Indicators.Add(indicator);
                indicator.SetUp();

                aaPASOSCbackcolor[] tmp = new aaPASOSCbackcolor[cacheaaPASOSCbackcolor == null ? 1 : cacheaaPASOSCbackcolor.Length + 1];
                if (cacheaaPASOSCbackcolor != null)
                    cacheaaPASOSCbackcolor.CopyTo(tmp, 0);
                tmp[tmp.Length - 1] = indicator;
                cacheaaPASOSCbackcolor = tmp;
                return indicator;
            }
        }
    }
}

// This namespace holds all market analyzer column definitions and is required. Do not change it.
namespace NinjaTrader.MarketAnalyzer
{
    public partial class Column : ColumnBase
    {
        /// <summary>
        /// Enter the description of your new custom indicator here
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.aaPASOSCbackcolor aaPASOSCbackcolor()
        {
            return _indicator.aaPASOSCbackcolor(Input);
        }

        /// <summary>
        /// Enter the description of your new custom indicator here
        /// </summary>
        /// <returns></returns>
        public Indicator.aaPASOSCbackcolor aaPASOSCbackcolor(Data.IDataSeries input)
        {
            return _indicator.aaPASOSCbackcolor(input);
        }
    }
}

// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
    public partial class Strategy : StrategyBase
    {
        /// <summary>
        /// Enter the description of your new custom indicator here
        /// </summary>
        /// <returns></returns>
        [Gui.Design.WizardCondition("Indicator")]
        public Indicator.aaPASOSCbackcolor aaPASOSCbackcolor()
        {
            return _indicator.aaPASOSCbackcolor(Input);
        }

        /// <summary>
        /// Enter the description of your new custom indicator here
        /// </summary>
        /// <returns></returns>
        public Indicator.aaPASOSCbackcolor aaPASOSCbackcolor(Data.IDataSeries input)
        {
            if (InInitialize && input == null)
                throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");

            return _indicator.aaPASOSCbackcolor(input);
        }
    }
}
#endregion

Reply With Quote
  #663 (permalink)
 winslow1 
laconia +nh/us
 
Experience: Intermediate
Platform: Jigsaw on Ninja Trader
Trading: ZN
Posts: 1 since Jun 2012
Thanks Given: 1
Thanks Received: 0


Does anyone know of an add-on to this that would take the ratio of volume to ticks for each swing and place it where the volume and ticks are plotted, or something of that nature?

Reply With Quote
  #664 (permalink)
 O66NL 
Netherlands
 
Experience: Advanced
Platform: MC+ ninja+ irt
Posts: 25 since Mar 2010
Thanks Given: 11
Thanks Received: 14


Silvester17 View Post
many are still struggling to use gom cd as a divergence indicator.

if it's ok, I post a version of the price action swing pro indicator that can be used with gom cd. (all the necessary changes are already made) if not, let me know and I'll delete the file.


thanks for this.

i can select gomcd as divergence indicator but dont see the gomcd settings window

see 2013-01-22_2053 - Relact's library

the divergences arent plotted....

any ideas?

Reply With Quote
  #665 (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


O66NL View Post
thanks for this.

i can select gomcd as divergence indicator but dont see the gomcd settings window

see 2013-01-22_2053 - Relact's library

the divergences arent plotted....

any ideas?

@O66NL,

as far as I know you can't change the settings unless you change them in the code:

 
Code
 private ShowGomCD showGomCD = ShowGomCD.SwingCD_And_AbsoluteCD;
        private int textOffsetGomCd = 60;
        private GomCD gomCdAll;
        private GomFilterModeType gomCdVolumeFilterSizeMode = GomFilterModeType.None;
        private GomCDCalculationModeType gomCdCalcMode = GomCDCalculationModeType.BidAsk;
        private int gomCdVolumeFilterSize = 1;
        private int gomCdAllSwingLowValue = 0;
        private int gomCdAllSwingHighValue = 0;
        private int curHighGomCdAll = 0;
        private int curLowGomCdAll = 0;
        private int lastHighGomCdAll = 0;
        private int lastLowGomCdAll = 0;

also don't forget you need to record data in order to see the gom cd divergence.

Reply With Quote
Thanked by:
  #666 (permalink)
 coolma1973 
San Mateo
 
Experience: Beginner
Platform: Ninja Trader
Trading: es/ eur/usd/oil/gold
Posts: 10 since Jun 2012
Thanks Given: 2
Thanks Received: 0

My Indicator don't have the Gom CD specs? Please help. Thanks

Reply With Quote
  #667 (permalink)
lakie12
Toronto Ontario Canada
 
Posts: 2 since Jan 2013
Thanks Given: 12
Thanks Received: 0

Many thanks for this indi.

Reply With Quote
  #668 (permalink)
 
gretzkyless's Avatar
 gretzkyless 
Chicago, IL/USA
 
Experience: Intermediate
Platform: Ninja Trader
Broker: AMP Trading - CQG/ThinkorSwim
Trading: Futures
Posts: 30 since Jan 2013
Thanks Given: 13
Thanks Received: 19

Could someone please let me know if there is a different 'PriceActionSwing' or 'PriceActionSwingPro' indicator I should be using? Attached is a screen print with both indicators being used and no DT dot in either double top that is outlined was plotted. I have also attached the indicators as well.

Attached Thumbnails
Click image for larger version

Name:	ES 5-Minute Chart.jpg
Views:	578
Size:	67.9 KB
ID:	100807  
Attached Files
Elite Membership required to download: PriceActionSwing.zip
Elite Membership required to download: PriceActionSwingPro.cs
Elite Membership required to download: PriceActionSwingPro_added_custom_divergence_indicator_rvaluechart.zip
Follow me on Twitter Reply With Quote
  #669 (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


gretzkyless View Post
Could someone please let me know if there is a different 'PriceActionSwing' or 'PriceActionSwingPro' indicator I should be using? Attached is a screen print with both indicators being used and no DT dot in either double top that is outlined was plotted. I have also attached the indicators as well.

@gretzkyless,

there's no "swing" in between. your first example, we had a higher high and then in order to have a double top, we would need first a higher low, a lower low or a double bottom. none is the case.

to see the smallest swings, you have to select 1 in "swing size". and to have more double tops and bottoms, you have to increase the "double top / bottom strength".

so the indicators are fine. the latest version is here:

Downloads - Free Section - Big Mike's Trading Forum


Reply With Quote
  #670 (permalink)
 
gretzkyless's Avatar
 gretzkyless 
Chicago, IL/USA
 
Experience: Intermediate
Platform: Ninja Trader
Broker: AMP Trading - CQG/ThinkorSwim
Trading: Futures
Posts: 30 since Jan 2013
Thanks Given: 13
Thanks Received: 19


@Silvester

Thanks for the clarification. I will adjust the numbers until I find what I'm looking for in the indicator.

I was wondering something with the PriceActionSwing indicator. I used the wizard to create a strategy using this indicator to compare to the Higher High and Lower Low bars 2 bars back from the current bar, but the strategy generated an error. I'm new to coding, only 1 week of experience, and thought a simple strategy wizard generated code would be easy to create. Below is what I was trying to accomplish with the strategy:

If the current bar's Low/High is the same as the Lower Low/Higher High in either of the last 2 bars, take a long/short position with a 15 tick trailing stop.

Of course more would need to be included in order for this to be a good strategy, but was trying to make a simple strategy to see how the indicator would enter a position visually.

Attached Files
Elite Membership required to download: DTDB.cs
Follow me on Twitter Reply With Quote
Thanked by:




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