Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Paintbar - Doji Star
Collapse
X
-
Actually, you have the opposite problem in this case. Your indicator has no outputs, as all of your entities are declared as private, so you cannot access any output, including the indicator itself, from any other class.Originally posted by McClellan View Post
-
Ok, I changed the following lines:
//added by MM - to allow patterns to be incorporated into strategy
public BoolSeries BearishEngulfingFound;
public BoolSeries BullishEngulfingFound;
Still no workie.
The indicator was already set to public.
publicclass CandleStickPatternAll : Indicator
Comment
-
A method can be exposed by simply declaring it public. A BoolSeries is an object: you have to expose it using a property definition.Originally posted by McClellan View PostOk, I changed the following lines:
//added by MM - to allow patterns to be incorporated into strategy
public BoolSeries BearishEngulfingFound;
public BoolSeries BullishEngulfingFound;
Still no workie.
The indicator was already set to public.
publicclass CandleStickPatternAll : Indicator
Here is an example: http://www.ninjatrader.com/support/f...ead.php?t=4991
Comment
-
Understood. Added the following code to the indicator:
[Browsable(false)]
[XmlIgnore()]
public BoolSeries bullishEngulfingFound
{
get { return BullishEngulfingFound; } // Allows our public BearIndication BoolSeries to access and expose our internal bearIndication BoolSeries
}
[Browsable(false)]
[XmlIgnore()]
public BoolSeries bearishEngulfingFound
{
get { return BearishEngulfingFound; } // Allows our public BullIndication BoolSeries to access and expose our internal bullIndication BoolSeries
}
[Browsable(false)]
[XmlIgnore()]
publicdouble ExposedVariable
{
// We need to call the Update() method to ensure our exposed variable is in up-to-date.
get { Update(); return exposedVariable; }
}
And to the strategy:
protectedoverridevoid OnBarUpdate()
{
if (CandleStickPatternAll().BullishEngulfingFound[0])
EnterLong();
if (CandleStickPatternAll().BearishEngulfingFound[0])
EnterShort();
Print(CandleStickPatternAll().ExposedVariable);
}
Compile errors are in the strategy, at the above 3 lines. Can't figure out why.
Comment
-
Here is what the using region looks like in the strategy:
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
Comment
-
At this point, I think I will have to load up the files on my own machine, if I am to see what is happening, as I cannot see anything obviously defective. The matter does not seem to be any secret, so maybe you could just post the files that you are using, and let me see if I can nail the problem?Originally posted by McClellan View PostHere is what the using region looks like in the strategy:
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
Comment
-
Do not export. You cannot export if any file(s) in your tree have errors. Just post the .cs files. They are what we are trying to correct.Originally posted by McClellan View PostThat would be great. Can I get some instructions on how to do that? I tried to "export ninjascript" and it says "You have files with programming errors. You must resolve these programming errors before you can export a ninjascript."
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
590 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
342 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
555 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment