![]() |
|
|||||||
| Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Aug 2012
Posts: 89
Thanks: 0
Thanked 4 times in 4 posts
|
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 |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,858
Thanks: 162
Thanked 579 times in 570 posts
|
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?
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Aug 2012
Posts: 89
Thanks: 0
Thanked 4 times in 4 posts
|
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 |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
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
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Aug 2012
Posts: 89
Thanks: 0
Thanked 4 times in 4 posts
|
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?
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
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
}
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Member
Join Date: Aug 2012
Posts: 89
Thanks: 0
Thanked 4 times in 4 posts
|
Great! Now when I place my strategy I do not get the error anymore. You Guys rock!
Thanks. |
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello Tex,
Thanks for your note. Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |