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
Custom indicator question
Collapse
X
-
Custom indicator question
I'm working on creating a custom indicator for NinjaTrader 8, and I'm trying to implement a feature that draws a box around two bars whenever they share the same close and open price. Not having any luck no matter what i try to enter. I've been exploring the NinjaTrader API, but I'm unsure about the specific steps or code snippets needed for this functionality. Has anyone successfully implemented a similar feature or could provide guidance on how to achieve this within the NinjaTrader 8 platform? Any help or code examples would be greatly appreciated. Thanks!Tags: None
-
Hello tmullen614,
Thanks for your post.
A condition could be created that checks if the current Close price (Close[0]) is equal to the current Open price (Open[0]) and also check if the previous Close price (Close[1]) is equal to the previous Open price (Open[1]). The Draw.Rectangle() method would be called within that condition to draw a rectangle on the chart window.
To have the rectangle drawn from the previous bar to the current bar, you could consider setting the startBarsAgo property to 1 and the endBarsAgo property to 0.
See the help guide documentation below for more information and sample code.
Close: https://ninjatrader.com/support/help.../nt8/close.htm
Open: https://ninjatrader.com/support/helpGuides/nt8/open.htm
Draw.Rectangle(): https://ninjatrader.com/support/help..._rectangle.htm
Below is a link to a forum post with helpful information about getting started with NinjaScript.
https://ninjatrader.com/support/foru...040#post786040
I am also linking you to the Educational Resources section of the Help Guide to help you get started with NinjaScript:
If you are new to C#, to get a basic foundation for the concepts and syntax used in NinjaScript I would recommend this section of articles in our help guide first:
And the MSDN (Microsft Developers Network) C# Language Reference.
https://ninjatrader.com/support/help...erence_wip.htmBrandon H.NinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Haiasi, 04-25-2024, 06:53 PM
|
2 responses
17 views
0 likes
|
Last Post
by Massinisa
Today, 05:32 AM
|
||
Started by Creamers, Today, 05:32 AM
|
0 responses
5 views
0 likes
|
Last Post
by Creamers
Today, 05:32 AM
|
||
Net Change
by Segwin
Started by Segwin, 05-07-2018, 02:15 PM
|
12 responses
1,786 views
0 likes
|
Last Post
by Leafcutter
Today, 05:30 AM
|
||
Started by poplagelu, Today, 05:00 AM
|
0 responses
3 views
0 likes
|
Last Post
by poplagelu
Today, 05:00 AM
|
||
Started by fx.practic, 10-15-2013, 12:53 AM
|
5 responses
5,408 views
0 likes
|
Last Post
by Bidder
Today, 12:22 AM
|
Comment