NexusFi: Find Your Edge


Home Menu

 





Can I add existing indicators to an indicator I am creating?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one forrestang with 21 posts (0 thanks)
    2. looks_two Fat Tails with 3 posts (4 thanks)
    3. looks_3 futuretrader with 3 posts (2 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 8,165 views
    2. thumb_up 6 thanks given
    3. group 3 followers
    1. forum 27 posts
    2. attach_file 13 attachments




 
Search this Thread

Can I add existing indicators to an indicator I am creating?

  #1 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

Howdy,

I am wanting to create a new indicator that will be referencing some other studies.

Is there a writeup somewhere that explains how I could in a sense ADD these indicators to MY indicator, so that when one puts my indicators on a chart, they could configure all of the settings of the studies my study will be referencing?

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
ZombieSqueeze
Platforms and Indicators
What broker to use for trading palladium futures
Commodities
 
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,103



forrestang View Post
Howdy,

I am wanting to create a new indicator that will be referencing some other studies.

Is there a writeup somewhere that explains how I could in a sense ADD these indicators to MY indicator, so that when one puts my indicators on a chart, they could configure all of the settings of the studies my study will be referencing?

You do not need to add that second indicator. You will simply call it. For clarity, let me describe an example and assume that you want to call the signalline of the MACD and use it as a trendfilter.

You will then call the MACD in OnBarUpdate() to catch the values, for example
 
Code
double signalLine = MACD(Input, fast, slow, smooth).Avg[0];
If you call the MACD, it requires 4 input Parameters:

-> the DataSeries you want to apply it to - this can be "Input", but also another indicator
-> the period of the fast moving average
-> the period of the slow moving average
-> the period of the signalline

The input parameters can only be used, if you have declared the variables, so you need to add them to the Variables section
 
Code
private int fast = 12;
private int slow = 26;
private int smooth = 9;
If you want to make these parameters user accessible in your indicator, you also need to define properties for each of them in the properties section. This will make appear "fast", "slow" and "smooth" in the indicator box of your indicator, so that it can be configured, when your indicator has been put onto a chart.

Reply With Quote
Thanked by:
  #4 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

How would I go about populating an oscilator panel with a color?

Say for example I am able to draw arrows on the price chart with various conditions. How do I instead of doing that.... just draw a switchin color in the oscilator pane.

It would look like the picture below. This is from the PriceActionSwingTrend indicator. I would like to populate mine(3rd pane) like this.

Attached Thumbnails
Click image for larger version

Name:	howto.jpg
Views:	210
Size:	191.5 KB
ID:	43541  
Started this thread Reply With Quote
  #5 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


forrestang View Post
How would I go about populating an oscilator panel with a color?

Say for example I am able to draw arrows on the price chart with various conditions. How do I instead of doing that.... just draw a switchin color in the oscilator pane.

It would look like the picture below. This is from the PriceActionSwingTrend indicator. I would like to populate mine(3rd pane) like this.

Ah, Got it.

Started this thread Reply With Quote
  #6 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


forrestang View Post
Ah, Got it.

Jeez I'm such a newb.

Got the first part working. Got to add in some other stuff. Arrows are just there for debugging.

Attached Thumbnails
Click image for larger version

Name:	SuchANewb.jpg
Views:	200
Size:	227.6 KB
ID:	43543  
Started this thread Reply With Quote
  #7 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

Moving right along............

Attached Thumbnails
Click image for larger version

Name:	SuchANewb2.jpg
Views:	204
Size:	226.5 KB
ID:	43544  
Started this thread Reply With Quote
  #8 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

Please ignore the randomness of these posts...... it's just how I think, and I happen to be thinking out loud

Tracking color changes of IchiCloud, shown by red and green debug arrows.

Attached Thumbnails
Click image for larger version

Name:	SuchANewb3.jpg
Views:	184
Size:	250.0 KB
ID:	43545  
Started this thread Reply With Quote
  #9 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

HH/HL above BLUE Cloud = Green

LL/LH below RED Cloud = red

Neither = yellow

Attached Thumbnails
Click image for larger version

Name:	SuchANewb4.jpg
Views:	188
Size:	433.5 KB
ID:	43546  
Started this thread Reply With Quote
  #10 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


WTF?

Wanted to change the display name of the indie to something different. Then Bam! All my colors changed, and now nothing shows up in my indie pane. WTF?

Started this thread Reply With Quote




Last Updated on July 19, 2011


© 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