![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Mar 2006
Location: Bellingham, WA , USA
Posts: 329
Thanks: 0
Thanked 11 times in 8 posts
|
I have always assumed that when calling "Position.AvgPrice" for position one gets the average ENTRY price for a position, but judging by how my strategy is behaving it appears that I am actually getting the average Price of my combined positions based on what they were at the last bar close. My problem is I am using the above price as a limit order for the remaining runner after I take off two contracts at a first profit target. Here is the code I am using.
Code:
if (Position.MarketPosition == MarketPosition.Short
&& Position.Quantity == 1)
{
ExitShortLimit(Position.AvgPrice , "SBreakEven Exit", "SRunner");
}
Thanks DaveN |
|
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| syncing strategy position with acct position | pistolpete | Automated Trading | 21 | 03-23-2009 07:15 AM |
| Market Replay vs. Real-world/Real-time | ctrlbrk | Strategy Development | 14 | 12-01-2008 03:16 PM |
| Why Position.AvgPrice gives not exact price | pmaglio | Strategy Development | 8 | 07-24-2008 12:32 PM |
| How real real-time DOM and TS ? | maxima | General Programming | 5 | 05-01-2008 02:54 PM |
| Position.AvgPrice | MrBaffalo | Strategy Development | 1 | 05-16-2007 09:01 AM |