NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

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
Prev Previous Post   Next Post Next
Old 10-07-2008, 12:18 PM   #1
Ninja B
Member
 
Join Date: Apr 2008
Posts: 99
Thanks: 0
Thanked 0 times in 0 posts
Question Unrealized + realized profits?

I'm trying to add the prior trades results with the unrealized profit of an open position.

priorTradesCumProfit = Performance.RealtimeTrades.TradesPerformance.Curre ncy.CumProfit;

if (Performance.RealtimeTrades.TradesPerformance.Curr ency.CumProfit - priorTradesCumProfit >= 1000.

^^ I got this from Josh's sample code.

I searched and found GetProfitLoss.


So then I would have

if (Performance.RealtimeTrades.TradesPerformance.Curr ency.CumProfit - priorTradesCumProfit + Position.GetProfitLoss (Close[0], PerformanceUnit.Points >= 1000.

Something like that I think? Am I on the right track?
Ninja B is offline  
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unrealized and Realized PnL in points/pips and % in stead of only $ whitegun Suggestions And Feedback 22 11-14-2008 05:54 PM
What's the best way to get profits for the day? tradefaz General Programming 3 09-02-2008 08:13 AM
Why did you remove "Realized + Unrealized PnL" from the Columns list? shawnj Market Analyzer 7 05-28-2008 11:34 AM
Lost unrealized profits kgillis23 Automated Trading 8 02-27-2008 04:32 PM
No Money in unrealized or realized for Forex jlm0@infionline.net Historical NinjaTrader 6.5 Beta Threads 5 11-12-2007 10:35 AM


All times are GMT -6. The time now is 07:25 PM.