NexusFi: Find Your Edge


Home Menu

 





NT7 max look back


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one AkLio with 2 posts (0 thanks)
    2. looks_two Fat Tails with 1 posts (1 thanks)
    3. looks_3 Big Mike with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 4,038 views
    2. thumb_up 1 thanks given
    3. group 0 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

NT7 max look back

  #1 (permalink)
 
AkLio's Avatar
 AkLio 
Canada
 
Experience: Intermediate
Platform: ninja 7
Broker: IB
Trading: 6E ES
Posts: 38 since Jun 2009
Thanks Given: 28
Thanks Received: 69

Hi

NT7 have this new option: Maximun Bars Look Back
The default value is set by NT to 256

I have found that many of my indicators will work only if I set the value to infinite.

Did you had any trouble with this and do you have a way of changing this to "inifinite" in the indi code ???

Help much appreciated

Lio

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
58 thanks
Battlestations: Show us your trading desks!
55 thanks
NexusFi site changelog and issues/problem reporting
48 thanks
What percentage per day is possible? [Poll]
31 thanks
GFIs1 1 DAX trade per day journal
29 thanks

  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,322 since Jun 2009
Thanks Given: 33,143
Thanks Received: 101,477



AkLio View Post
Hi

NT7 have this new option: Maximun Bars Look Back
The default value is set by NT to 256

I have found that many of my indicators will work only if I set the value to infinite.

Did you had any trouble with this and do you have a way of changing this to "inifinite" in the indi code ???

Help much appreciated

Lio

You can explicitly define the lookback period when you initialize your DataSeries values in #init:

 
Code
                            
// infinite

new DataSeries(thisMaximumBarsLookBack.Infinite);

// 256
new DataSeries(thisMaximumBarsLookBack.TwoHundredFiftySix); 
Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

NT 6.5. is a memory hog, so NT developpers looked for ways to make NT 7 leaner. One way was to reduce the memory required to store data series.

Let us assume you define a new DataSeries with the name Dirty via private DataSeries Dirty. Within the code of your indicator, you only set a value from time to time, say for a zigzag you only set a value when a new high or low is made. Then you try to access the DataSeries also for those values that have not been set correctly.

In this case:

NT 6.5. has written a default value to all fields of the DataSeries, so if you have not set a value, it returns the default value.
NT 7.0 (TwoHundredFiftySix) does not write any default values, but reserves the storage space required for 256 fields. If you access any fields that you have not set, NT7 returns random values from those stored in the array containing the 256 values.
NT 7.0 (Infinite) will only reserve storage space, if values are actually set, so if you do not set the values properly and try to access them, it may return you an out-of-range exception.


Many indicators do not need to access more than 256 fields. However, there is a major problem with this. If you scroll back your chart horizontally more than 256 bars or if you access any bars prior to the last 256 bars, you may get false values returned.

Example: FibCluster Indicator V1.3

This indicator uses 192 DataSeries and 40 DateTimeSeries. Now if you put this on a 1 min chart with a lookback period of 100 days, you will have about 70 days of data with 1425 bars each. The RAM required to store the full DataSeries and DateTimeSeries would be 70 x 1425 x 232 x 8 Bytes = 185 MBytes. With the default setting TwoHundredFiftySix the RAM needed will be reduced to less than half a Mbyte....

But if you want to scroll back a bit, or if you need to access any values that are back more than 256 bars, then you should set the DataSeries to MaximumBarsLookBack.Infinite. You can either change the global setting for the indicator via the indicator menu (affects all DataSeries used by the indicator), or you can do this selectively through the indicator code, as suggested by Mike in his post above.

Reply With Quote
The following user says Thank You to Fat Tails for this post:
  #5 (permalink)
 
AkLio's Avatar
 AkLio 
Canada
 
Experience: Intermediate
Platform: ninja 7
Broker: IB
Trading: 6E ES
Posts: 38 since Jun 2009
Thanks Given: 28
Thanks Received: 69

Much thanks to you Big Mike and Fat Tails

My indi redraw candles from A to Z and the 257th candle comes very fast when you scroll back a tick chart ...... Looking good now...

///</summary>
protectedoverridevoid Initialize()
{
open =
new DataSeries(this,MaximumBarsLookBack.Infinite);
high =
new DataSeries(this,MaximumBarsLookBack.Infinite);
low =
new DataSeries(this,MaximumBarsLookBack.Infinite);
close =
new DataSeries(this,MaximumBarsLookBack.Infinite);
zeLine =
new DataSeries(this,MaximumBarsLookBack.Infinite);

Started this thread Reply With Quote





Last Updated on April 25, 2010


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts