Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Pop up window
Collapse
X
-
Thanks Bertrand,
You mentioned I need public property. Is it public property of
private DMAType mAType1 = DMAType.EMA;
private DMAType mAType2 = DMAType.None;
changing them into public?
public DMAType mAType1 = DMAType.EMA;
public DMAType mAType2 = DMAType.None;
thanks
peter
Comment
-
No Peter, that would not be what's needed - I suggest you refer the reference sample code I pointed you to as it would show the implementation - http://www.ninjatrader.com/support/f...ead.php?t=3420
Comment
-
Hi Bertrand,
Because this is private indicator I am not allow to distribute I put on parts of code if you can help me to adjust that it can be used in strategy. I am playing with it 3 days and cannot make it work. Your example is working fine for me.Thanks. It looks like
In Public class Variables we have this:
private DMAType mAType1 = DMAType.EMA;
private DMAType mAType2 = DMAType.None;
publicenum DMAType
{
EMA = 1, // Exponential Moving Average.
HMA = 2, // Hull Moving Average. ....
OnBarUpdate() has the following:
//calculate and create set for first moving average type
switch(mAType1)
{
case DMAType.EMA:
ma2Series.Set(EMA(Input,mAPeriod1)[0]);
break;
I will continue in next message
Thanks
Peter
Comment
-
Hi Bertrand,
This is continuation from previous post. Please have a look post before.
In "Properties " we have the following:
[Description("Moving Average Type 1")]
[Category("Parameters")]
[Gui.Design.DisplayName("01. MAType1")]
[GridCategory("Slope")]
public NinjaTrader.Indicator.TsiPeterShort.DMAType MAType1
{
get { return mAType1; }
set { mAType1 = value; }
}
[Description("Moving Average Type 2")]
[Category("Parameters")]
[Gui.Design.DisplayName("03. MAType2")]
[GridCategory("Slope")]
public NinjaTrader.Indicator.TsiPeterShort.DMAType MAType2
{
get { return mAType2; }
set { mAType2 = value; }
}
In Stragegy I am calling the indicator and it looks like this:
, DMAType.EMA, DMAType.None,
To me its looks like strategy cannot find declaration for DMAType for some reason.
I can send you indicator and strategy privately if this option is here.Let me know.
Thanks
Peter
Comment
-
Thanks Bertrand,
Yes I need to learn more about c#.
I have another question:
I was doing cross in MACD indicator. It looks like this
CrossAbove(MACD(20, 50, 20), MACD(20, 50, 20).Avg, 1)
How can I make it do the cross on candle before. Like candle [1] or [2] ?
Thanks
Peter
Comment
-
Peter,
You can use the lookback parameter for CrossAbove().
If you set to 3 then it checks the last 3 bars to see if there has been a crossover.Ryan M.NinjaTrader Customer Service
Comment
-
Peter, you could learn about offsets in our Condition Builder help guide page - http://www.ninjatrader.com/support/h...on_builder.htm
Comment
-
Thanks Bertrand,
I can see that during backtest NT only thakes consideration Open and Close of the bar.In real live trading price move inside of the bar. In backtesting SL must be minimum under the low of the present bar. Ohtervise we can have openinghigher than SL , price can go down 50pips cross SL inside the bar and close Higher than SL and SL was not trigered.Is this correct?
Thanks
Peter88
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
85 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
47 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
29 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
32 views
0 likes
|
Last Post
|
||
|
Started by Mindset, 02-28-2026, 06:16 AM
|
0 responses
67 views
0 likes
|
Last Post
by Mindset
02-28-2026, 06:16 AM
|

Comment