![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
|
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? |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
See if this Help Guide section helps - http://www.ninjatrader-support.com/H...tegiesTab.html
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
|
Perfect! This is exactly what I was looking for.
thank you
|
|
|
|
|
|
#4 | |
|
Senior Member
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
|
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:
|
|
|
|
|
|
|
#5 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#6 | |
|
Senior Member
Join Date: Mar 2008
Posts: 731
Thanks: 0
Thanked 1 time in 1 post
|
Quote:
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... |
|
|
|
|
|
|
#7 | |
|
Junior Member
|
Quote:
|
|
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Sep 2012
Location: Denver, CO, USA
Posts: 756
Thanks: 37
Thanked 113 times in 112 posts
|
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.
Lance B.
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Lance for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |