Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
how do you get the current day's profit loss?
Collapse
X
-
Tags: None
-
Hello amedhussaini,
Thank you for your post.
You will need to work with the TradePerformance class to get this information.
The following reference sample can help with using this class and resetting values at the start of the day:
http://www.ninjatrader.com/support/f...ad.php?t=19289Ryan M.NinjaTrader Customer Service
-
NinjaTrader_RyanM,
My system comes out with zero hits after I added the code to check ((Position.GetProfitLoss(Close[0], PerformanceUnit.Points) > 0). If I // that and make it comments, my strategy come out with a profit of 39180.00 and a 44% Profitable. Am I getting garbage in the input because those
performance checks give my program zero results. I think it might be blowing up on if ((Position.MarketPosition != MarketPositon.Flat). I believe I need to add OnExecution(IExecution execution), and iOrder Routines, etc.
Comment
-
Hello William staton,
Welcome to the NinjaTrader forums!
Yes, if you have that check for your entries, then you will likely not get trades.
If there is no PnL to check then no trades can be placed to generate PnL.
Let us know what you're trying to do, share some more code and we can assist further.Ryan M.NinjaTrader Customer Service
Comment
-
Position.GetProfitLoss(Close[0]
NinjaTrader_RyanM,
You were right! I did the test after i did a buy or sell and then I was able to interrigate the Position GetProfitLoss(Close[0] and it ddn't blow up. Thanks. Now, since I've implemented the code I'm close to 50%, but my profits are going down. I'm using the
Back101 test data. I was trying to use the SIM101 account. I put my userid, password, for Mirus Futures, and I couldn't find the SIM101 Account. How do I get to the SIM101 Account? Do I have to have Mirus give me one? Thanks for your help.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
582 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
338 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
554 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
552 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment