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)
PriceActionSwingPro - Error Compiling in Strategy Builder
Anyone using PriceActionSwingPro have issues compiling?
I'm getting this error:
NinjaTrader.Strategy.Strategy.PriceActionSwing(int, double, PriceActionSwing.Base.SwingStyle, bool)' is a 'method', which is not valid in the given context
A community thrives on members helping each other succeed. To that end NinjaTrader_Paul (consistently offers excellent support) and NinjaTrader_CodyB offered this solution that works:
Under declarations add:
using PriceActionSwing.Base;
---
OnBarUpdate() add:
if (PriceActionSwing(20, 7, SwingStyle.Standard, true).DoubleBottom[0] >= Something)
I also used the assistant to produce the relevant PAS code for me and ran into the 'method' not valid this context error. I stared at this post for a while until I picked up on the difference, so just to make it explicit in the hopes it saves someone else a few hours of head-scratching:
a) Add the 'using PriceActionSwing.Base' reference at the very top
b) Remove all occurrences of 'PriceActionSwing.Base.' from the parameters when defining the Indi.
So e.g. from 'PriceActionSwing.Base.SwingStyle.Ticks' to just 'SwingStyle.Ticks'
Once that was done the PAS indi compiled fine for me...
Speaking of head scratching, I had to reread the posts in this thread a few times before understanding that the issue was with incorporating the PriceActionSwingPro indicator into a strategy produced by the NT Strategy Builder, not in the regular use of the indicator by itself.
I have changed the thread title to include "in Strategy Builder," to hopefully make it clear when this problem occurs and how to fix it.
(If I'm wrong about this, please let me know here so I can fix my own error . )
Bob.
When one door closes, another opens.
-- Cervantes, Don Quixote
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 …
If you do post in that thread, you will get better results if you describe what your problems are with the indicator, not just say it "does no work for me." No one can respond to such a broad statement with anything that will help.
If the current version in the Downloads is not working for you, just asking for "the working version" does not help and probably will see few responses. Details are better.
Thanks.
--------------------------
Edit: I do think that the main thread is the best place for this question, but after thinking about it, I realized that @trsamurai999 was asking @Adfra for the finished code that solves the problem of using it in the Srartegy Builder, which is certainly a legitimate question.
However, if the code is changed as indicated, it will no longer work in its original use as a standalone indicator. It is very common for indicators to need to be changed to work inside Strategy Builder and doing so makes it something different from the original.
It is still important not to spread threads pertaining to PAS over different sections of the forum.
So I suggest that @trsamurai999 repost his question in the main PAS thread referenced above, with the change that his problem with the indicator as written is that it cannot be used as-is in a Strategy Builder strategy, and request a version that works in Strategy Builder.
I'm fairly sure that this has come up and been addressed by others and that an answer is available, or can be easily provided. If @Adfra can post his solution there, it would be a better place for it.
If it is to be posted there, the name should be changed so no one will mistake it for the standard PriceActionSwing indicator, since it will not be.
This thread is closed to prevent a duplicate topic.
Bob.
When one door closes, another opens.
-- Cervantes, Don Quixote