NexusFi: Find Your Edge


Home Menu

 





A little help for my friends Simple Code problem


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Quick Summary with 1 posts (0 thanks)
    2. looks_two iantg with 1 posts (1 thanks)
    3. looks_3 cory with 1 posts (0 thanks)
    4. looks_4 deandavis with 1 posts (0 thanks)
    1. trending_up 2,171 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?
$12M Ceasefire Contract Goes Disputed as Bandar Abbas St …
Prediction Markets & Event Contracts
GDP Day: The First Economic Reckoning -- Pahlavi at 6.55 …
Prediction Markets & Event Contracts
Hormuz Completely Closed: US Strikes Day 2, Iran Shoots …
Traders Hideout
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
Iran Fired a Missile at Israel Last Night. The $8M June …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
10 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #3 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,099 since Jun 2009
Thanks Given: 877
Thanks Received: 8,098


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,154

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://discourse.ninjatrader.com/showthread.php?t=97592
https://discourse.ninjatrader.com/showthread.php?t=93289
https://discourse.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