NexusFi: Find Your Edge


Home Menu

 





want to get chart info in initialize()


Discussion in NinjaTrader

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




 
Search this Thread

want to get chart info in initialize()

  #1 (permalink)
 tulanch 
Salt Lake City, UT
 
Experience: Intermediate
Platform: SC, NT, MT
Broker: AMP
Trading: NQ ES YM Bonds
Posts: 265 since Mar 2010
Thanks Given: 50
Thanks Received: 387

Hello all

I want to obtain the type of chart and the period of the chart in the initialize() method.

for example PeriodType.Minute and a period of 1

I can get the Instrument name, but uncertain of to get the others. Any ideas?

I do not think there are any documented ways to do this.

My ultimate goal is to make use of the Add() method using the current chart's details and you can only use the Add() method in the initialize() method.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
MC PL editor upgrade
MultiCharts
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (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


I think there is a clear answer. The properties of the bars cannot be accessed in the Initialize() section.


BarsPeriod, BarsPeriods


Excerpt from the NinjaTrader User Manual.

NOTE: This property should NOT be accessed within the Initialize() method.


If you want to adapt the period of an added instrument to the period type and period of the chart, this can only be achieved by a user defined input.


What do you need this for?

Reply With Quote
  #4 (permalink)
 tulanch 
Salt Lake City, UT
 
Experience: Intermediate
Platform: SC, NT, MT
Broker: AMP
Trading: NQ ES YM Bonds
Posts: 265 since Mar 2010
Thanks Given: 50
Thanks Received: 387

wanted to Add() .Ask, .Bid, and .Last of current chart settings...

fyi, the "should not" is really "can not"... as doing so won't run, arfgs message in output window indicating so...

Started this thread Reply With Quote
  #5 (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


tulanch View Post
wanted to Add() .Ask, .Bid, and .Last of current chart settings...

fyi, the "should not" is really "can not"... as doing so won't run, arfgs message in output window indicating so...

You can only access one DataSeries of a chart. This can either be the last traded price, the bid or the ask.

The accessed DataSeries is automatically added to your indicator, as it is selected via the indicator dialogue box, so you do not need to add it.

I still do not get exactly, what you try to achieve.

Reply With Quote
  #6 (permalink)
 tulanch 
Salt Lake City, UT
 
Experience: Intermediate
Platform: SC, NT, MT
Broker: AMP
Trading: NQ ES YM Bonds
Posts: 265 since Mar 2010
Thanks Given: 50
Thanks Received: 387

I have been experimenting with adding in the Bid and Ask data series to Delta type indicators.

Doing so provides history data when you refreash - meaning Delta type indicators still have Bid Ask data to calculate with and this is all done without needing an external file to hold the Bid Ask data as is the case with GEOM and others.

I was thinking to keep the Bid Ask data series it in the same Chart Type (Minute, Range, Volume, etc) and same Period to keep coding easier... but since it's proving difficult to get the current charts values gona forgo that.

I then tried settings of Tick and 1, but it I have noticed that refreshes are not providing the same Bid Ask data as OnMarketData does. Something about "non-last-qualifying trade"....

so I keep plugging along...

Started this thread Reply With Quote
  #7 (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,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603


tulanch View Post
I have been experimenting with adding in the Bid and Ask data series to Delta type indicators.

The bid and ask dataseries are not synchronized with the Last, so basically worthless.

To get true persistence of bid/ask data with NT, you'll need the GomRecorder framework.



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
Thanked by:
  #8 (permalink)
 tulanch 
Salt Lake City, UT
 
Experience: Intermediate
Platform: SC, NT, MT
Broker: AMP
Trading: NQ ES YM Bonds
Posts: 265 since Mar 2010
Thanks Given: 50
Thanks Received: 387

True that, I'm not even concerned about being synchronized, just magnitude, and as you pointed out these are not too useful. One would think that you could align the magnitude of the values returned say from Bid with the manually recorded value from onmarketdata in realtime/playback for a given period of time/volume/tick. But they simply do not. I was told it was due to non-last-qualifying trades. Google that one, it will make you question datafeeds in general. But back to this point, it does not make sense that my datafeed coming in is "correct" and the data that is captured historically (I assume that's what the dataseries does) is different. Yea there may be some architectural reason, but fundamentally that historical data (if that what it was designed to be) is wrong. Sure would be convenient if these worked as I portray they should - but most likely they are working as designed for reasons I don't fully understand.

Started this thread Reply With Quote
  #9 (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,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

Look here for an in-depth data feed comparison of bid/ask data:



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




Last Updated on December 24, 2011


© 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