orderSize = AccountSize * some value etc.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
AccountSize and PnL
Collapse
X
-
AccountSize and PnL
So I understand we have to keep track of account size etc. but how do we get the profit and loss from each trade after it has been closed? Does the Position.GetProfitLoss() return the TOTAL profit and loss since running or for the last position etc? I am trying to compound my trades...for instance...
orderSize = AccountSize * some value etc.Tags: None
-
Account size and P&L
I am trying to use the Performance.AllTrades.TradesPerformance.Currency.C umProfit in attempt to add it to my starting account value. From there I would like to calculate a % of this total from which I could derive the max position size. I am attemtping to build this into an indicator so that it is not hard coded into a strategy. I get the error "The name Performance does not exist in the current context." This is my first endeavor into programming and do not know what this means? Is it not allowed as part of an indicator? Is there any code out there that successfully uses this statement to adjust position size?
Thanks for your help.
Comment
-
Hello,
"The name Performance does not exist in the current context."
Means that you are using something out of scope. In this case you are trying to access trade information in an indicator. You can only do this in a strategy.
The sample link I provided is a good place to start learning how to use performance information.DenNinjaTrader Customer Service
Comment
-
Hello ashlantz,
Thanks for writing in.
These links are expired - here are the links to the Trade and Trade Collection classes:
Trade - http://ninjatrader.com/support/helpGuides/nt7/trade.htm
TradeCollection - http://ninjatrader.com/support/helpG...collection.htm
Please let me know if I may be of any further assistance.Alan S.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by DJ888, Yesterday, 06:09 PM
|
2 responses
9 views
0 likes
|
Last Post
by DJ888
Today, 10:31 PM
|
||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
40 views
0 likes
|
Last Post
by jeronymite
Today, 10:10 PM
|
||
Started by bill2023, Today, 08:51 AM
|
2 responses
16 views
0 likes
|
Last Post
by bill2023
Today, 10:10 PM
|
||
Started by sidlercom80, 10-28-2023, 08:49 AM
|
167 responses
2,260 views
0 likes
|
Last Post
by jeronymite
Today, 09:54 PM
|
||
Started by warreng86, 11-10-2020, 02:04 PM
|
7 responses
1,362 views
0 likes
|
Last Post Today, 09:41 PM |
Comment