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 975,894 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

  #901 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,168 since Jan 2013
Thanks Given: 57,464
Thanks Received: 26,278


Rachel View Post
Hi and thank you to the creator and others, who helped to create this wonderful indie.

I was trying to write a strategy and ran into a problem.

Had Ninja Trader tech fix the problem but on any upgrade, this is the issue:

"The enumeration in the PriceAction indicators SwingTypes, using it's own namespace. This prevents it from being called from another indicator or strategy."

It would be helpful, if that issue could be addressed. I was trying to get a strategy using the PASOscillator: in volume mode for rising and falling and it caused a error etc.

Thank you again,

Rachel

Hi Rachel,

This is not just a simple programming error to be addressed. Putting the enumeration in its own namespace solves or prevents a very important and common problem with other indicators.

To step just a little bit into techie territory (sorry, I'll be brief ):

1. An "enumeration" (or "enum") is a programming thing that can only have a value specified in a list. For example, when you click on a drop-down box labeled "MA Type" in an indicator's settings, and see choices like "SMA" and "EMA", that's an enumeration. You have only the listed choices, and you have to select one. They're handy things.

2. Names like "MAType" are real common in indicators. In the PAS indicator, there's an enumeration called "SwingType". That's going to get used by another indicator eventually, too.

3. If programmers put all the enumerations for their indicators in separate "namespaces", then it doesn't matter that another indicator is using the same name; there cannot be a conflict with enums having the same names because the names don't live in the same place, so to speak.

4. If programmers put them in the common ("global") namespace, then there will eventually be a conflict. For example, if you already have an indicator that uses an enum named "MAType" (pretty common), and if you then download another indicator that also uses the enum name "MAType", and if they both place their enums in the common namespace, you will find the new indicator can't be imported. The two indicators simply cannot coexist on the same computer. You also see this in new versions of the same indicator.

The only way to fix this problem is for someone who knows the issue to go into one or the other indicator and hack it to eliminate the name conflict. But only after some gnashing of teeth and intemperate words by the user.

Now, I guess you had the same gnashing and so on when you were trying to get your strategy to use PriceActionSwing, until you could find someone to fix it. The problem you had was that the strategy could not access the SwingType enum, which was isolated in its own namespace, basically to prevent its overlapping into another indicator's or strategy's space.

So basically, "fixing" it so your issue would be eliminated would open it up to the other issue of potential conflict with other indicators. Neither of these are good, but you have to pick one or the other. That's why this isn't a simple error to be repaired; it's a design decision that means you avoid one problem but may end up with the other.

I assume that when support fixed the problem for you, they put the SwingType enum into the common global namespace. That fixed one issue, but it also means that if you download another indicator that uses an enum called "SwingType", and if it also places it in the global namespace, you will have a conflict between them, which will have to be fixed by someone.

Life ain't fair, but there it is.

I hope this post didn't go on for too long or wasn't clear. It's hard to explain this stuff sometimes, but it's good to know why something happens, and the pro's and con's of changing it, and whether it's actually an error.

At least, I hope all this now makes more sense to you.

Bob.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Exit Strategy
NinjaTrader
How to apply profiles
Traders Hideout
Trade idea based off three indicators.
Traders Hideout
NexusFi Journal Challenge - May 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
41 thanks
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #902 (permalink)
 Sezor 
Nîmes France
 
Experience: Intermediate
Platform: NinjaTrader, Mt4
Broker: NinjaTrader Brokerage
Trading: Oil
Posts: 51 since Nov 2010
Thanks Given: 81
Thanks Received: 18

Thanks Bob

Excellent explanation it seems to me.
It raises the question of why NT doesn't give each indi (instance)
its own namespace.
Would there be any disadvantages to that, beyond perhaps memory
hogging ?
Sezor

Reply With Quote
Thanked by:
  #903 (permalink)
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,168 since Jan 2013
Thanks Given: 57,464
Thanks Received: 26,278



Sezor View Post
Thanks Bob

Excellent explanation it seems to me.
It raises the question of why NT doesn't give each indi (instance)
its own namespace.
Would there be any disadvantages to that, beyond perhaps memory
hogging ?
Sezor

The namespace is purely a programming issue. There are no memory implications, really. It's not "space" in that sense; it's more like whether a program can see a value or not.

Normal programming practice outside of NT would generally be to keep namespaces separate, to avoid possible name conflicts. In writing indicators, a programmer certainly can create a separate namespace for his/her enums, and @dorschden , the original programmer of PAS, did that. I think this is usually the better way to go.

Rachel's issue shows that there may be advantages to making them available to other strategies/indicators if you want to be able to use an indicator in another indicator or a strategy, for example, which NT does let you do.

But then the other side of the two-edged sword cuts you.

As to how to avoid both issues, from a programmer's standpoint that's easy: you keep the namespaces separate and you add the namespace name to your "using" statements (sorry, more technicalese, for the programming community ) in the indicator/strategy that you want to access it. (You have to add it to the "using" statements in the indicator that it's written for, too, which PAS does.)

From a design viewpoint for NinjaTrader, where you want a non-programmer user to easily incorporate an indicator into another, it's not so easy to see how to do it. I believe that the native NT indicators all use the global namespace for enums -- in any case, that's the practice they encourage (per the comment Rachel got from Ninja support) -- I assume because it's an easy way to allow sharing them.

As I said, these are design issues, and you make choices to get what you want, recognizing there are tradeoffs.

Bob.

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

Time for a little Q&A.

But first I want to thank @Silvester17 for answering a lot of questions in this thread and @Tasker_182 for answering some coding questions and requests. I really appreciate it a lot!


CaptainFill View Post
I had an older version of the PAS and it had triangle pattern formations which would display bold lines (green or red) and a continuation expectation arrow soon after the pattern had formed.

It doesn't look to me like that feature is available anymore in the latest version and found its function to be very interesting and would like to explore that more.

If you mean the AB=CD pattern, then use the PriceActionSwingPro version and set in the (Swing) Feature category the setting "ABC Pattern" to "Long_Short".


Raj1 View Post
SWING ENTRY SOUND ALERTS FOR FOLLOWING SWINGS:

1. DT Short Entry
2. DB Long Entry
3. HL swing Long entry
4. LH swing Short Entry
5. Regular Divergence Long Entry
6. Regular Divergence Short Entry
7. Hidden Divergence Long Entry
8. Hidden Divergence Short Entry

This alerts are implemented in the new version.


Raj1 View Post
With my UniRenko Candles and MACD BBlines oscillator(12,26,9), the RD/HD lines are getting drawn between almost all swing HHs & LLs and does not reflect true divergences. I am not sure why that is occurring to me. However, with my another RD/HD indicators viz., ECIDiv_v4 that is available in futures.io (formerly BMT) gives me correct indications as per following logic. Hence, I request you to review your code for possible correction, if any.:
LOGIC:
Regular Divergence Short Signal: @ PRICE HH swing when MACD oscillator has LH swing
Regular Divergence Long Signal : @ PRICE LL swing when MACD oscillator has HL swing
Hidden Divergence Short Signal: @ PRICE LH swing when MACD oscillator has HH swing
Hidden Divergence Long Signal : @ PRICE HL swing when MACD oscillator has LL swing

The divergence in the PAS is spotted exactly after this rules and I believe they work correctly.


Keithh View Post
Could a coding whizz add these features:

In the parameters section - the ability to set separate left and right swing sizes.
Eg: a swing point is created with 5 bars on the left side of price and 2 bars to the right of the swing point.

Stop the indicator showing a dot above/below the current live bar, and have it only show when a swing point has formed.

Add the ability to offset the dots/symbols from the price bar

Sorry, I don't will implement this requests. Maybe somebody else will do it.


tradermick View Post
I am looking for a way to have the swing label colors simply be the same color as its related zigzag swing. Red text for a downswing label, green text for an upswing label. (Or whatever colors have been chosen for up/downswings)

In the new version you can set the color for each swing type separately, so you can set e.g. the colors for high swings to the same color as the color of the zig zag lines.


tradermick View Post
… My request is, I would also like to see the Delta activity during the time in between the CD changes driven by the swing updates.
[…]
This way, we could see the net Delta activity during periods of sideways price movement when new swing extremes are not being established…

Check out the new version. But you have to uncomment all the "GomCD" regions in the code and compile the script again first. You find this under the setting "gomCDCurrent".


Keupie View Post
Would it be possible to allow a trader to plot Swing Values of the current session only. That way the left side of your screen stays clean.

This is possible, but you or somebody else have to code it. You simple check if you are in the current session and if not skip the draw statements.


buylosellhi View Post
[…] is this price action indicator available for Tradestation […] ?


humseper View Post
Is it possible to use the PAS indicator with sierra chart?


kevinflynn View Post
Please can you convert this great indicator to Metatrader 4 […]


hlatham View Post
No doubt a long shot, but has anyone converted this or written an indicator like this to work on CQG?

The PAS indicator is only available for NinjaTrader. I have a MT4/MT5 version but I'll probably don't make it public.


podski View Post
[…] The thing about a HL or an LH is that it get's cancelled out by the next HL or LH. They may even become HH or LL in fact.

I would like to be able to choose an option that keeps a record of the prints of HL and LH so that I can see where the first indication occurred and how it developed after that. […]

It is possible to track the swing development rather easily but you have to code it yourself or find somebody else. If you just want a triangle to draw when the first indication was, you can use the "swing switch" setting in the new PriceActionSwingPro version. And in the code you give the draw statements a unique tag id. You would change "DrawTriangleDown("DnSwingStart", false, 0 ..." to "DrawTriangleDown("DnSwingStart" + swingLow.Counter, false, 0 ..." and the same for the up triangle. Just search the code for this statements, change them and compile them and you are have what you wanted.


Rachel View Post
[…]I was wondering if there was a way to get a sound alert when the Gann Swing turns direction?
It is a great indicator of when a swing is about to change, especially if you are watching it from a higher time frame. […]

Use the "swing switch" alert in the new PriceActionSwingPro indicator.


supermht View Post
can anyone add the function of calculating swing time/points by close? currently the indicator calculates swing time/points by High and Low. thanks


YertleTurtle View Post
I too would like this addition - close to close swings and the ability to define swings by tick size.


Trafford View Post
Please can you confirm if the PASPro indicator's can be modified to plot a new swing based on a close higher and for a swing low on a close lower and higher low on a close candle the same for a lower high swing.

The new version can also calculate the swing based on the close values and calculate the swings based on ticks. Check the "Parameter" category.


supermht View Post
i am wondering if any code experts could add swing calculation of average volume by duration. thanks

You can do this rather easily by yourself. In the new version change the file PriceActionSwingBase add at the end of the "CalcDnSwing" function a similar "DrawText" statement like all the other output text statements. You can copy an existing one and just give it a different tag name and change the output to e.g. "(swingHigh.CurVolume/swingHigh.CurDuration).ToString()". Do the same for the CalcUpSwing function. Something like this should work.


OpalDragon View Post
[…] is there a way to change it so it displays the Price and Ticks - ONE over the Other […]

The new version has an extra price output.


KrazyTrader View Post
Is it possible to set the indicator to have price on the swing line?[…]

No, this setting isn't supported.


sudhirc View Post
Is it possible to modify this script to include volume divergence in here. […]

Which rules do you have in mind?

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

A new version is ready.

But @Big Mike has to upload it first. Once he has done that, he'll probably post a message here in the thread and then you can check out the updated version.

Download PriceActionSwing

I Changed the code structure - so if you use it in strategies or in other indicators, make sure you have a copy of the old version. With the new code structure it is easier to use the swing functions and values in strategies or other indicators.
Added swing tick and swing percentage calculation.
Added swing calculation based on close values.
Added different alerts.
Added risk management tab.
Added, changed and improved some other things.

I didn't tested it extensively, but I expect everything to work.

Comments, errors and suggestions are welcome!

The alert sound files are attached in a 7z archive. Extract and put them in "C:\Program Files (x86)\NinjaTrader 7\sounds".

The market analyzer output hasn't changed, but you have to use the new template to get all the settings of the PAS indicators. Put the market analyzer template in "C:\Users\user name\Documents\NinjaTrader 7\templates\MarketAnalyzer".



Attached Files
Elite Membership required to download: PasMA.xml
Elite Membership required to download: AlertSoundFiles.7z
Started this thread Reply With Quote
  #906 (permalink)
 
YertleTurtle's Avatar
 YertleTurtle 
Portland, USA
 
Experience: Intermediate
Platform: Ninjatrader
Trading: ZS
Posts: 215 since May 2011
Thanks Given: 42
Thanks Received: 362


dorschden View Post
Time for a little Q&A.

Thanks a ton for making these changes - this indy is getting really awesome!

And the day came when the risk to remain tight in a bud was more painful than the risk it took to blossom

- Anais Nin
Reply With Quote
Thanked by:
  #907 (permalink)
 
Rachel's Avatar
 Rachel 
San Diego
 
Experience: Advanced
Platform: Private
Broker: private
Trading: CL future
Posts: 1,380 since Mar 2012
Thanks Given: 935
Thanks Received: 1,955

Can't wait to try out the new version, I am so looking forward to it.
You are great!!!

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #908 (permalink)
 
wldman's Avatar
 wldman 
Chicago Illinois USA
Legendary Market Wizard
 
Experience: Advanced
Broker: IB, ToS
Trading: /ES, US Equities/Options
Frequency: Several times daily
Duration: Hours
Posts: 3,512 since Aug 2011
Thanks Given: 2,047
Thanks Received: 9,513

@dorschden
@Silvester17

This is an amazing piece of work. I have been the blind squirrel on this so thanks for whipping a nut at me!

This what I downloaded is the "old" version, do I have that right? Mike will notify when the "new" one is in the downloads section? I can add anaKVO to the Divergence piece?

Wow Santa, I hope you liked the cookies and beer I left for you. Thanks guys.


Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #909 (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


wldman View Post
@dorschden
@Silvester17

This is an amazing piece of work. I have been the blind squirrel on this so thanks for whipping a nut at me!

This what I downloaded is the "old" version, do I have that right? Mike will notify when the "new" one is in the downloads section? I can add anaKVO to the Divergence piece?

Wow Santa, I hope you liked the cookies and beer I left for you. Thanks guys.


yes, yes (hopefully soon) and yes

Reply With Quote
Thanked by:
  #910 (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,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608


Updated, notifications sent.

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




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