Get plot value through reflection - NinjaTrader Programming | futures io social day trading
futures io futures trading


Get plot value through reflection
Updated: Views / Replies:458 / 6
Created: by thesarath 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
 

Get plot value through reflection

  #1 (permalink)
Trading Apprentice
Cochin
 
Futures Experience: None
Platform: NinjaTrader
Favorite Futures: ES
 
Posts: 8 since Dec 2014
Thanks: 1 given, 0 received

Get plot value through reflection

I am able to get the value of middle band of Bollinger with the below code.

 
Code
double value = Bollinger(2,14).Values[1][0];

How can I do it with Reflection? Below is the code I have tried so far.

 
Code
Type[] dataTypes = null;
MethodInfo methodInfo = null;
object[] params = new object[2];

// Some code to get data types of method to "dataTypes" (System.Double,System.Int32)
// Some code to get parameters for the method to "params" (2,14)
// Some code to get information to "methodInfo" (Bollinger(2,14))

IDataSeries dataSeries = (IDataSeries)methodInfo.Invoke(this, params);
double value = dataSeries[0];

When I execute the above statement , I could get the value(for example,1650.00) in the variable "value". The issue is, I could not specify the band ,ie, Upper or Middle or Lower. I tried the below code.

 
Code
double value = dataSeries.Values[1][0];

but didn't work and throws error. Is there a way out?

Thanks in advance,
thesarath


Last edited by thesarath; March 3rd, 2015 at 08:08 AM.
Reply With Quote
 
  #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)
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


What do you need it for, I mean what is the purpose of the whole exercise?

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Cochin
 
Futures Experience: None
Platform: NinjaTrader
Favorite Futures: ES
 
Posts: 8 since Dec 2014
Thanks: 1 given, 0 received


Fat Tails View Post
What do you need it for, I mean what is the purpose of the whole exercise?

I can select a set of indicators from a list, can select the plot for each indicator and need to get each indicator's plot value at runtime.

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


thesarath View Post
I can select a set of indicators from a list, can select the plot for each indicator and need to get each indicator's plot value at runtime.

I have used an enum for the list of indicators and then attributed the selected indicators to an IDataSeries object in OnStartUp. An example would be the SuperTrendU11, which works with 29 different moving averages. It can be downloaded here:

https://futures.io/download/ninjatrader-7/indicators/1207-download.html?view

Is that the solution you look for, or do you try to instantiate indicators dynamically?


PS: I just saw that you cannot download files, as you are not an elite member. Please send me a private message with your e-mail and I will send you the indicator, so that you can check it.

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
Cochin
 
Futures Experience: None
Platform: NinjaTrader
Favorite Futures: ES
 
Posts: 8 since Dec 2014
Thanks: 1 given, 0 received


Fat Tails View Post
I have used an enum for the list of indicators and then attributed the selected indicators to an IDataSeries object in OnStartUp. An example would be the SuperTrendU11, which works with 29 different moving averages. It can be downloaded here:

https://futures.io/download/ninjatrader-7/indicators/1207-download.html?view

Is that the solution you look for, or do you try to instantiate indicators dynamically?


PS: I just saw that you cannot download files, as you are not an elite member. Please send me a private message with your e-mail and I will send you the indicator, so that you can check it.

Yes. I instantiate the indicators dynamically at runtime in a loop and store them in a List<IDataSeries>.

Reply With Quote
 
  #7 (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


thesarath View Post
Yes. I instantiate the indicators dynamically at runtime in a loop and store them in a List<IDataSeries>.

But do you want to select the indicators from a dropdown list, or would you prefer instantiating them by using a string?

I have sent you the SuperTrendU11, so you can check whether that solution would work for you.

Reply With Quote

Reply



futures io > > > > > Get plot value through reflection

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
indicator will not plot MilfordT NinjaTrader 5 October 6th, 2014 07:46 PM
Can't get trendlines to plot PippiLong EasyLanguage Programming 1 August 19th, 2012 07:19 PM
plot without DataBox baberg NinjaTrader Programming 5 August 15th, 2011 06:36 PM
Plot only if true Locust EasyLanguage Programming 3 October 27th, 2010 03:30 PM
Could you help me with this plot??? andaluz NinjaTrader Programming 2 May 30th, 2010 08:54 PM


All times are GMT -4. The time now is 05:06 PM.

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.12 seconds with 19 queries on phoenix via your IP 54.226.132.197