NexusFi: Find Your Edge


Home Menu

 





In search of someone to help with these indicators!


Discussion in NinjaTrader

Updated
    1. trending_up 1,529 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 1 attachments




 
Search this Thread

In search of someone to help with these indicators!

  #1 (permalink)
Kgard252
Idaho, USA
 
Posts: 14 since Sep 2021
Thanks Given: 9
Thanks Received: 2


A user on here built this free indicators. Can someone help me replicate it? I have searched everywhere and cannot get it right. Specifically the Lower indicators, the black trend line, and the color changing HMA. THank you in advance. KGard

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
ZombieSqueeze
Platforms and Indicators
Exit Strategy
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #2 (permalink)
 SamirOfSalem   is a Vendor
 
Posts: 74 since Jan 2020
Thanks Given: 23
Thanks Received: 44


Kgard252 View Post
Attachment 318016
A user on here built this free indicators. Can someone help me replicate it? I have searched everywhere and cannot get it right. Specifically the Lower indicators, the black trend line, and the color changing HMA. THank you in advance. KGard

Hi Kgard.

For the black line on the main chart, if what you mean is getting it to "stair-step", try setting the Plot type to "Square".

For the color-changing MA in the bottom panel, one workaround is to create two (or more) plots for that same line, all running the same calculations. They'd be on top of one another initially. Then set some conditions to turn one off and keep the other(s), using .Reset() when the condition is satisfied.

See https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?reset.htm

You can also set the value to 0, but .Reset() is a better route IMHO.

I hope this helps.

Reply With Quote
Thanked by:
  #3 (permalink)
Kgard252
Idaho, USA
 
Posts: 14 since Sep 2021
Thanks Given: 9
Thanks Received: 2



SamirOfSalem View Post
Hi Kgard.

For the black line on the main chart, if what you mean is getting it to "stair-step", try setting the Plot type to "Square".

For the color-changing MA in the bottom panel, one workaround is to create two (or more) plots for that same line, all running the same calculations. They'd be on top of one another initially. Then set some conditions to turn one off and keep the other(s), using .Reset() when the condition is satisfied.

See https://ninjatrader.com/support/helpGuides/nt8/NT%20HelpGuide%20English.html?reset.htm

You can also set the value to 0, but .Reset() is a better route IMHO.

I hope this helps.

Thank you! That did help for the most part! I appreciate it!

Reply With Quote
  #4 (permalink)
 SamirOfSalem   is a Vendor
 
Posts: 74 since Jan 2020
Thanks Given: 23
Thanks Received: 44


Kgard252 View Post
Thank you! That did help for the most part! I appreciate it!

Great. You can also take things up a notch with PlotBrushes[x][barsago] (bear in mind Plots usually begin at 0, so the very first AddPlot creates a Plot[0] and PlotBrushes[0])

Reply With Quote
  #5 (permalink)
ezrollin
Cleburne
 
Posts: 14 since Dec 2019
Thanks Given: 21
Thanks Received: 0

 
Code
#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Gui;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Gui.SuperDom;
using NinjaTrader.Data;
using NinjaTrader.NinjaScript;
using NinjaTrader.Core.FloatingPoint;
using NinjaTrader.NinjaScript.DrawingTools;
#endregion

//This namespace holds Indicators in this folder and is required. Do not change it. 
namespace NinjaTrader.NinjaScript.Indicators
{
	
	public class Zombie3SMI : Indicator
	{
		private const string SystemVersion = "v1.001";
		private const string SystemName = "Zombie3SMI";
		private const string FullSystemName = SystemName + " - " + SystemVersion;
		private int	range		= 13;
		private int	emaperiod1	= 25;
		private int	emaperiod2	= 2;
		private int smiemaperiod= 5;
		
		private Series<double>	sms;
		private Series<double>	hls;
		private Series<double>	smis;

		Brush smiChangeColor = Brushes.Transparent;
		Brush smiBullishColor = Brushes.Transparent;
		Brush smiBearishColor = Brushes.Transparent;

		const int SMIChangePlotIndex = 0;
		const int SMIBullishPlotIndex = 1;
		const int SMIBearishPlotIndex = 2;

		public override string DisplayName
		{
			get { return FullSystemName; }
		}

		protected override void OnStateChange()
		{
			if (State == State.SetDefaults)
			{
				Name = SystemName;
				Description = FullSystemName;
				Calculate					= Calculate.OnPriceChange;
				IsOverlay					= false;
				DisplayInDataBox			= true;
				DrawOnPricePanel			= true;
				DrawHorizontalGridLines		= false;
				DrawVerticalGridLines		= false;
				PaintPriceMarkers			= false;
				ScaleJustification			= NinjaTrader.Gui.Chart.ScaleJustification.Right;
				IsSuspendedWhileInactive	= true;

				AddPlot(new Stroke(Brushes.DimGray, 3), PlotStyle.Line, "SMIChange");
				AddPlot(new Stroke(Brushes.RoyalBlue, 3), PlotStyle.Line, "SMIBullish");
				AddPlot(new Stroke(Brushes.DarkOrange, 3), PlotStyle.Line, "SMIBearish");


				AddPlot(new Stroke(Brushes.DimGray, 1), PlotStyle.Line, "SMIEMA");

				AddLine(new Stroke(Brushes.DimGray, DashStyleHelper.Dash, 1), 0, "ZeroLine");
				AddLine(new Stroke(Brushes.DimGray, DashStyleHelper.Dash, 1), 40, "OBLine");
				AddLine(new Stroke(Brushes.DimGray, DashStyleHelper.Dash, 1), -40, "OSLine");
			}
			else if (State == State.Configure)
			{
				//stochastic momentums
				sms		= new Series<double>(this);
				//high low diffs
				hls		= new Series<double>(this);
				//stochastic momentum indexes
				smis	= new Series<double>(this);
			}
			else if (State == State.DataLoaded)
            {
				smiChangeColor = Plots[SMIChangePlotIndex].Brush;
				smiBullishColor = Plots[SMIBullishPlotIndex].Brush;
				smiBearishColor = Plots[SMIBearishPlotIndex].Brush;
			}
		}

		protected override void OnBarUpdate()
		{
			if (( CurrentBar < emaperiod2) || ( CurrentBar < emaperiod1)) 
			{
				return;
			}
			
			//Stochastic Momentum = SM {distance of close - midpoint}
		 	sms[0] = (Close[0] - 0.5 * ((MAX(High, range)[0] + MIN(Low, range)[0])));
			
			//High low diffs
			hls[0] = (MAX(High, range)[0] - MIN(Low, range)[0]);

			//Stochastic Momentum Index = SMI
			double denom = 0.5*EMA(EMA(hls,emaperiod1),emaperiod2)[0];
 			smis[0] = (100*(EMA(EMA(sms,emaperiod1),emaperiod2))[0] / (denom ==0 ? 1 : denom  ));
			
			//Set the current SMI line value
			SMIChange[0] = (smis[0]);

			double currentSMIValue = SMIChange[0];
			double previousSMIValue = SMIChange[1];
			bool smiSlopeBullish = (currentSMIValue >= previousSMIValue);

			//EMA1Change[0] = currentEMA1Value;

			if (smiSlopeBullish)
			{
				PlotBrushes[SMIChangePlotIndex][0] = smiBullishColor;
			}
			else
			{
				PlotBrushes[SMIChangePlotIndex][0] = smiBearishColor;
			}


			//Set the line value for the SMIEMA by taking the EMA of the SMI
			SMIEMA[0] = (EMA(smis, smiemaperiod)[0]);

		}

		#region Properties
		[NinjaScriptProperty]
		[Display(Name = "IndicatorName", GroupName = "0) Indicator Information", Order = 0)]
		public string IndicatorName
		{
			get { return FullSystemName; }
			set { }
		}

		[NinjaScriptProperty]
		[Range(1, int.MaxValue)]
		[Display(Name="EMAPeriod1", Description="1st ema smothing period. ( R )", Order=1, GroupName="Parameters")]
		public int EMAPeriod1
		{
			get { return emaperiod1; }
			set { emaperiod1 = value; }
		}

		[NinjaScriptProperty]
		[Range(1, int.MaxValue)]
		[Display(Name="EMAPeriod2", Description="2nd ema smoothing period. ( S )", Order=2, GroupName="Parameters")]
		public int EMAPeriod2
		{
			get { return emaperiod2; }
			set { emaperiod2 = value; }
		}
		

		[NinjaScriptProperty]
		[Range(1, int.MaxValue)]
		[Display(Name="Range", Description="Range for momentum Calculation ( Q )", Order=3, GroupName="Parameters")]
		public int Range
		{
			get { return range; }
			set { range = value ; }
		}		

		[NinjaScriptProperty]
		[Range(1, int.MaxValue)]
		[Display(Name="SMIEMAPeriod", Description="SMI EMA smoothing period", Order=4, GroupName="Parameters")]
		public int SMIEMAPeriod
		{
			get { return smiemaperiod; }
			set { smiemaperiod = value; }
		}


		[Browsable(false)]
		[XmlIgnore]
		public Series<double> SMIChange
		{
			get { return Values[0]; }
		}

		[Browsable(false)]
		[XmlIgnore()]
		public Series<double> SMIBullish
		{
			get { return Values[1]; }
		}

		[Browsable(false)]
		[XmlIgnore()]
		public Series<double> SMIBearish
		{
			get { return Values[2]; }
		}

		[Browsable(false)]
		[XmlIgnore]
		public Series<double> SMIEMA
		{
			get { return Values[3]; }
		}

		#endregion

	}
}

#region NinjaScript generated code. Neither change nor remove.

namespace NinjaTrader.NinjaScript.Indicators
{
	public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
	{
		private Zombie3SMI[] cacheZombie3SMI;
		public Zombie3SMI Zombie3SMI(string indicatorName, int eMAPeriod1, int eMAPeriod2, int range, int sMIEMAPeriod)
		{
			return Zombie3SMI(Input, indicatorName, eMAPeriod1, eMAPeriod2, range, sMIEMAPeriod);
		}

		public Zombie3SMI Zombie3SMI(ISeries<double> input, string indicatorName, int eMAPeriod1, int eMAPeriod2, int range, int sMIEMAPeriod)
		{
			if (cacheZombie3SMI != null)
				for (int idx = 0; idx < cacheZombie3SMI.Length; idx++)
					if (cacheZombie3SMI[idx] != null && cacheZombie3SMI[idx].IndicatorName == indicatorName && cacheZombie3SMI[idx].EMAPeriod1 == eMAPeriod1 && cacheZombie3SMI[idx].EMAPeriod2 == eMAPeriod2 && cacheZombie3SMI[idx].Range == range && cacheZombie3SMI[idx].SMIEMAPeriod == sMIEMAPeriod && cacheZombie3SMI[idx].EqualsInput(input))
						return cacheZombie3SMI[idx];
			return CacheIndicator<Zombie3SMI>(new Zombie3SMI(){ IndicatorName = indicatorName, EMAPeriod1 = eMAPeriod1, EMAPeriod2 = eMAPeriod2, Range = range, SMIEMAPeriod = sMIEMAPeriod }, input, ref cacheZombie3SMI);
		}
	}
}

namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
{
	public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
	{
		public Indicators.Zombie3SMI Zombie3SMI(string indicatorName, int eMAPeriod1, int eMAPeriod2, int range, int sMIEMAPeriod)
		{
			return indicator.Zombie3SMI(Input, indicatorName, eMAPeriod1, eMAPeriod2, range, sMIEMAPeriod);
		}

		public Indicators.Zombie3SMI Zombie3SMI(ISeries<double> input , string indicatorName, int eMAPeriod1, int eMAPeriod2, int range, int sMIEMAPeriod)
		{
			return indicator.Zombie3SMI(input, indicatorName, eMAPeriod1, eMAPeriod2, range, sMIEMAPeriod);
		}
	}
}

namespace NinjaTrader.NinjaScript.Strategies
{
	public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
	{
		public Indicators.Zombie3SMI Zombie3SMI(string indicatorName, int eMAPeriod1, int eMAPeriod2, int range, int sMIEMAPeriod)
		{
			return indicator.Zombie3SMI(Input, indicatorName, eMAPeriod1, eMAPeriod2, range, sMIEMAPeriod);
		}

		public Indicators.Zombie3SMI Zombie3SMI(ISeries<double> input , string indicatorName, int eMAPeriod1, int eMAPeriod2, int range, int sMIEMAPeriod)
		{
			return indicator.Zombie3SMI(input, indicatorName, eMAPeriod1, eMAPeriod2, range, sMIEMAPeriod);
		}
	}
}

#endregion

Reply With Quote




Last Updated on October 30, 2021


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts