Am I closing out the position incorrectly? P&L is there until I do the ExitLong(). I have tried passing nothing and passing the signalName but the strategy tab shows no realized or unrealized profit once I make this call.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
ExitLong doesn't show P&L
Collapse
X
-
ExitLong doesn't show P&L
When I go long with an EnterLong(), then have the trade appreciate, and then do an ExitLong(), I see a "Buy to cover" on the chart, but my P&L dissapears and it looks as if the original trade was never made.
Am I closing out the position incorrectly? P&L is there until I do the ExitLong(). I have tried passing nothing and passing the signalName but the strategy tab shows no realized or unrealized profit once I make this call.Tags: None
-
Sorry, should have been more clear, if you look in the strategy tab, when the order is long and above water, the unrealized gains show up. As soon as you close the position using ExitLong(), the unrealized gains goes to zero and realized gains does not increase, it remains at zero.
Comment
-
Shouldn't the realized gains show up in the strategies tab? It does when I close out orders using other methods. And in the cases I am talking about, the PnL on the trade was positive. I will try to look at the performance by right clicking, but something is wrong here, I know its supposed to update that row in the strategies tab in real time. It does when the position is open, but as soon as I close a position (that was created originally as a market order) with ExitLong("signalName") or ExitLong(), the value goes back to zero.
I think something else is up here, thanks for the help but does anyone have any additional ideas?
Comment
-
Would it be possible for someone to try to reproduce this? Just create a strategy through ninja script that EnterLong() market order, then wait until its a few points above and ExitLong(). Watch the strategy tab in the control center. See how the unrealized gains fluctuates as the price of the instrument fluctuates? Once you ExitLong(), does the realized gains update at all?
Comment
-
Originally posted by NinjaTrader_Ray View PostDid you check the performance? Was the trade PnL zero?
Comment
-
Originally posted by ryker View PostI've got the same problem, although the PnL is reported correctly in the MarketAnalyser (but not the position and the unrealized PnL which are reported correclty in the strategy performance tab!).
Ryker, when you say strategy tab performance you don't mean the tab with strategies in the control center right?
Comment
-
Lets not confuse things here, two different things.
tradefaz, I have tried it here and it works as expected. Please following instructions in prior posts.
ryker,
PnL in MA displays account based PnL, strategy reports strategy based PnL. They are not one to one relationship. I suspect you likely have seen this before but in case you have not, this might be of value - http://www.ninjatrader-support.com/v...ead.php?t=4033RayNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Ray View PostLets not confuse things here, two different things.
tradefaz, I have tried it here and it works as expected. Please following instructions in prior posts.
ryker,
PnL in MA displays account based PnL, strategy reports strategy based PnL. They are not one to one relationship. I suspect you likely have seen this before but in case you have not, this might be of value - http://www.ninjatrader-support.com/v...ead.php?t=4033
Because if that is what you're able to do I am not able to. But if you're saying that its not supposed to show realized gains after a position is closed within a strategy, and that column is purely for displaying unrealized gains on open positions, then I guess its doing what its supposed to do.
Sorry for all the confusion, its a bit difficult to explain all this in writing.
EDIT: I should stop saying realized P&L, i mean realized gains column, sorry.Last edited by tradefaz; 08-21-2008, 12:17 PM.
Comment
-
Ray,
I'm aware of what you say, but both of them should show the same numbers in realized if you trade a strategy on just a symbol and don't trade this symbol anywhere else.
Anyway realized column is not populated in strategy tab (or stays at 0), unrealized sometimes stays at 0 and is sometimes populated (I mean when I'm in position).
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rocketman7, Today, 02:12 AM
|
7 responses
30 views
0 likes
|
Last Post Today, 09:23 AM | ||
Started by guillembm, Yesterday, 11:25 AM
|
3 responses
16 views
0 likes
|
Last Post Today, 09:11 AM | ||
Started by junkone, 04-21-2024, 07:17 AM
|
10 responses
149 views
0 likes
|
Last Post Today, 09:03 AM | ||
Started by tsantospinto, 04-12-2024, 07:04 PM
|
6 responses
101 views
0 likes
|
Last Post
by tsantospinto
Today, 08:57 AM
|
||
Started by trilliantrader, 04-18-2024, 08:16 AM
|
7 responses
28 views
0 likes
|
Last Post Today, 07:56 AM |
Comment