Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
How do I use AddHeikenAshi
Collapse
X
-
How do I use AddHeikenAshi
In my indicator I want to have some calculation based on HeikenAshi OHLC candles, so for this I include AddHeikenAshi() in ''else if (State == State.Configure)'' but I do not know how to fill the parameters of AddHeikenAshi(). I want the same instruments and the same timeframe as whatever the timeframe and instrument my indicator is applied to. So for instance if I apply my indicator to a chart of ES with 30min candles, I want the HeikenAshi OHLC candles for ES on the 30min chart. How do I do this ?Tags: None
-
Hello alanlopen,
You can see an example of using AddHeikenAshi at the bottom of its help guide page:
This method does not have a way to inherit the primary instrument so you would need to type in the instrument like shown in the sample.
Timeframes cannot be automatically assumed by any of the add data methods so that is something you also need to specify when adding it.
JesseNinjaTrader Customer Service
-
Hello alanlopen,
To do that you would need to AddHeikenAshi so the script always adds that data. You can then make a enum property that is used from OnBarUpdate to determine which indicator value to use.
The AddDataSeries/AddHeikenAshi methods are not dynamic and cannot use variables so if you plan to use secondary data based on a user selection you still have to always add that secondary data and then make the choice of what series is used in your OnBarUpdate logic.
JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by bortz, 11-06-2023, 08:04 AM
|
47 responses
1,607 views
0 likes
|
Last Post
by aligator
Today, 07:22 PM
|
||
Started by jaybedreamin, Today, 05:56 PM
|
0 responses
9 views
0 likes
|
Last Post
by jaybedreamin
Today, 05:56 PM
|
||
Started by DJ888, 04-16-2024, 06:09 PM
|
6 responses
19 views
0 likes
|
Last Post
by DJ888
Today, 05:12 PM
|
||
Started by Jon17, Today, 04:33 PM
|
0 responses
6 views
0 likes
|
Last Post
by Jon17
Today, 04:33 PM
|
||
Started by Javierw.ok, Today, 04:12 PM
|
0 responses
15 views
0 likes
|
Last Post
by Javierw.ok
Today, 04:12 PM
|
Comment