Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I welcome any feedback, comments and suggestions for improvement.
Please discuss the PriceActionSwing (PAS) indicator in this thread. Any comments or suggestions are more than welcome here. If you have a more private issue send me a PM or better an Email (you'll find the address in the top of the PriceActionSwingPro.cs script). Discussion about the newest version starts here (last update 31.08.2022).
Market analyzer template
You can download a market analyzer template in this post. It contains ABC and divergence signals as well as swing trends and relations.
Versions
The PriceActionSwingPro indicator calculates swings in different ways and displays all kind of information about the swings above and below them. PriceActionSwingPro contains also some features:
- Draw automatically Fibonacci extensions and retracements
- naked swing lines
- Calculate a swing statistic
- Calculate and visualize ABC patterns
- Calculate and visualize divergence based on an indicator
Settings
Every setting in the NinjaTrades's indicator menu has a short description. Here is a short list of the more important ones.
Parameter:
Double top/-bottom strength:
Represents the double top/-bottom strength. Increase the value to get more double tops and -bottoms.
Swing size:
Represents the swing size. e.g. 1 = small swings and 5 = bigger swings. Which size you use depends on your trading style. There is no best setting for everybody.
Swing type:
Represents the swing type. In the "Standard" swing type a new swing is found when price is above or below the high or low of the last N bars and N = Swing size. The "Gann" type is calculated based on Gann's rules for swings.
Swing values:
Here you can choose which information the swings should display.
Information:
- Duration (in bars)
- Labels (HH, HL,…)
- Length (in ticks, points,…)
- Percentage (in relation to the last swing. e.g. 100% = DT/DB)
- Time
- Volume (Absolute and relative. Relative is the average volume per bar)
Swing visualization type:
Represents the swing visualization type. Dots | Zig-Zag lines | Dots and lines | Gann style. E.g. if you want only dots to visualize the swings choose "Dots".
Visualization:
Here you can choose your own look and feel for the visualization of the swings and the patterns.
Features:
Here you can turn the features on and off.
Statistics:
Swing Length shows the up and down swing length in ticks. The "Last Length" column is the average of the last N swings and N = "Statistic number of swings".
Swing relation for a specific swing (first column) the percentage amount of swings that follow this specific swing. E.g. the values of the first row (Higher High) are:
Swing Count Higher High Lower High Higher Low Lower Low
48 47,9% 52,1% 72,9% 22,9
Then you can interpret this as a Higher High is followed in 72,9% of all cases by a Higher Low and only in 22,9% by a Lower Low. 72,9% + 22,9 % = 95,8%. The remaining amount is for a double bottom.
Divergence:
Here you can set all settings to display divergences in the chart.
Div indicator:
Represents the indicator for the divergence calculations. You can add one or more indicators in the source code under the value "custom". Here you find instructions how to create divergence signals based on a freely chosen indicator.
Param1, Param2, Param3
Represents the first parameter for the indicator you choose. E.g. the standard MACD(12,26,9) would be
Param1 = 12
Param2 = 26
Param3 = 9.
The PAS indicator is very useful to see and trade pure price action with HH, HL in up trends and LL, LH in down trends and you can easily identify swing patterns like M, W, wedged, HS,…
When you use Harmonic Trading in order to get your AB=CD set-up (and the other patterns). You have to look for symmetry. For i.e. if you get a wave from point A to B that contains 10 bars, then the C to D wave is equal to that 60 % of the time.
You …
a combination of the two might be interesting. I cross linked them.
Very nice! I have been trying to program an improved swing indicator myself, but this one looks great! How have you been using this in your trading strategy?
I uploaded a new version in the download section with Fibonacci retracements, Fibonacci extensions and an visual entry area for the AB=CD pattern.
With NinjaTrader 7 it's easy to set draw objects in the future and with this feature it's possible to visualize the AB=CD pattern in a better way. But for now the Fibonacci tools must reach.
I'm not an elite member. When I should add some stuff to PriceActionSwing write this in this thread and I'll see what I can do. Otherwise you can use my code (many comments, I think easy to read) and add some snippets in the other swing indicator.
For my trading style a good swing indicator is essential. Because I often trade price pattern. Next step is to automate the pattern recognition.
I also create a strategy that trades double bottoms/tops with this indicator. As entry trigger you can use almost everthiny: a stochastic cross, MA cross, 3 bar reversal,... the stop is 2 ticks below the double bottom and profit target is the last swing high or let it run with an atr stop, PSAR, TSSuperTrend. Short vice versa. The results are good, but not extraordinary.
First off, thanks for this wonderful indicator. I've been working with ZigZagUTC to use in my strategies with little luck (due to my poor c# skills). Your indicator would seem to do exactly what I need with the PriceSwingRelation dataseries.
This is probably a very basic C# question, so pardon my lack of coding knowledge. Can you provide an example of calling this indicator by a strategy to determine the values held in the PriceSwingRelation dataseries?
i.e. if (PriceActionSwing(SwingMode, dtbStrength, span).PriceSwingRelation == #
&& ...
&& ... )
{ do something }
What is the required syntax for the "SwingMode" variable when calling the indicator? I've tried many variations such as "SwingMode.Standard", but no luck yet.
For the 1 in "PriceSwingRelation[0] == 1" you can set the following values
-2 for double top
-1 for lower high and lower low
0 nothing
1 for higher high and higher low
2 for double bottom
wouldn't it be nice to be able to keep a running average of upswings and downswings and either simply print that out in a stats panel or actually project it onto the chart once a new swing has formed. It would also be nice to keep track of the av number of bars and project the same - esp. good with minute charts.
A further embellishment to the above would be to track upswings in bull markets, downswings in bull mkts, downswings in bear, downswings in bull to better hone the anticipated swings. When the market falls short of a projection it indicates weakness, when greatly exceeds indicates strength, but also helps to provide context of what is likely once a new swing has formed.
Only problem is that with this method of calculating swings there might often be considerable 'lag' between when the swing/high/low formed and the code recognises it as such. But I for one would love to be able to see this on a chart and I think you are more than halfway there with the underlying code.
Good suggestions and I'm already working on a statistic add on with almost the same stuff you mention. There is the average up-/down swing length and duration in bars and the same for the last x swings. Furthermore I differ this in up trends with higher high/low and down trends. An with this values I plan to visualize an exit area, so it should be possible to enhance the exits.
It is not so much work, but at this moment I'm very busy and next week I'm on vacation. So I can release the statistic primary in some days.
Thank you very much for the code snippet. I am working on a strategy/dot/bar painter very similar to what you have in your code. It is basically a combination of the triple EMA dots along with PriceSwingRelation from your indicator to further qualify the MA signals (although I have been moving towards using a Jurik MA versus the triple EMA). Only paint/draw a "long" signal after a HH/HL or DB, and "short" signal after LH/LL or DT when the MA changes slope in the direction of PriceSwingRelation. But I have run into an issue, in that sometimes it will paint, sometimes it does not. Attached is a quick example from today's YM. It most certainly could be a problem with my "dots" code, and I will be working with it tonight to try and sort it out. Any suggestions? (I will run some replays and have my code Print the PriceSwingRelation dataseries as the bars and swings form.)
My basic code logic for longs is (opposite for shorts):
if (MA slope changes from falling to rising)
and (PriceSwingRelation > 0)
{ Paint blue Dot / Go Long }
Also, I see an isTrend() around line 426 of your indicator. Can you shed some light on this?