NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 02-28-2008, 06:49 PM   #1
BradB
Senior Member
 
Join Date: Jan 2007
Location: , ,
Posts: 180
Thanks: 0
Thanked 1 time in 1 post
Default Bars.Period.Id

Hi,
I'm trying to store the value of Bars.Period.Id in a variable.

When I print it I get MInute, Tick, or whatever the current value is, but I can't store it.

for example:

Type = Bars.Period.Id (Type is a string varible) or
Tppe = (string)Bars.Period.Id

I get "Cannot convert type 'NInja Trader.Data.PeriodType" to 'string'

ANy thoughts?
BradB is offline  
Reply With Quote
Old 02-28-2008, 09:40 PM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Use the .ToString() method.
Type = Bars.Period.Id.ToString()
NinjaTrader_Josh is offline  
Reply With Quote
Old 02-29-2008, 08:27 AM   #3
BradB
Senior Member
 
Join Date: Jan 2007
Location: , ,
Posts: 180
Thanks: 0
Thanked 1 time in 1 post
Default

Thanks Josh.
BradB is offline  
Reply With Quote
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
Bars are wrong on strategy performance (negative bars) woodside Historical NinjaTrader 6.5 Beta Threads 2 01-13-2008 10:22 PM
Period 14 crossing Period Linear Regression 25 Viper3 Strategy Development 8 10-21-2007 10:51 AM
Add second symbol of same PeriodType, Period Folls Strategy Development 2 10-11-2007 05:59 PM
Momentum bars or Price Range Bars Akros Indicator Development 7 06-10-2007 04:55 AM
Trial Period Activation Ripcat Installation and Licensing 3 11-10-2005 05:35 AM


All times are GMT -6. The time now is 08:11 PM.