I'm running Ninjatrader 8.1.1.7 if it matters.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Using BarsInARow as index?
Collapse
X
-
Upon further investigation, the CandleStickPatternLogic is part of a different class that does not have the private objects defined in that class: public class CandleStickPatternLogicOriginally posted by Conceptzx View PostI've tried Open[lastBullOpen], lastBullindex, lastBullOpen, and n.Open[lastBullIndex], etc. Trying to define the first of the two blue candles for the bar calculation and it's always returned a cs0103.
I'm trying to get line 759 to work at this time. It's currently disabled in the cs file so it could be in a compiled state. .
(I have a couple different additions I'm working on so you'll see some things disabled and others active and unfinished.)
The private objects such as lastBullOpen, lastBullIndex, etc. are part of the indicator class: public class CandlestickPattern : Indicator
The difference between access modifiers and how they are used between different classes is more of a general C# topic and is not specific to NinjaScript. This indicator is a little bit complex to work with due to that custom class CandleStickPatternLogic at the bottom of the file. If you require more hands-on development assistance with this indicator, you could consider contacting a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our NinjaTrader Ecosystem team to follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request or provide one-on-one educational services.
Please let me know if I may be of further assistance.
Comment
-
First, I would like to reiterate something from one of my previous replies:Originally posted by Conceptzx View PostCan you elaborate a little further about the public / private class relationship or suggest a portion of the help guide I should read into?
Have you followed these steps to work with a copy of the CandleStickPattern script? If not, the original script will overwrite your changes and any changes you made will be lost. Please follow these steps if you have not copied this script already:Are you currently editing the existing CandleStickPattern indicator that comes with NinjaTrader, or have you created a copy of this script that you are modifying? The script you have provided has the same name and I am not able to move it into my own indicators folder without receiving several errors. If you have not already, please right-click the script and select Save As then give the script a new name such as CandleStickPatternModified in order to save the script into its own new file and prevent errors related to the modification of a system script.- Open the original CandleStickPattern script in the NinjaScript Editor
- Right-click the window and select Save As. Give the copy a name.
- Press F5 to compile. There will be compile errors due to duplicate names that crossover between the original and your copy. You should find and replace the duplicated items with a new name. Compile in between each new change to check for additional errors.
- For example, change the "public enum ChartPattern" to a new name such as "public enum ChartPatternModified"
- Change "public class CandleStickPatternLogic" to "public class CandleStickPatternLogicModified"
- Change line 302 from "public CandleStickPatternLogic(NinjaScriptBase ninjaScript, int trendStrength)" to "public CandleStickPatternLogicModified(NinjaScriptBase ninjaScript, int trendStrength)"
When it comes to accessing a property, such as lastBullIndex, from the indicator class, you could copy what the CandleStickPatternLogic already does for trendStrength:
You will also need to make the variable a public property in the Properties section of the indicator.Code:public CandleStickPatternLogic(NinjaScriptBase ninjaScript, int trendStrength) { this.ninjaScript = ninjaScript; this.trendStrength = trendStrength; }
I appreciate your time and patience.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
602 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
347 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
559 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment