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 > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 08-31-2011, 12:22 PM   #1
tanju23
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
Default Stragety WILL NOT enter when I click activate...

When I go to activate a strategy it says it is already in one, how do I get the strategy to just look at what is coming in at that moment instead of history? Is there a work around for this Highly Annoying feature?
tanju23 is offline  
Reply With Quote
Old 08-31-2011, 12:33 PM   #2
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,234
Thanks: 83
Thanked 336 times in 328 posts
Default

Hello tanju23,

You can include the following statement in your code to avoid the strategy to be calculated on historical data.

// Only run on real-time data
if (Historical)
return;

Add the statement to the top of OnBarUpdate()
NinjaTrader_Jason is offline  
Reply With Quote
Old 08-31-2011, 12:48 PM   #3
tanju23
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
Default

I'm using the wizard to start with...is this a problem? When i unlock code I see this

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()

What would it look like with what you are saying to do?
tanju23 is offline  
Reply With Quote
Old 08-31-2011, 01:00 PM   #4
tanju23
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
Default

What do you mean by "on top"?
tanju23 is offline  
Reply With Quote
Old 08-31-2011, 01:32 PM   #5
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,234
Thanks: 83
Thanked 336 times in 328 posts
Default

You will need to unlock the code in order to insert the statement. Please see the attached screenshot for an example.

I included the statement in the SampleMACrossOver strategy. It is the first statement below OnBarpdate() (to the top).
Attached Images
File Type: png tanju23.PNG (78.5 KB, 8 views)
NinjaTrader_Jason is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Jason for this post:
Old 08-31-2011, 01:34 PM   #6
tanju23
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
Default

Ahhhh...thank you very much!!!!
tanju23 is offline  
Reply With Quote
Old 08-31-2011, 02:14 PM   #7
tanju23
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
Default

When i try to do this i get errors. Any suggestions?
Attached Images
File Type: gif NinjaQuestion.png (59.7 KB, 7 views)
tanju23 is offline  
Reply With Quote
Old 08-31-2011, 03:03 PM   #8
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,234
Thanks: 83
Thanked 336 times in 328 posts
Default

Can you please hit F5 or right click in the code window and select 'Compile'.

Let me know if the errors remain.
NinjaTrader_Jason is offline  
Reply With Quote
Old 02-24-2012, 07:13 AM   #9
tanju23
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
Default Still Havings Problems

I know its been awhile since i last posted...but i never did get to work. When i hit F5 or right click and compile, a window pops up and says error generating strategy. Is this because I'm the strategy wizard to start off with?
tanju23 is offline  
Reply With Quote
Old 02-24-2012, 07:21 AM   #10
tanju23
Junior Member
 
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
Default ???

I also just tried to duplicate the example from the sample ma cross that was posted below and it still says programming errors.
tanju23 is offline  
Reply With Quote
Old 02-24-2012, 07:43 AM   #11
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,234
Thanks: 83
Thanked 336 times in 328 posts
Default

Please debug the code to solve the compiling errors. You can find general debug information at the link below.
http://www.ninjatrader-support2.com/...ead.php?t=3418

If the issue remains, please post a new screenshot of the compiling error.
NinjaTrader_Jason 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
Activate Autotrader Burtm1 Strategy Analyzer 5 03-28-2011 07:38 PM
NT7 order sync of starting stragety - thanks, high risk no benefit approach NetTecture Suggestions And Feedback 5 08-27-2009 02:15 AM
NinjaTrade Draw object ill-behavior? bienduga Indicator Development 6 12-15-2008 10:16 AM
Simple Price Indicator and Stragety heyligerb Indicator Development 1 11-12-2008 07:31 AM
Naked Position - Apply Managed Stragety? underground Miscellaneous Support 5 01-24-2006 11:52 PM


All times are GMT -6. The time now is 09:02 PM.