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

  #491 (permalink)
 
dee50's Avatar
 dee50 
cordoba spain
 
Experience: Intermediate
Platform: ninjatrader
Trading: 6E
Posts: 71 since Feb 2011
Thanks Given: 77
Thanks Received: 38


dorschden View Post
To answer the divergence questions I wrote some instructions.

With the PriceActionSwingPro we can very easily create divergence signals based on any indicator or oscillator with a few tweaks in the code. The only requirement is that the base indicator has a plot or a public data series output to access the base indicator values within the PriceActionSwingPro.

To get the names of the data series that save the base indicator values you can look in the base indicators source code in the "properties" region for the words "public dataseries" and the word after this two words is the data series name.

E.g. the MACD has three different values where we can calculate the divergence on.
1. macd value (Plot name: "Macd" = DataSeries name: "Default" = "Value")
2. average value (Plot name = DataSeries name: "Avg")
3. difference value (Plot name = DataSeries name: "Diff")

If the indicator has no public data series but plots values like the FisherTransformation than the name of the public data series is "Value".

Now we have the name of the data series where all the values from the base indicator are saved and which one we want to compare against the swings to calculate the divergence.

The next step is to change the source code of the PriceActionSwingPro. NT's standard FisherTransformation will be used as example.

1. Create a variable of the base indicator in the region "Variables" in line 52.

private FisherTransform fisherTransform;

2. Change the "divergenceMode" to custom in the region "Variables" in line 138.

private DivergenceMode divergenceMode = DivergenceMode.Custom;

3. Set the parameter of the base indicator in the param1, param2, parem3 variables in line 159. If the base indicator has only one variable use param1. Param2 and param3 are ignored. If the base indicator has more than 3 parameters create another parameter e.g. "param4" and make it public in the "properties" region.

private int param1 = 10;

4. Create the base indicator values. In the region "Create forms" in the region "Divergence" in the "case DivergenceMode.Custom" call the base indicator with the set parameters in line 675.

case DivergenceMode.Custom:
fisherTransform = FisherTransform(param1);
// Add custom divergence indicator here
break;

5. Access the base indicator values. In the "OnBarUpdate" function in the region "Initializes Variables" in the region "Divergence" in the "case DivergenceMode.Custom" access the base indicator values in line 1457.

case DivergenceMode.Custom:
divergenceDataHigh = fisherTransform.Value;
divergenceDataLow = fisherTransform.Value;

// Add custom divergence indicator here
break;

There is a high and a low series two to accomplish divergence calculation where the base indicator values (or another instrument) have a high and a low. e.g. candlesticks. With this solution you can also calculate divergence based on a different instrument, e.g. you have a FDAX chart and calculate divergence on the FESX.

6. And now we are already done! The PriceActionSwingPro indicator will do the rest. Just compile it and load it on a chart or in the market analyzer.

Thank you, now I understand, great instructions, easy to follow.

AND, Thank you for a great Indi, definitely one of the best, I hope people realize and appreciate the vision that is needed to create such a thing of beauty. Dali and Picasso don´t come close!!!

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Build trailing stop for micro index(s)
Psychology and Money Management
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Exit Strategy
NinjaTrader
Deepmoney LLM
Elite Quantitative GenAI/LLM
Are there any eval firms that allow you to sink to your …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
23 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #492 (permalink)
 danjuma 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, IB TWS
Broker: IB, Kinetic
Trading: Stocks, Forex
Posts: 98 since Nov 2011
Thanks Given: 47
Thanks Received: 16

Hello dorschden,

There was a question I asked a while ago, which was kindly answered to some extent by others as you did not seem to be around then. I would like to post the question again for your answer please if I may. Link to original post below:



What I am basically trying to use your indi for is to try and emulate Timothy Ord's (if you have heard of him) volume chart. Basically comparing the the volume of one swing to the next in terms of percentage.

Many thanks.

Dan

Reply With Quote
  #493 (permalink)
 
sudhirc's Avatar
 sudhirc 
detroit,mi
sc
 
Experience: Intermediate
Platform: NT
Broker: NT
Trading: ES
Frequency: Every few months
Duration: Hours
Posts: 417 since Sep 2011
Thanks Given: 1,709
Thanks Received: 471


dorschden,
Thank you for the great indicator and detailed instructions to conficure divergences for custom indicator. (was able to do that for TSI).

Trying to configure for GomCD, I'm having difficulty. I thought i removed all comments as per the instructions on first page, but still could not get the GomCD numbers in there. Can some one please post .cs file with the changes to GomCD?.

Thank you,
sudhirc



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:
  #494 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,174
Thanks Received: 101,539

Just a reminder - do not post Gom stuff in this thread, because this is not an Elite thread.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #495 (permalink)
 
sudhirc's Avatar
 sudhirc 
detroit,mi
sc
 
Experience: Intermediate
Platform: NT
Broker: NT
Trading: ES
Frequency: Every few months
Duration: Hours
Posts: 417 since Sep 2011
Thanks Given: 1,709
Thanks Received: 471


Big Mike View Post
Just a reminder - do not post Gom stuff in this thread, because this is not an Elite thread.

Mike

Sorry, did not realise this.

If willing can post GomCD comments removed that can be used price action indicator at (GomCDRecorder2 forum under elite section)

Thankyou.

Reply With Quote
Thanked by:
  #496 (permalink)
 AlgoBot 
Cincinnati + OH/USA
 
Experience: Intermediate
Platform: Ninjatrader, Bloomberg
Trading: Stocks
Posts: 1 since Jul 2012
Thanks Given: 5
Thanks Received: 0

Hey all -
I could use a little help in understanding how the market analyzer template (PasMa2) sets its Plot = DivergenceSignals. Does the MarketAnalyzer template file have to be manually edited to set the Plot to "DivergenceSignals" or can this be accomplished via the properties window? Further, where did the plot variable "DivergenceSignals" come from? I don't see it in the indicator properties. Clearly I'm confused.

Second, I was wondering if someone could suggest some ways to capture the PriceActionSwingPro's "rDiv" or "hDiv" signals in a strategy. I would like to use the "rDiv" Signals as a Setup or pre-condition necessary before a signal can generate an order.

One idea I have started is to create a public boolSeries variable, bullDivSetup and bearDivSetup. Since MarketAnalyzer can capture Divergence signals I feel like I'm duplicating functionality that already exists. That said, here's where I set values for each BoolSeries:
 
Code
protected override void OnBarUpdate()
...
#region Divergence
...
if (showDivergenceRegular == true)
{
	if (divLastSwing < divCurSwing && divLastOscValue > divCurOscValue)
	{
		...
		DrawLine("DivSignalDn" + drawTagDivDn, AutoScale,
			CurrentBar - lastHighBar, lastHigh, CurrentBar - curHighBar,
			curHigh, divDnLineColour, divDnLineStyle, divDnLineWidth);
		int textDivBarAgo = Convert.ToInt32(CurrentBar -
			(lastHighBar + curHighBar) / 2);
		...
		//////////////////////////////
		//Bearish Divergence Setup
		//////////////////////////////
		bearDivSetup.Set(true);
	}
	else
	{
		RemoveDrawObject("DivSignalDn" + drawTagDivDn);
		RemoveDrawObject("DivRegTextDn" + drawTagDivDn);
	}
}

...
if (showDivergenceRegular == true)
{
	if (divLastSwing > divCurSwing && divLastOscValue < divCurOscValue)
	{
		
		...
		DrawLine("DivSignalUp" + drawTagDivUp, AutoScale,
			CurrentBar - lastLowBar, lastLow, CurrentBar - curLowBar,
			curLow, divUpLineColour, divUpLineStyle, divUpLineWidth);
		int textDivBarAgo = Convert.ToInt32(CurrentBar -
			(lastLowBar + curLowBar) / 2);
		...
		///////////////////////////
		//Bullish Divergence Setup
		///////////////////////////
		bullDivSetup.Set(true);
	}
	else
	{
		RemoveDrawObject("DivSignalUp" + drawTagDivUp);
		RemoveDrawObject("DivRegTextUp" + drawTagDivUp);
	}
}

Any help / thought would be greatly appreciated. Also let me know if you need me to clarify.

Reply With Quote
  #497 (permalink)
 dorschden 
Germany
 
Experience: Master
Platform: NinjaTrader
Posts: 112 since Jun 2009
Thanks Given: 59
Thanks Received: 1,143


danjuma View Post
There was a question I asked a while ago, which was kindly answered to some extent by others as you did not seem to be around then. I would like to post the question again for your answer please if I may.

1. What the volume value refers to, is it the total volume (or average volume) from one swing high/low to another?

2. With regards to the percentage, percentage of what? Is it the percentage of the current volume compared to the previous volume or to the average daily volume or what?

@danjuma,

The swing high volume number represents the absolute or relative volume traded from the swing low to the swing high or vice versa. If you choose "absolute" you see the complete volume for this swing and if you choose "relative" then you see the average volume traded at each bar in this swing up.

The percentage number doesn't belong to the volume analysis. It's the percentage retracement number for the swing length. E.g. if a swing down is 10 ticks long and the next swing up is 7 ticks the retracement is 70% and if the swing up has 17 ticks the retracement/extension is 170%.

To compare the volume of the swings in a percentage way you have to change the source code to calculate and print the volume retracement for each swing. As example how you can do this see how the swing length is calculated in the source code.


sudhirc View Post
Trying to configure for GomCD, I'm having difficulty. I thought i removed all comments as per the instructions on first page, but still could not get the GomCD numbers in there.

@sudhirc,

I hope you figured it out by now. If you completely uncomment all GomCD regions in the source code it'll work. I didn't here any other complaints about this. Otherwise write me a short private message.


AlgoBot View Post
I could use a little help in understanding how the market analyzer template (PasMa2) sets its Plot = DivergenceSignals. Does the MarketAnalyzer template file have to be manually edited to set the Plot to "DivergenceSignals" or can this be accomplished via the properties window? Further, where did the plot variable "DivergenceSignals" come from? I don't see it in the indicator properties. Clearly I'm confused.

Second, I was wondering if someone could suggest some ways to capture the PriceActionSwingPro's "rDiv" or "hDiv" signals in a strategy. I would like to use the "rDiv" Signals as a Setup or pre-condition necessary before a signal can generate an order.

@AlgoBot,

You don't have to edit the MA template. The MA template is already set to "Plot" = "DivergenceSignals" as you can see under -> Right click in the Market Analyzer -> Columns… -> Bottom Left window choose the last PriceActionSwing instance -> Right window in the category "indicator" -> Plot = DivergenceSignals.

The "DivergenceSignals" is a public data series in the PriceActionSwing indicator to give access to the divergence signals. Simply create an PriceActionSwing instance in your indicator/strategy and call the DivergenceSignals series and save the values in your own data series. E.g. (better implementation would be to use OnStartUp, but to keep it simple):

 
Code
                            
#region Using declarations

using PriceActionSwing.Utility;

#region variables
        
private int swingSize 7;
        private 
SwingTypes swingType SwingTypes.Standard;
        private 
int dtbStrength 15;
        private 
IDataSeries divSignals;

        protected 
override void OnBarUpdate()
        {
    if (
CurrentBar 1)
            {
                if (
divSignals== null)
                    
divSignalsPriceActionSwing(InputdtbStrengthswingSizeswingType).DivergenceSignals;
            }

    
// divSignals represents now the divergence signals from the PriceActionSwing indicator
    
if (divSignals[1] == -2)
    {
        
// hidden divergence short
        // do something
    
}

DivergenceSignals:
-4 = hidden divergence short entry |
-3 = regular divergence short entry |
-2 = hidden divergence short signal |
-1 = regular divergence short signal |
0 = no signal |
1 = regular divergence long signal |
2 = hidden divergence long signal |
3 = regular divergence long entry |
4 = hidden divergence long entry |

Started this thread Reply With Quote
  #498 (permalink)
jacters
Frankfurt
 
Posts: 3 since Nov 2011
Thanks Given: 3
Thanks Received: 0

@sudhirc,
did you check the area between CD or do you just follow the standard approach?

Reply With Quote
  #499 (permalink)
 
sudhirc's Avatar
 sudhirc 
detroit,mi
sc
 
Experience: Intermediate
Platform: NT
Broker: NT
Trading: ES
Frequency: Every few months
Duration: Hours
Posts: 417 since Sep 2011
Thanks Given: 1,709
Thanks Received: 471


jacters View Post
@sudhirc,
did you check the area between CD or do you just follow the standard approach?

@jacters

Hi Jacters, I'm not sure what you mean. can you eloborate!

thank you,
Sudhir

Reply With Quote
  #500 (permalink)
 
Lejcus's Avatar
 Lejcus 
Czech Republic
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Ninja/ Continuum
Trading: Anything that move
Posts: 43 since Apr 2010
Thanks Given: 216
Thanks Received: 66


Hi dorschden

Thanks for your hard work on this indicator and your sharing.

I found one small thing missing in this complete work. The duration of swings is shown in number of bars which is fine for some, but for us using range or tick charts would be useful to see duration in minutes. I know that you can show time of the swing already, but this isn't comfortable to read without : separator between.

Would you consider adding option to show duration in time in further versions? Also using : separator in time would be nice.

Thanks

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