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,177 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 7 posts
    2. attach_file 1 attachments




 
 

Passing indicator parameters

 
 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?
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Better Renko Gaps
The Elite Circle
Futures True Range Report
The Elite Circle
Deepmoney LLM
Elite Quantitative GenAI/LLM
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
36 thanks
NexusFi site changelog and issues/problem reporting
22 thanks
The Program
20 thanks
GFIs1 1 DAX trade per day journal
19 thanks
 
 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:
 
 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
 
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
 
 
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,399 since Jun 2009
Thanks Given: 33,173
Thanks Received: 101,538


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

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


 
 
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,399 since Jun 2009
Thanks Given: 33,173
Thanks Received: 101,538


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

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

 



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