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
Paintbar - Doji Star
Collapse
X
-
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
-
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
-
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
-
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 strategist007, Today, 07:51 PM
|
0 responses
2 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by StockTrader88, 03-06-2021, 08:58 AM
|
44 responses
3,967 views
3 likes
|
Last Post
by jhudas88
Today, 06:59 PM
|
||
Started by rbeckmann05, Today, 06:48 PM
|
0 responses
4 views
0 likes
|
Last Post
by rbeckmann05
Today, 06:48 PM
|
||
Started by rhyminkevin, Today, 04:58 PM
|
4 responses
58 views
0 likes
|
Last Post
by dp8282
Today, 06:13 PM
|
||
Started by iceman2018, Today, 05:07 PM
|
0 responses
6 views
0 likes
|
Last Post
by iceman2018
Today, 05:07 PM
|
Comment