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 1,264 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

A little help for my friends Simple Code problem

  #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: 109
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?
How to apply profiles
Traders Hideout
Better Renko Gaps
The Elite Circle
Increase in trading performance by 75%
The Elite Circle
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
GFIs1 1 DAX trade per day journal
11 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
10 thanks
  #3 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


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
Broker: Optimus
Trading: Emini (ES, YM, NQ, ect.)
Posts: 408 since Jan 2015
Thanks Given: 90
Thanks Received: 1,148

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


© 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