Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Detecting open position values
Collapse
X
-
Detecting open position values
Is it possible for NinjaScript to detect the average price and share size of a position previously opened outside of the strategy. For example, a strategy primarily for manageing and exiting a position. If I manually enter a position and then start a strategy I want it to detect the size and price of the manual entry. -
One final question. I am live with IB. IB forces a close once each day. Does that mean it is impossible to use NT strategy for a long term position? If the strategy gets into a position today. IB forces a shutdown. Then tomorrow the strategy would have to be restarted and NT would not be able to recognize the prior position?
Comment
-
Hi JKrider,
Upon disconnect, you can reconnect and restart the strategy, then sync the position manually by submitting an order in NinjaTrader is necessary.
More info at - http://www.ninjatrader-support.com/H...ccountPosition
With NinjaTrader 7, strategy persistence will make this process easier.
More info at - http://www.ninjatrader.com/support/h...tegies_tab.htm under NinjaScript tabTimNinjaTrader Customer Service
Comment
-
OK. Let me understand. Scenario 1: in a position with both Strategy and Account positions the same. End of Day, I stay open in the account. Next day i start strategy and synch. A - if no new strategy position in the morning, the strategy finds yesterday position, opens and agrees with Account. When strategy closes it will close the account. B - Strategy opens in morning, finds a new entry, submits order and now the strategy shows 1 lot while account is 2 lots. So, i have to sell 1 lot to synchronize. C - in morning the strategy finds a trade in opposite direction. It is short 1 lot, account long 1 lot. I have to sell two lots to synchronize. Scenario 2: End of Day i close my position and the strategy quits running, but had not exited the position. A - Next morning the strategy picks up from yesterday and shows long 1 lot while I am flat. I manually enter a position to synch, but the prices are obviously different. B - It opens in morning and the conditions are such to close the position. Now strategy and account are the same.
If this is the case, I understand, but this is a lot of work if running swing strategies on 15 - 20 stocks. Again, the information is available to NT as shown in the Control Center Position Tab. It has instrument, side, Qty, Avg Price, Account, Connection. If there is some way to access this information via the strategy then it would be simple programming to keep the strategy and account synchronized without the acrobatics.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by cmtjoancolmenero, Yesterday, 03:58 PM
|
11 responses
39 views
0 likes
|
Last Post Today, 11:40 AM | ||
Started by FrazMann, Today, 11:21 AM
|
0 responses
3 views
0 likes
|
Last Post
by FrazMann
Today, 11:21 AM
|
||
Started by geddyisodin, Yesterday, 05:20 AM
|
8 responses
52 views
0 likes
|
Last Post Today, 10:45 AM | ||
Started by DayTradingDEMON, Today, 09:28 AM
|
4 responses
26 views
0 likes
|
Last Post Today, 10:47 AM | ||
Started by George21, Today, 10:07 AM
|
1 response
22 views
0 likes
|
Last Post Today, 10:43 AM |
Comment