[FONT=Courier New][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] (Positions[[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]].MarketPosition!=MarketPosition.Short) { EnterShortLimit( [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2],[/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]5[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2], GetCurrentBid( [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2] ), [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000]"Short"[/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2]); } [/SIZE][/FONT]
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Positions.MarketPosition
Collapse
X
-
Positions.MarketPosition
When using the following code, my position ends up +- 10 contracts. Can anyone tell me why?
Code:Tags: None
-
I suggest debugging your strategy as per here: http://www.ninjatrader-support.com/v...ead.php?t=3627
-
OK I have solved my original problem by adding that code to my initialize method. Now when I turn on my strategy, I get the following message...
8/18/2008 10:39:14 AM Entered internal PlaceOrder() method at 8/18/2008 10:39:14 AM: Action=SellShort OrderType=Limit Quantity=5 LimitPrice=1.8601 StopPrice=0 SignalName='Futures Short' FromEntrySignal=''
8/18/2008 10:39:14 AM Ignored PlaceOrder() method at 8/18/2008 10:39:14 AM: Action=SellShort OrderType=Limit Quantity=5 LimitPrice=1.8601 StopPrice=0 SignalName='Futures Short' FromEntrySignal='' Reason='Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'
My position is long 5 contracts, and it is ignoring my orders to sell saying 'Exceeded entry signals limit based on EntryHandling and EntriesPerDirection properties'. Additionally, my positions are no longer showing up in the Positions tab, they only show in the strategy tab. Also, no orders are showing up in my Orders window anymore either.
Comment
-
Please consult the docs to understand NT's entry order handling and related options/properties: http://www.ninjatrader-support.com/H...verview36.html
Comment
-
I cannot find anything in the documentation that explains why my strategies tab shows a position of 5L, however my positions, executions and orders tabs are all blank. This was working for me earlier this am.
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by brunoviveiros, 02-17-2020, 05:31 AM
|
4 responses
63 views
0 likes
|
Last Post Today, 06:25 AM | ||
Started by volIQ, 03-27-2024, 04:28 PM
|
3 responses
21 views
0 likes
|
Last Post
by RJay
Today, 05:41 AM
|
||
Started by Nickgiaco, 02-26-2024, 10:23 AM
|
2 responses
72 views
0 likes
|
Last Post Today, 05:12 AM | ||
Started by Johndc, Today, 04:39 AM
|
0 responses
8 views
0 likes
|
Last Post
by Johndc
Today, 04:39 AM
|
||
Started by johntraderuser2, Today, 02:34 AM
|
0 responses
11 views
0 likes
|
Last Post Today, 02:34 AM |
Comment