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 Jonker, Today, 01:19 PM
|
0 responses
1 view
0 likes
|
Last Post
by Jonker
Today, 01:19 PM
|
||
Started by futtrader, Today, 01:16 PM
|
0 responses
5 views
0 likes
|
Last Post
by futtrader
Today, 01:16 PM
|
||
Net Change
by Segwin
Started by Segwin, 05-07-2018, 02:15 PM
|
14 responses
1,791 views
0 likes
|
Last Post
by aligator
Today, 11:47 AM
|
||
Started by Jimmyk, 01-26-2018, 05:19 AM
|
6 responses
844 views
0 likes
|
Last Post
by emuns
Today, 11:27 AM
|
||
Started by jxs_xrj, 01-12-2020, 09:49 AM
|
6 responses
3,296 views
1 like
|
Last Post
by jgualdronc
Today, 10:56 AM
|
Comment