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 algospoke, Yesterday, 06:40 PM
|
2 responses
23 views
0 likes
|
Last Post
by algospoke
Today, 07:04 PM
|
||
Started by ghoul, Today, 06:02 PM
|
3 responses
14 views
0 likes
|
Last Post Today, 06:43 PM | ||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
45 views
0 likes
|
Last Post
by jeronymite
Yesterday, 10:10 PM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
7 responses
22 views
0 likes
|
Last Post Today, 06:16 PM | ||
Started by AttiM, 02-14-2024, 05:20 PM
|
10 responses
181 views
0 likes
|
Last Post
by jeronymite
Today, 06:11 PM
|
Comment