NexusFi: Find Your Edge


Home Menu

 





PriceActionSwingPro - Error Compiling in Strategy Builder


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one albertjay with 2 posts (2 thanks)
    2. looks_two bobwest with 2 posts (0 thanks)
    3. looks_3 Adfra with 1 posts (1 thanks)
    4. looks_4 nxfradar with 1 posts (0 thanks)
    1. trending_up 3,373 views
    2. thumb_up 3 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 0 attachments




Closed Thread
 
Search this Thread

PriceActionSwingPro - Error Compiling in Strategy Builder

  #1 (permalink)
 albertjay 
Los Angeles CA
 
Experience: Advanced
Platform: NT
Trading: ES
Posts: 12 since Aug 2015
Thanks Given: 3
Thanks Received: 5

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

When attempting to compile this:

if(PriceActionSwingPro(35, 7, PriceActionSwing.Base.SwingStyle.Ticks, false).DoubleTop[0] > CurrentDayOHL().CurrentOpen[0])

TIA,

-Al

Started this thread

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Are there any eval firms that allow you to sink to your …
Traders Hideout
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Deepmoney LLM
Elite Quantitative GenAI/LLM
 
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
NexusFi site changelog and issues/problem reporting
26 thanks
Battlestations: Show us your trading desks!
24 thanks
The Program
18 thanks
  #2 (permalink)
 albertjay 
Los Angeles CA
 
Experience: Advanced
Platform: NT
Trading: ES
Posts: 12 since Aug 2015
Thanks Given: 3
Thanks Received: 5

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)

{
Do Something
}

Started this thread
Thanked by:
  #3 (permalink)
 Adfra 
Melbourne
 
Experience: Intermediate
Platform: NinjaTrader
Broker: MB Trading, Kinetick
Trading: Forex, AUD/USD
Posts: 19 since Aug 2011
Thanks Given: 11
Thanks Received: 9


Hi There,

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...

Thanks again for such a wonderful indicator!

Thanked by:
  #4 (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,162 since Jan 2013
Thanks Given: 57,341
Thanks Received: 26,267


Adfra View Post
Hi There,

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...

Thanks again for such a wonderful indicator!

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
  #5 (permalink)
 nxfradar 
HK + HK
 
Experience: Beginner
Platform: NinjaTrader 8
Trading: futures
Posts: 13 since Mar 2017
Thanks Given: 7
Thanks Received: 4

Hi,

I am not from coding background and I don't know how to change code lines.

Request you to Kindly Post the working version of : PriceActionSwingPro.

The downloaded version from Download Section does not work for me.

Thanks.

  #6 (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,162 since Jan 2013
Thanks Given: 57,341
Thanks Received: 26,267


trsamurai999 View Post
Hi,

I am not from coding background and I don't know how to change code lines.

Request you to Kindly Post the working version of : PriceActionSwingPro.

The downloaded version from Download Section does not work for me.

Thanks.

@trsamurai999, if you haven't already, the better place to post this request is the main thread that is dedicated to PriceActionPro, here:



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

Closed Thread



Last Updated on October 16, 2021


© 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