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 Mestor, 03-10-2023, 01:50 AM
|
11 responses
303 views
0 likes
|
Last Post
by z.franck
Today, 02:29 AM
|
||
Started by Padan, Today, 02:02 AM
|
0 responses
6 views
0 likes
|
Last Post
by Padan
Today, 02:02 AM
|
||
Started by bukowa, 11-09-2023, 06:07 PM
|
20 responses
407 views
0 likes
|
Last Post
by Adfra
Today, 01:36 AM
|
||
Started by yertle, Yesterday, 05:49 PM
|
2 responses
11 views
0 likes
|
Last Post
by yertle
Today, 12:12 AM
|
||
Started by kaywai, Today, 12:06 AM
|
0 responses
10 views
0 likes
|
Last Post
by kaywai
Today, 12:06 AM
|
Comment