Thanks
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
Where can I find additional samples reference for OnPositionUpdate() ?
Collapse
X
-
Hello pstrusi,
I wasn't able to locate an example using these values from OnPositionUpdate(), so I have created one that prints these values and attached.
OnPositionUpdateTest_NT8.zip
I can also provide an example that uses the SystemPerformance collection when the position updates.
Hello, I've updated the DailyLossLimit and DailyLosLimitMultiTrade examples that were posted on the forum for NinjaTrader 7 for NinjaTrader 8. These are often requested and I felt they are good examples to have for NT8. DailyLossLimitExample_NT7 - http://ninjatrader.com/support/forum...241#post451241 (http://ninjatrader
Chelsea B.NinjaTrader Customer Service
- Likes 1
-
Chelsea, I appreciate your example, it's helping me but still there's some confusion. I have to ask:
1. What is the difference between: position.AveragePrice and averagePrice??
2. What is the difference between: position.Quantity, and quantity ?
3. Why in the NT8 guide tells as Method Parameters things like: averageFillPrice when there's not even in the example that you gave? So, the guide is wrong?
I just want to know these values for the recent position changes when this method is called after any execution.
Looking forward.
Thanks in advanceLast edited by pstrusi; 11-09-2023, 09:40 AM.
Comment
-
Hello pstrusi,
These are basically the same. The position.AveragePrice is the AveragePrice saved in the position object that is updating, while the averagePrice is the same parameter directly passed to the method. Same with the position.Quantity and quantity.
If you have tested the script I have provided you, you should be able to see the values update after the position changes.
I will note to our development we need to update the help guide to reflect averagePrice instead of averageFillPrice.Chelsea B.NinjaTrader Customer Service
- Likes 1
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by fx.practic, 10-15-2013, 12:53 AM
|
5 responses
5,403 views
0 likes
|
Last Post
by Bidder
Today, 12:22 AM
|
||
Started by Shai Samuel, 07-02-2022, 02:46 PM
|
4 responses
94 views
0 likes
|
Last Post
by Bidder
Today, 12:11 AM
|
||
Started by DJ888, Yesterday, 10:57 PM
|
0 responses
6 views
0 likes
|
Last Post
by DJ888
Yesterday, 10:57 PM
|
||
Started by MacDad, 02-25-2024, 11:48 PM
|
7 responses
158 views
0 likes
|
Last Post Yesterday, 10:23 PM | ||
Started by Belfortbucks, Yesterday, 09:29 PM
|
0 responses
8 views
0 likes
|
Last Post
by Belfortbucks
Yesterday, 09:29 PM
|
Comment