NexusFi: Find Your Edge


Home Menu

 





Passing indicator parameters


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Big Mike with 3 posts (0 thanks)
    2. looks_two hawks67 with 2 posts (0 thanks)
    3. looks_3 charllie1 with 2 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 5,197 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 7 posts
    2. attach_file 1 attachments




Closed Thread
 
Search this Thread

Passing indicator parameters

  #1 (permalink)
 hawks67 
Chicago, IL
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AGN/Rithmic
Trading: CL
Posts: 22 since Apr 2010
Thanks Given: 14
Thanks Received: 2

Let's say I found a new indicator and want to incorporate it into my strategy...but it's a very basic indicator in terms of display, and the parameters available to me as I'm writing the strategy code are not sufficient to use in conditional statements. So I decide to tweak the indicator a little bit and create a boolean I can pass into my strategy. I know this has something to do with public classes and the like, but is there an example I can look at that illustrates in detail how to instantiate this variable in the indicator code and then have it be accessible by a strategy?

Started this thread

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
What broker to use for trading palladium futures
Commodities
How to apply profiles
Traders Hideout
ZombieSqueeze
Platforms and Indicators
About a successful futures trader who didnt know anythin …
Psychology and Money Management
 
  #3 (permalink)
 diverdan 
Singapore
 
Experience: Beginner
Platform: Multicharts, R
Trading: EUR / USD
Posts: 185 since Feb 2010
Thanks Given: 106
Thanks Received: 99


Moderator Notice
Moderator Notice



There a lots - just about every indicator does this.

As an example, check out the standard Darvas NT indicator (just the first one I opened). Taking the buySignal as an example, you need to declare a private instance (visible only within your class):

 
Code
                            
 public class Darvas Indicator
    
{
        
#region Variables
        
private double                boxTop                double.MinValue;
        private 
double                boxBottom            double.MaxValue;
[
B]        private bool                   buySignal            false;[/B]

You can then write you indicator to achieve what it needs to do.  To get (or setthe variableyou need to declare function in the properties section as below:

       
#region Properties
        
[Browsable(false)]  
        [
XmlIgnore()]        
        public 
bool BuySignal
        
{
            
get 
            

                
Update();
                return 
buySignal
            }
            
set buySignal value; }
        } 
As C## is case sensitive, the function BuySignal is different from the variable buySignal. Your strategy should be able to reference Darvas.BuySignal to return the value of the variable buySignal.

HTH

Visit my NexusFi Trade Journal
Thanked by:
  #4 (permalink)
 hawks67 
Chicago, IL
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AGN/Rithmic
Trading: CL
Posts: 22 since Apr 2010
Thanks Given: 14
Thanks Received: 2

Most excellent. I will give it a go! Thanks!

Started this thread
  #5 (permalink)
charllie1
london
 
Posts: 9 since Nov 2012
Thanks Given: 2
Thanks Received: 1

Hi Mike,

I am trying to use this indicator in a strategy, without much success. Would it be possible to take a look it for me?

Please see the attached file .

BW

Charlie

Attached Files
Elite Membership required to download: PriceActionSwing.cs
  #6 (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,465 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,665


charllie1 View Post
Hi Mike,

I am trying to use this indicator in a strategy, without much success. Would it be possible to take a look it for me?

Please see the attached file .

BW

Charlie

Use the main thread that exists on that indicator to ask for help with it please:



The question has no doubt been already asked and answered before in that thread if you will read it.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

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
  #7 (permalink)
charllie1
london
 
Posts: 9 since Nov 2012
Thanks Given: 2
Thanks Received: 1

Thanks Mike for your reply,

I have tried this and also read all the threads related to PAS and have had no joy.

I used this thread as the problem i belive is the PASPro indicator is not public and the strategy can not pick up any values.

any help would be greatly aprecaiated

BW

C



Big Mike View Post
Use the main thread that exists on that indicator to ask for help with it please:



The question has no doubt been already asked and answered before in that thread if you will read it.

Mike


  #8 (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,465 since Jun 2009
Thanks Given: 33,242
Thanks Received: 101,665


charllie1 View Post
Thanks Mike for your reply,

I have tried this and also read all the threads related to PAS and have had no joy.

I used this thread as the problem i belive is the PASPro indicator is not public and the strategy can not pick up any values.

any help would be greatly aprecaiated

BW

C

When you have a question about PriceActionSwing indicator, use the thread I quoted.

Mike



Join the free Markets Chat beta: one platform, all the trade rooms!

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

Closed Thread



Last Updated on November 29, 2012


© 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