Am I the only one who noticed this bug on NT 7.0.1? - NinjaTrader Programming | futures io social day trading
futures io futures trading


Am I the only one who noticed this bug on NT 7.0.1?
Updated: Views / Replies:1,435 / 11
Created: by mborin Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Am I the only one who noticed this bug on NT 7.0.1?

  #1 (permalink)
Elite Member
san antonio tx/usa
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: Stocks
 
Posts: 13 since Jun 2012
Thanks: 2 given, 5 received

Am I the only one who noticed this bug on NT 7.0.1?

I think there's a bug in the way NT determines average price when using LIFO method. If I hold multiple positions and the last one becomes profitable I sell it and my average price improves. But the logic does not take in to consideration that the position I just exited for a profit is no longer a part of my multiple positions.

So when I bought this position to scale in to my trade my average price improved but when I closed this position for a small profit my overall average price of my open positions improved even further according to NT. This is incorrect because that closed position is not part of my overall position anymore. So the average price should have been decreased to what it was before I scaled in to my overall position and then the small profit of that position should be factored into the overall average price to figure out what the new average price is now.

Is this confusing yet?

So if I am holding several positions and exit my last entree at a profit then Average Position Price (APP) needs to go back to what it was before that position was added to all my other open positions. After that the profit that was made from that exit needs to be added to the remaining open positions to calculate the APP.

Does anyone notice this?

Reply With Quote
The following user says Thank You to mborin for this post:
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Market Wizard
Boca Raton
 
Futures Experience: Advanced
Platform: Variety
Broker/Data: Optimus Futures, LLC
Favorite Futures: Futures
 
mattz's Avatar
 
Posts: 2,059 since Sep 2010
Thanks: 1,932 given, 2,781 received
Forum Reputation: Legendary



mborin View Post
I think there's a bug in the way NT determines average price when using LIFO method. If I hold multiple positions and the last one becomes profitable I sell it and my average price improves. But the logic does not take in to consideration that the position I just exited for a profit is no longer a part of my multiple positions.

So when I bought this position to scale in to my trade my average price improved but when I closed this position for a small profit my overall average price of my open positions improved even further according to NT. This is incorrect because that closed position is not part of my overall position anymore. So the average price should have been decreased to what it was before I scaled in to my overall position and then the small profit of that position should be factored into the overall average price to figure out what the new average price is now.

Is this confusing yet?

So if I am holding several positions and exit my last entree at a profit then Average Position Price (APP) needs to go back to what it was before that position was added to all my other open positions. After that the profit that was made from that exit needs to be added to the remaining open positions to calculate the APP.

Does anyone notice this?

2 questions:
1) Do you add money to wining or losing positions?
2) When you say "my average trade improves", you mean it is it goes up or down?

PM with any questions about optimusfutures (800) 771-6748 (561) 367 8686. THERE IS A SUBSTANTIAL RISK OF LOSS IN FUTURES TRADING.
Reply With Quote
 
  #4 (permalink)
Elite Member
san antonio tx/usa
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: Stocks
 
Posts: 13 since Jun 2012
Thanks: 2 given, 5 received


mattz View Post
2 questions:
1) Do you add money to wining or losing positions?
2) When you say "my average trade improves", you mean it is it goes up or down?

Please note that I am not outlining a particular strategy. I simply want to bring attention to how Avg. Price is calculated when using LIFO method for position entrees. NT algorithm is incorrect in this situation.

But to answer your question:
1. Positions are added when a buy signal is reached.
2. I meant that the Unrealized PnL is being averaged in incorrectly.


Last edited by mborin; December 1st, 2013 at 12:17 AM.
Reply With Quote
The following user says Thank You to mborin for this post:
 
  #5 (permalink)
Market Wizard
Boca Raton
 
Futures Experience: Advanced
Platform: Variety
Broker/Data: Optimus Futures, LLC
Favorite Futures: Futures
 
mattz's Avatar
 
Posts: 2,059 since Sep 2010
Thanks: 1,932 given, 2,781 received
Forum Reputation: Legendary


mborin View Post
Please note that I am not outlining a particular strategy. I simply want to bring attention to how Avg. Price is calculated when using LIFO method for position entrees. NT algorithm is incorrect in this situation.

But to answer your question:
1. Positions are added when a buy signal is reached.
2. I meant that the Unrealized PnL is being averaged in incorrectly.

I played around with some LIFO with either add $ to losing and wining positions, various exits, etc
So I have an idea how it should be.
If you give us a few examples how it is calculated and how you think it should would be helpful to assess if the calculations are wrong. Without that we can know whether it is right or wrong.

PM with any questions about optimusfutures (800) 771-6748 (561) 367 8686. THERE IS A SUBSTANTIAL RISK OF LOSS IN FUTURES TRADING.
Reply With Quote
 
  #6 (permalink)
Elite Member
san antonio tx/usa
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: Stocks
 
Posts: 13 since Jun 2012
Thanks: 2 given, 5 received


mattz View Post
I played around with some LIFO with either add $ to losing and wining positions, various exits, etc
So I have an idea how it should be.
If you give us a few examples how it is calculated and how you think it should would be helpful to assess if the calculations are wrong. Without that we can know whether it is right or wrong.

Say I'm going Long. If I am holding 10 positions and then I exit my last entree at a profit the Unrealized PnL needs to decrease back to what it was when I had 9 positions. Then the profit that was made from that last exit needs to be added to the remaining open positions to calculate the new Unrealized PnL. Currently NT does not do this.


Last edited by mborin; December 1st, 2013 at 01:20 AM.
Reply With Quote
The following user says Thank You to mborin for this post:
 
  #7 (permalink)
Market Wizard
Boca Raton
 
Futures Experience: Advanced
Platform: Variety
Broker/Data: Optimus Futures, LLC
Favorite Futures: Futures
 
mattz's Avatar
 
Posts: 2,059 since Sep 2010
Thanks: 1,932 given, 2,781 received
Forum Reputation: Legendary


mborin View Post
Say I'm going Long. If I am holding 10 positions and then I exit my last entree at a profit the Unrealized PnL needs to decrease back to what it was when I had 9 positions. Then the profit that was made from that last exit needs to be added to the remaining open positions to calculate the new Unrealized PnL. Currently NT does not do this.

I understand. If you are convinced it is wrong, ok.
But if you show your specific entries and point out the specific averages it shows, we all could be more helpful.
G'nite.

PM with any questions about optimusfutures (800) 771-6748 (561) 367 8686. THERE IS A SUBSTANTIAL RISK OF LOSS IN FUTURES TRADING.
Reply With Quote
 
  #8 (permalink)
 Vendor: www.traderwerks.com 
Taipei Taiwan
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Optimus
Favorite Futures: TW
 
Posts: 693 since Jun 2009
Thanks: 440 given, 440 received


mborin View Post
Then the profit that was made from that last exit needs to be added to the remaining open positions to calculate the new Unrealized PnL. Currently NT does not do this.

The profit that was made would be realized profit and would no longer be included in Unrealized PnL, so according to your description, NT is correct.

Math. A gateway drug to reality.
Reply With Quote
 
  #9 (permalink)
Elite Member
san antonio tx/usa
 
Futures Experience: Advanced
Platform: NinjaTrader
Favorite Futures: Stocks
 
Posts: 13 since Jun 2012
Thanks: 2 given, 5 received


traderwerks View Post
The profit that was made would be realized profit and would no longer be included in Unrealized PnL, so according to your description, NT is correct.

This bug can easily be duplicated by using chart trader on replay mode. Just pick a time frame that you are familiar with and make a few entrees then exit the last one with a limit order. You will see that the Avg. Position price stays the same.

Reply With Quote
The following user says Thank You to mborin for this post:
 
  #10 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,599 received
Forum Reputation: Legendary

No bug - LIFO is simply not supported by NinjaTrader 7


If you enter several positions and close some of them, there are basically three ways to account for PNL

- FIFO
- average price
- LIFO

NinjaTrader simply does not offer LIFO. You can only select between average price (default) and FIFO (can be activated under Options -> General).

There have been multiple requests by NinjaTrader users for this feature, also see the following links:

'Use FIFO for position avg. price calculations' setting is not working - NinjaTrader Support Forum
LIFO for Matching Entries & Exits - NinjaTrader Support Forum
Last in First out contract PnL - NinjaTrader Support Forum

In some case - this depends on the broker API - NinjaTrader will show PNL as calculated by your broker.

Reply With Quote
The following 4 users say Thank You to Fat Tails for this post:

Reply



futures io > > > > > Am I the only one who noticed this bug on NT 7.0.1?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Have You Noticed? China Stocks Are Rallying Quick Summary News and Current Events 0 January 21st, 2013 09:10 PM
CME Filed A Lawsuit Against MF Global And No One Noticed At All kbit News and Current Events 1 December 15th, 2011 09:09 PM
Another Bug in Ninja 7 Michael.H NinjaTrader 16 June 30th, 2010 01:02 PM
NT Bug Alert Saroj NinjaTrader Programming 1 July 20th, 2009 08:11 AM


All times are GMT -4. The time now is 11:41 AM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-11 in 0.15 seconds with 19 queries on phoenix via your IP 54.82.81.154