NexusFi: Find Your Edge


Home Menu

 





A little help for my friends Simple Code problem


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one cory with 1 posts (0 thanks)
    2. looks_two deandavis with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 iantg with 1 posts (1 thanks)
    1. trending_up 1,990 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
deandavis's Avatar
 deandavis 
Poulsbo, Wa US
 
Experience: Intermediate
Platform: NinjaTrader Tradestation
Broker: Ninja Trader, Continuum
Trading: ES, CL
Posts: 30 since Jul 2010
Thanks Given: 111
Thanks Received: 6

I am attempting to rename a Bar Type and have run into a problem
Here is what I have done

I have made a copy of a NT provided Bar Type and am changing its name
All of this was done with the NT Editor
I made the following changes to the code
Within the NT editor I changed its name to MoesCustomBarType
Within the file I changed the Public Class to MoesCustomBarsType
and replaced every instance of the words Original BarType name to MoesCustom
I compile without error.
I restarted NT and tried to open a new chart with the new BarType. But it is not listed.

I receive no errors on screen and there are no errors in the log file.
I reopen the Editor and now there are 2 errors.
The errors read
NinjaTrader Custom.Resource 'does not contain a definition for 'NinjaScriptBarsTypeMoesCustom'
'NinjaTrader Data BarsPeriodType' does not contain a definition for 'MoesCustom'
And the errors point to these lines of code
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Name = Custom.Resource.NinjaScriptBarsTypeMoesCuston ;
BarsPeriod = new BarsPeriod { BarsPeriodType = BarsPeriodType.MoesCustom };
DaysToLoad = 3;

}
else if (State == State.Configure)
{
switch (BarsPeriod.BaseBarsPeriodType)
Can anyone give me a hand and direct me to a solution??
Thanks
Dean


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Day 96 Missiles Hit Kuwait and Bahrain: June 15 Peace at …
Prediction Markets & Event Contracts
Kalshi Sets $4.13B All-Time Weekly Record as Polymarket …
Prediction Markets & Event Contracts
Victory Day Delivers: Russia-Ukraine Ceasefire Market Cl …
Prediction Markets & Event Contracts
The Confluence Meter: A Multi-Layered Signal Framework B …
The Elite Circle
Orban Crashes to 21pct on Record Turnout -- McIlroy Drop …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 
cory's Avatar
 cory 
virginia
the coin hunter
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,093


there is more than just changing bar name; example of unirenko NT8
 
Code
		protected override void OnStateChange()
		{
			if (State == State.SetDefaults)
			{
				Description							= @"Universal renko bar type. Ported by Sim22, 2015. [email protected]";
				Name								= "UniRenko";
				BarsPeriod							= new BarsPeriod { BarsPeriodType = (BarsPeriodType) 501, BarsPeriodTypeName = "UniRenkoBarsType(501)", Value = 1 };
				BuiltFrom							= BarsPeriodType.Tick;
				DaysToLoad							= 3;
				IsIntraday							= true;
			}
			else if (State == State.Configure)
			{
				Properties.Remove(Properties.Find("BaseBarsPeriodType",			true));
				//Properties.Remove(Properties.Find("BaseBarsPeriodValue",		true));
				Properties.Remove(Properties.Find("PointAndFigurePriceType",	true));
				Properties.Remove(Properties.Find("ReversalType",				true));
				
				SetPropertyName("Value", "Tick Trend");
				SetPropertyName("Value2", "Tick Reversal");
				SetPropertyName("BaseBarsPeriodValue",  "Open Offset");
				
				Name = "UniR T" + BarsPeriod.Value +"R" + BarsPeriod.Value2; // +"O" + BarsPeriod.BaseBarsPeriodValue;
				/// I kept the UI name short b/c as of NT8b6 the name space at the toolbar is very short. You would not see the values. Sim22.
			}
		}


Reply With Quote
  #4 (permalink)
 iantg 
charlotte nc
 
Experience: Advanced
Platform: My Own System
Posts: 409 since Jan 2015
Thanks Given: 91
Thanks Received: 1,152

I can at least explain the exact error you hit.

If you type NinjaTrader.Custom.Resource. at this point after the (dot) you should see a window pop up with all the available options that you can select that belong to the NinjaTrader.Customer.Resource class. If you then type something that does not exist within this, you will hit this error message. So it sounds like whatever it is that you are building, you need to get it into this class.

Here are a few links to get you started:

https://forum.ninjatrader.com/showthread.php?t=97592
https://forum.ninjatrader.com/showthread.php?t=93289
https://forum.ninjatrader.com/showthread.php?t=84486

Ian


deandavis View Post
I am attempting to rename a Bar Type and have run into a problem
Here is what I have done

I have made a copy of a NT provided Bar Type and am changing its name
All of this was done with the NT Editor
I made the following changes to the code
Within the NT editor I changed its name to MoesCustomBarType
Within the file I changed the Public Class to MoesCustomBarsType
and replaced every instance of the words Original BarType name to MoesCustom
I compile without error.
I restarted NT and tried to open a new chart with the new BarType. But it is not listed.

I receive no errors on screen and there are no errors in the log file.
I reopen the Editor and now there are 2 errors.
The errors read
NinjaTrader Custom.Resource 'does not contain a definition for 'NinjaScriptBarsTypeMoesCustom'
'NinjaTrader Data BarsPeriodType' does not contain a definition for 'MoesCustom'
And the errors point to these lines of code
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Name = Custom.Resource.NinjaScriptBarsTypeMoesCuston ;
BarsPeriod = new BarsPeriod { BarsPeriodType = BarsPeriodType.MoesCustom };
DaysToLoad = 3;

}
else if (State == State.Configure)
{
switch (BarsPeriod.BaseBarsPeriodType)
Can anyone give me a hand and direct me to a solution??
Thanks
Dean


In the analytical world there is no such thing as art, there is only the science you know and the science you don't know. Characterizing the science you don't know as "art" is a fools game.
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on June 28, 2018


© 2026 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 - Downloads - Top
no new posts