PriceActionSwingPro - Error Compiling in Strategy Builder - futures io
futures io



PriceActionSwingPro - Error Compiling in Strategy Builder


Discussion in NinjaTrader

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




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

Closed Thread
 
Search this Thread
 

PriceActionSwingPro - Error Compiling in Strategy Builder

(login for full post details)
  #1 (permalink)
 albertjay 
Los Angeles CA
 
Experience: Advanced
Platform: NT
Trading: ES
 
Posts: 12 since Aug 2015
Thanks: 3 given, 5 received

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 futures io?
Order Flow Trade Detector Alert Sound
NinjaTrader
how to avoid these type of trades in algo
NinjaTrader
DAX UP GAP
Emini and Emicro Index
Coding first profitable weekly open
Elite EasyLanguage Algorithmic Trading
Google Keyword Search Alerts
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Spoo-nalysis ES e-mini futures S&P 500
61 thanks
Why dont people trade 150 ES contracts?
38 thanks
How to work on strategy
26 thanks
Any long term success stories from funded traders in the …
26 thanks
How to avoid wiping out the accounts?
18 thanks
 
(login for full post details)
  #2 (permalink)
 albertjay 
Los Angeles CA
 
Experience: Advanced
Platform: NT
Trading: ES
 
Posts: 12 since Aug 2015
Thanks: 3 given, 5 received

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
The following 2 users say Thank You to albertjay for this post:
 
(login for full post details)
  #3 (permalink)
 Adfra 
Melbourne
 
Experience: Intermediate
Platform: NinjaTrader
Broker: MB Trading, Kinetick
Trading: Forex, AUD/USD
 
Posts: 19 since Aug 2011
Thanks: 11 given, 9 received


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!

The following user says Thank You to Adfra for this post:
 
(login for full post details)
  #4 (permalink)
 bobwest 
Site Moderator
Sarasota FL
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
 
bobwest's Avatar
 
Posts: 7,030 since Jan 2013
Thanks: 51,641 given, 23,381 received


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
 
(login for full post details)
  #5 (permalink)
 trsamurai999 
Mumbai
 
Experience: Beginner
Platform: NinjaTrader 8
Trading: futures
 
Posts: 13 since Mar 2017
Thanks: 7 given, 3 received

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.

 
(login for full post details)
  #6 (permalink)
 bobwest 
Site Moderator
Sarasota FL
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
 
bobwest's Avatar
 
Posts: 7,030 since Jan 2013
Thanks: 51,641 given, 23,381 received


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

futures io Trading Community Platforms and Indicators NinjaTrader > PriceActionSwingPro - Error Compiling in Strategy Builder


Last Updated on October 16, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts