![]() |
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
|
|||||||
| 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. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
|
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?
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,234
Thanks: 83
Thanked 336 times in 328 posts
|
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()
Jason
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
|
What do you mean by "on top"?
|
|
|
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,234
Thanks: 83
Thanked 336 times in 328 posts
|
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).
Jason
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Jason for this post: |
|
|
|
#6 |
|
Junior Member
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
|
Ahhhh...thank you very much!!!!
|
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
|
When i try to do this i get errors. Any suggestions?
|
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,234
Thanks: 83
Thanked 336 times in 328 posts
|
Can you please hit F5 or right click in the code window and select 'Compile'.
Let me know if the errors remain.
Jason
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
|
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?
|
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Dec 2009
Posts: 8
Thanks: 1
Thanked 0 times in 0 posts
|
I also just tried to duplicate the example from the sample ma cross that was posted below and it still says programming errors
.
|
|
|
|
|
|
#11 |
|
NinjaTrader Customer Service
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,234
Thanks: 83
Thanked 336 times in 328 posts
|
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.
Jason
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |