NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Strategy Analyzer

Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

Reply
 
Thread Tools Display Modes
Old 08-29-2012, 07:58 PM   #1
TexFly
Member
 
Join Date: Aug 2012
Posts: 89
Thanks: 0
Thanked 4 times in 4 posts
Default Sync

Hello,

Doesn't matter what setting I apply, I always get the strategy position not in sync message. I have modified the settings as instructed, even added the Accountsize in the code...no luck.

Any idea?

Thanks!
Tex
TexFly is offline  
Reply With Quote
Old 08-29-2012, 08:12 PM   #2
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,856
Thanks: 162
Thanked 579 times in 570 posts
Default

Hello,

Thank you for your post and welcome to our forums.

Do you have live positions or orders working on your account? Is this a live account or the Sim101 account?

Exactly what settings have you changed? Did you set Sync Account Position to True?
NinjaTrader_Matthew is offline  
Reply With Quote
Old 08-30-2012, 03:16 AM   #3
TexFly
Member
 
Join Date: Aug 2012
Posts: 89
Thanks: 0
Thanked 4 times in 4 posts
Default

Hello Matthew,

I'm still testing using Sim101.

The settings are:
Price=day, days to load 365, bar on close=true, min bars 20, slippage=1, entries per direc=1, stop&Target=bystrategy, sync account position=true, account size=500, order quantity=by account.

Tex
TexFly is offline  
Reply With Quote
Old 08-30-2012, 04:15 AM   #4
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello Tex,
Thanks for your post and I am replying for Matthew.

If your account is flat but if there an open position as calculated in the historical bars of the strategy then NinjaTrader will sync itself (by submitting an order) to match the account position and the strategy position if you set Sync Account Position to true.

Please refer to our help guide to know more about it
http://www.ninjatrader.com/support/h..._account_p.htm
NinjaTrader_Joydeep is offline  
Reply With Quote
Old 08-30-2012, 07:15 AM   #5
TexFly
Member
 
Join Date: Aug 2012
Posts: 89
Thanks: 0
Thanked 4 times in 4 posts
Default

I see, that's why as soon as I enable the strategy an order gets triggered immediately. How do I enable a strategy so that entry orders are placed ONLY when a condition happen?
TexFly is offline  
Reply With Quote
Old 08-30-2012, 07:23 AM   #6
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello Tex,
You can append the below code to stop the strategy from calculating the historical bars.

Code:
protected override void OnBarUpdate()
{
	
	if (Historical)
		return;
	
       //rest of the codes
}
This way your strategy will be live (with no positions) when you enable it.
NinjaTrader_Joydeep is offline  
Reply With Quote
Old 08-30-2012, 09:16 AM   #7
TexFly
Member
 
Join Date: Aug 2012
Posts: 89
Thanks: 0
Thanked 4 times in 4 posts
Default

Great! Now when I place my strategy I do not get the error anymore. You Guys rock!

Thanks.
TexFly is offline  
Reply With Quote
Old 08-30-2012, 09:18 AM   #8
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
Default

Hello Tex,
Thanks for your note.

Please let me know if I can assist you any further.
NinjaTrader_Joydeep 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
Sync Message cfree5119 Charting 3 01-25-2012 02:20 PM
Sync StringSeries DaveS General Programming 1 11-10-2011 01:39 PM
How to sync data orshk Miscellaneous Support 1 07-24-2011 04:43 PM
Out of Sync momentom SuperDOM and other Order Entry Windows 2 09-21-2009 11:16 AM
Charts not in Sync muna580 Charting 10 04-16-2009 12:30 PM


All times are GMT -6. The time now is 01:12 AM.