NinjaTrader Support Forum  

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 05-14-2008, 02:45 PM   #1
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default Questions related to switching from simulation to live strategies...

I just had a quick question about switching from simulation to live mode when a strategy is already running.

For example I have a strategy with a condition:

If CurrentMarketPosition = Long
....
....
ExitLong

I had this strategy running on my chart, and when I unchecked global simulation mode, the strategy went short, went it was supposed to be exiting an existing long. The problem is that the existing long was a simulated trade, and when the exit condition was triggered it was a real trade, but not the one I expected.

Is there a proper way to switch to live mode that will start flat regardless of historical trades?

Also when running a strategy is there a setting that determines whether NT will try to 'catch up' to the previous order, or simply wait for the next trigger?
Elliott Wave is offline  
Reply With Quote
Old 05-14-2008, 03:05 PM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

See if this Help Guide section helps - http://www.ninjatrader-support.com/H...tegiesTab.html
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-14-2008, 03:07 PM   #3
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default

Perfect! This is exactly what I was looking for.

thank you
Elliott Wave is offline  
Reply With Quote
Old 05-19-2008, 04:25 PM   #4
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default

I had a quick question about this. Both of these options seem like a compromise. I really wish strategies could be intelligently synchronized with the live account position.

The problem is that NT doesn't seem to be able to recognize the difference between 'Sell Short' and 'Exit Long". Those are two very different things. Furthermore, why can't the program tell the difference between a real-time order and simulated order?

The main question though, is there a way this limitation can be overcome within the strategy itself?

Instead of using "If Position.MarketPosition == MarketPosition.Long" is there something else that more accurately reflects the actual account position?

Within my strategy I have conditions that enter, reverse and exit a position. If I use the option to "Wait Until Flat..." I may be waiting a very long time as most of the conditions reverse from long to short etc. so my position is rarely flat.

If I use "Immediately submit live working historical orders" I run the risk of having an "Exit Long" order turning into a short position. This could result in my actual account position being the inverse of the strategy position which is a disaster waiting to happen, making this option largely unusable. If I manually enter a live order to synchronize the position, I'm usually stuck with a crappy entry after the primary move has already happened.




Any ideas?


Quote:
Wait until flat before executing live
When a NinjaScript strategy that relies on historical data to calculate it's current position and orders state is started, it will wait until the strategy position has a flat position before executing any live orders.

Immediately submit live working historical orders
When a NinjaScript strategy that relies on historical data to calculate it's current position and orders state is started, it will immediately submit live any working orders that reflect the current strategy's overall order state. It is IMPORTANT to understand that the position of the strategy reported in the Strategies tab may not reflect the actual account-based position reported in the Accounts tab at the time the strategy is started. Should you wish to synchronize your strategy position with your account position you will have to manually place an order to your account via the Control Center Orders tab.
Elliott Wave is offline  
Reply With Quote
Old 05-19-2008, 04:34 PM   #5
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

There is no one to one relationship of a strategy position to an account position, this provides flexiblity in that it allows a trader to separate -

- Multiple concurrent strategies in the same market
- Automated trades vs concurrent discretionary trades
- Automated trades from long term position trades

There are many other reasons why there is not auto synchronization that ultimatley lead to user intervention. I will put on my list to discuss this in more detail in a stick post in the future.

For now, you have to manually synchronize.
NinjaTrader_Ray is offline  
Reply With Quote
Old 05-20-2008, 04:09 PM   #6
Elliott Wave
Senior Member
 
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by NinjaTrader_Ray View Post
There is no one to one relationship of a strategy position to an account position, this provides flexiblity in that it allows a trader to separate -

- Multiple concurrent strategies in the same market
- Automated trades vs concurrent discretionary trades
- Automated trades from long term position trades

There are many other reasons why there is not auto synchronization that ultimatley lead to user intervention. I will put on my list to discuss this in more detail in a stick post in the future.

For now, you have to manually synchronize.
Thanks Ray. The reasons you outline make sense. The option to auto-synchronize would be nice though for people who would rather trade some flexibility for convenience...

In the meantime, the best solution I've found is to "flatten everything" after starting a new strategy.

Rather than "If Long... Enter Short", most of my conditions are structured "If Not Short... Enter Short", "If Not Long... Enter Long" so most entries will be taken and I'll only miss a few entries based specifically on reversal patterns of existing entries doing things this way...
Elliott Wave is offline  
Reply With Quote
Old 02-11-2013, 03:17 PM   #7
GaryGuy
Junior Member
 
Join Date: Apr 2012
Location: Bellevue, WA
Posts: 13
Thanks: 11
Thanked 0 times in 0 posts
Send a message via Skype™ to GaryGuy
Default

Quote:
Originally Posted by NinjaTrader_Ray View Post
See if this Help Guide section helps - http://www.ninjatrader-support.com/H...tegiesTab.html
This link is no longer valid
GaryGuy is offline  
Reply With Quote
Old 02-11-2013, 03:27 PM   #8
NinjaTrader_Lance
NinjaTrader Customer Service
 
NinjaTrader_Lance's Avatar
 
Join Date: Sep 2012
Location: Denver, CO, USA
Posts: 756
Thanks: 37
Thanked 113 times in 112 posts
Default

Hello,

This is an old thread from NinjaTrader 6.5

For version 7 help guide on the strategies tab
http://www.ninjatrader.com/support/h...tegies_tab.htm
http://www.ninjatrader.com/support/h...egies_tab2.htm

Please let me know if I can be of further assistance.
NinjaTrader_Lance is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Lance for this post:
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
Patsystems Live with IB Simulation shawnj Installation and Licensing 5 04-11-2008 10:40 AM
Double positions switching sides running live w/ profit targets Pete S Strategy Development 13 04-02-2008 10:59 PM
Live vs. Simulation higler Charting 6 06-29-2007 05:12 PM
switching from sim acct. to live acct.? dave898 Miscellaneous Support 1 03-30-2006 01:22 PM
2 Questions related to brokers craigsn Miscellaneous Support 1 12-20-2004 10:30 AM


All times are GMT -6. The time now is 04:52 PM.