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 > NinjaScript Development Support > Strategy Development

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

Reply
 
Thread Tools Display Modes
Old 10-06-2010, 11:06 AM   #1
Jeremytang
Senior Member
 
Join Date: Jun 2010
Location: Calgary, AB
Posts: 102
Thanks: 0
Thanked 2 times in 2 posts
Send a message via MSN to Jeremytang Send a message via Skype™ to Jeremytang
Default Way to reset strategy/account positions?

Hi,

I had a strategy that had some errors with serialization, causing NT to shut down unexpectedly. I've since fixed those errors, but noticed that one my symbols (NG) is now consistently out of sync with any strategy I run.

Is there a way to wipe the slate clean and somehow reset the position information for a particular symbol?

Jeremy
Jeremytang is offline  
Reply With Quote
Old 10-06-2010, 11:14 AM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello Jeremy,

The strategy position is generated by the signals of the strategy. There's no way to state it explicitly.

You may consider adding the following lines to your strategy, which means it only runs on real time data. With this the strategy won't run on historical data and should then be in a flat state at the start.

if (Historical)
return;
NinjaTrader_RyanM is offline  
Reply With Quote
Old 10-12-2010, 08:08 AM   #3
MKTTHOTS
Junior Member
 
Join Date: Sep 2010
Posts: 23
Thanks: 0
Thanked 0 times in 0 posts
Default

Hi,
I have a question relating to reconcilliation between STRATEGY position and ACCOUNT position. I understand the concept and operation of Strategy vs. Account. What I would like to do is to generate an ALERT or NOTICE (such as an email) when the Strategy is out of Sync with Account positions?
With thanks in advance,
MT
MKTTHOTS is offline  
Reply With Quote
Old 10-12-2010, 08:30 AM   #4
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello MKTTHOTS,

Unfortunately this is something that would have to be monitored manually. There aren't built in NinjaScript methods that can access your account position.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 10-12-2010, 08:32 AM   #5
MKTTHOTS
Junior Member
 
Join Date: Sep 2010
Posts: 23
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Ryan & understood. Question, what is the best way to monitor this in your opinion?
MKTTHOTS is offline  
Reply With Quote
Old 10-12-2010, 08:37 AM   #6
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

You can use the NinjaTrader control center for this. The strategies tab will show your strategy position. The positions tab will show account positions.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 12-12-2010, 08:51 PM   #7
millridge
Member
 
Join Date: Nov 2009
Posts: 61
Thanks: 2
Thanked 1 time in 1 post
Default

How come I don't get the strategy position under strategy tab? The account position under position tab looks fine. I am running NT7.0.1000.1. with IB connection.
millridge is offline  
Reply With Quote
Old 12-12-2010, 09:17 PM   #8
millridge
Member
 
Join Date: Nov 2009
Posts: 61
Thanks: 2
Thanked 1 time in 1 post
Default

never mind, I found the reason.
millridge is offline  
Reply With Quote
Old 12-13-2010, 06:50 AM   #9
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
Default

Glad you got it resolved, for more info on different sync options in NT7 please see this article from the helpguide - http://www.ninjatrader.com/support/h..._positions.htm
NinjaTrader_Bertrand 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
Reset on Sim account hangs EthanHunt Version 7 Beta General Questions & Bug Reports 1 09-15-2010 07:54 AM
Account.Orders and Account.Positions.FindByInstrument aljafp Version 7 Beta General Questions & Bug Reports 3 03-23-2010 10:28 PM
GPF when trying to reset Sim account gg80108 Miscellaneous Support 10 03-27-2009 10:30 AM
Reset Sim account PNL to 0 gg80108 Miscellaneous Support 1 03-26-2009 09:28 AM
Strategy and Account Positions issues WhoKnows Miscellaneous Support 9 02-04-2009 08:12 AM


All times are GMT -6. The time now is 12:44 PM.