NinjaTrader Support Forum  

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

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

Reply
 
Thread Tools Display Modes
Old 07-13-2012, 04:10 PM   #1
coolmoss
Senior Member
 
Join Date: Dec 2007
Posts: 365
Thanks: 36
Thanked 28 times in 24 posts
Default Secondary data series causing issue

If I attempt to enable the strategy below, and look at the strategy setup window immediately thereafter, it shows as disabled. If I remove the Add() renko bars, it works fine. I've employed multiple timeframes in many other strategies and never had any issues, but this is the first time I'm using Volume bars as primary data series. Am I forgetting to do something here?

Code:
protected override void Initialize()
        {
            Add(PeriodType.Renko,3);
            CalculateOnBarClose = true;
        }

        /// <summary>
        /// Called on each bar update event (incoming tick)
        /// </summary>
        protected override void OnBarUpdate()
        {
            if (BarsInProgress != 0)return;
			
		// Condition set 1
            if (Close[0] > Open[0] )
            {
                DrawArrowUp("My up arrow" + CurrentBar, false, 0, Low[0] + -2 * TickSize, Color.Lime);
                EnterLong(DefaultQuantity, "");
            }
			
        }
EDIT: I just tried changing the Renko secondary series to Minute and it works.

Never mind, my bad. I see there is a special syntax for this: AddRenko()
Last edited by coolmoss; 07-13-2012 at 04:24 PM.
coolmoss is offline  
Reply With Quote
Old 07-14-2012, 02:08 PM   #2
NinjaTrader_AdamP
NinjaTrader Customer Service
 
NinjaTrader_AdamP's Avatar
 
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
Default

coolmoss,

I am happy you have resolved your issue. Please feel free to contact us any time.
NinjaTrader_AdamP 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
DataSeries on a secondary data series JoshDance Indicator Development 4 05-30-2012 11:29 AM
Secondary Series and Data, Int, Bool Series TAJTrades General Programming 1 03-24-2012 08:13 AM
Secondary data series in Indicator mokodo General Programming 2 03-22-2012 04:35 AM
Referencing secondary data series for a strategy daven Strategy Development 4 06-26-2011 08:46 PM
Weekend data not triggering on secondary time series gert74 Strategy Development 12 08-28-2007 08:12 PM


All times are GMT -6. The time now is 04:47 PM.