Go Back   NinjaTrader Support Forum > NinjaTrader 7 > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 11-17-2011, 04:56 PM   #1
Klaus Hengher
Member
 
Join Date: Apr 2009
Posts: 63
Thanks: 5
Thanked 9 times in 5 posts
Default Select/Add renko/custom time frame to strategy

Hi,

Is it possible to select custom time frame from strategy parameter

I tried

[Description("longer timeframe chart to ensure correct direction")]
[GridCategory("TimeFrame")]
[Gui.Design.DisplayName("3. LongerPeriod")]
[TypeConverter(typeof(ExpandableObjectConverter))]
public Period LongerPeriod {
get { return longerPeriod; }
set { longerPeriod = value; }
}

this shows all properties of Period. This is confusing for user.

Is it possible to use Type converter from dataseries selection (see screenshot)

And how to add custom period to strategy
Startegy has no accessable method Add( Period p ).
Attached Images
File Type: png Select Period.png (143.7 KB, 119 views)
Klaus Hengher is offline  
Reply With Quote
Old 11-17-2011, 05:11 PM   #2
NinjaTrader_RyanM1
NinjaTrader Customer Service
 
NinjaTrader_RyanM1's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,127
Thanks: 249
Thanked 436 times in 429 posts
Default

Hello Klaus Hengher,

Using a Period type like this is unfortunately not supported. We support only hard coding additional series with exactly the interval and type you would like to add. Some users report success with user defined inputs for added series. This would be an integer for the interval value and PeriodType would need to be hard coded.

For Renko, there is dedicated method:
AddRenko()

Adding more flexibility for custom bar types is on our list for future consideration.
NinjaTrader_RyanM1 is offline  
Reply With Quote
Old 01-19-2013, 08:00 AM   #3
pakricard
Member
 
Join Date: Dec 2010
Posts: 52
Thanks: 12
Thanked 2 times in 2 posts
Default

Hi Ryan:

SOme improvement on this issue? I have a Custom bar type and would like to Add it to an strategy as second timeframe.

Is there any way to do it?
pakricard is offline  
Reply With Quote
Old 01-19-2013, 05:54 PM   #4
NinjaTrader_JC
NinjaTrader Customer Service
 
NinjaTrader_JC's Avatar
 
Join Date: Mar 2012
Location: Denver, CO
Posts: 2,611
Thanks: 261
Thanked 480 times in 468 posts
Default

Hello pakrichard,

Using a dynamic Add() method is still unsupported, but if you have custom bar type that you would like to use in the Add() method you would call the Custom type that it is using for example:

Code:
Add(PeriodType.Custom0, 1);
NinjaTrader_JC is offline  
Reply With Quote
Old 01-20-2013, 03:09 PM   #5
Klaus Hengher
Member
 
Join Date: Apr 2009
Posts: 63
Thanks: 5
Thanked 9 times in 5 posts
Default

It is possible, see screenshot
Attached Images
File Type: jpg CustomBarType.jpg (94.4 KB, 176 views)
Klaus Hengher is offline  
Reply With Quote
The following 2 users say thank you to Klaus Hengher for this post:
Old 01-29-2013, 08:17 AM   #6
PN7777
Junior Member
 
Join Date: Oct 2012
Posts: 1
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by Klaus Hengher View Post
It is possible, see screenshot
Hi Klaus
How did you get that....
PN7777 is offline  
Reply With Quote
Old 01-29-2013, 08:26 AM   #7
Klaus Hengher
Member
 
Join Date: Apr 2009
Posts: 63
Thanks: 5
Thanked 9 times in 5 posts
Default

I'am developer for NinjaTrader and needed this undocumented feature in some projects.
Send me PM if your are interested in the code
Klaus Hengher is offline  
Reply With Quote
The following user says thank you to Klaus Hengher for this post:
Old 10-15-2013, 08:59 AM   #8
echgroup
Junior Member
 
Join Date: Aug 2012
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by Klaus Hengher View Post
I'am developer for NinjaTrader and needed this undocumented feature in some projects.
Send me PM if your are interested in the code
Hi Klaus,

Have you ever tried the UniRenk bar type that was posted in this Forum last year?

If you have, did you notice when starting MarketReplay, the chart alway drops a few ticks before midnight if session template is set to <Use instrument defaults>? However, if set to <Default 24/7> every tick is captured. Either case, the chart is messed up when MarketReplay starts playing back.

I read the code so many times and cannot figure out what caused this. And this issues, of course, is unsupported.

If you get a chance, can you please take a look?

Regards,
echgroup is offline  
Reply With Quote
Old 05-14-2014, 01:47 PM   #9
AnotherTrader
Senior Member
 
Join Date: Aug 2009
Posts: 359
Thanks: 83
Thanked 9 times in 9 posts
Default

Quote:
Originally Posted by NinjaTrader_JC View Post
Hello pakrichard,

Using a dynamic Add() method is still unsupported, but if you have custom bar type that you would like to use in the Add() method you would call the Custom type that it is using for example:

Code:
Add(PeriodType.Custom0, 1);
Would that work for a custom Renko, too?
AnotherTrader is offline  
Reply With Quote
Old 05-14-2014, 02:07 PM   #10
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO
Posts: 11,549
Thanks: 780
Thanked 1,994 times in 1,921 posts
Default

Hello AnotherTrader,

Thank you for your post.

It will work but you need to call the correct number for the custom bar type. Add(PeriodType.Custom0, 1); uses the PeriodType or Custom0, yours may be Custom1 or even Custom9. If the custom bar type is unprotected you can view it's code by going to the following directory on your PC and opening the .cs file in a notepad: (My) Documents\NinjaTrader 7\bin\Custom\Type
NinjaTrader_PatrickH is offline  
Reply With Quote
The following user says thank you to NinjaTrader_PatrickH for this post:
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Methods and Multiple Time Frame neb1998 Strategy Development 2 01-22-2011 02:06 PM
Add day in multiple time frame binwang2 General Development 9 09-21-2009 08:21 AM
Multi-time frame strategy - Longer-term real-time calculations Shansen Strategy Development 1 04-19-2009 06:36 AM
Custom time frame mydet Suggestions And Feedback 1 07-14-2007 08:06 AM
Minute Time Frame Indicators in a TickTime Frame strategy Nathamus General Development 5 04-10-2007 02:41 AM


All times are GMT -6. The time now is 02:07 AM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content.