Some Basic NinjaTrader Coding Questions -- IDataSeries - NinjaTrader Programming | futures io social day trading
futures io futures trading


Some Basic NinjaTrader Coding Questions -- IDataSeries
Updated: Views / Replies:3,080 / 7
Created: by Crow 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
 

Some Basic NinjaTrader Coding Questions -- IDataSeries

  #1 (permalink)
Elite Member
Las Vegas, Nevada
 
Futures Experience: None
Platform: MultiCharts
 
Posts: 44 since Apr 2010
Thanks: 12 given, 12 received

Some Basic NinjaTrader Coding Questions -- IDataSeries

I am trying to convert the reverse-engineered JMA indicator found in the MAMulticolored zip under the download section to run on my Java-based platform. Most of the conversion is straight-forward, but I don't know how to handle the following buffers:

JMAValueBuffer = new DataSeries(this);
fC0Buffer = new DataSeries(this);
fA8Buffer = new DataSeries(this);
fC8Buffer = new DataSeries(this);

I either need to implement a DataSeries class which behaves the same as Ninja's DataSeries class, at least to the extent required by the indicator, or i need to remove the data series and use something else. The problem is that I can't find any API for DataSeries. Closest I found is here:

NinjaTrader Version 7

So maybe someone here can help me out with a few questions:

1.
series = Input[0];

What is Input[0]? Is that the most recent input in the buffer corresponding to the right-most datapoint on the chart or is that the left-most datapoint?

2.
fC0Buffer.Set(series);

Series is a double. What is set in the buffer? Does the line above simply append the series value to the end of the data series array or does it push the value onto the front (pushing all previous elements in the array back by 1 index)?

3.
If OnBarUpdate() is called on each bar update event (incoming tick), what does Input DataSeries contain? It seems that if Input contained all data received so far, the entire indicator would be recomputed for every input value on each update, which would be very inefficient.

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
Calcutta, India
 
Futures Experience: Intermediate
Platform: ArthaChitra
 
Posts: 278 since Jun 2009
Thanks: 161 given, 259 received


Input = input series is the one you select from the parameter dialog box. it can be close open high low median etc. input[0] is the most recent value (a double) of the series.

a value is set to the dataseries. this is the recent most value. there is a overload too where you can define the "recent most". like buffer.Set(1,series) here 1 represent the previous bar.

Input is a series. when you compute, the whole series dont get recalculated. normally only the most recent data point gets calculated (unless you want to recalculate the past data points too).

Reply With Quote
The following 2 users say Thank You to bukkan for this post:
 
  #4 (permalink)
Elite Member
Las Vegas, Nevada
 
Futures Experience: None
Platform: MultiCharts
 
Posts: 44 since Apr 2010
Thanks: 12 given, 12 received


bukkan View Post
Input = input series is the one you select from the parameter dialog box. it can be close open high low median etc. input[0] is the most recent value (a double) of the series.

a value is set to the dataseries. this is the recent most value. there is a overload too where you can define the "recent most". like buffer.Set(1,series) here 1 represent the previous bar.

Input is a series. when you compute, the whole series dont get recalculated. normally only the most recent data point gets calculated (unless you want to recalculate the past data points too).

But when a value is set to the dataseries -- does it replace the value at index 0 or simply push back all entries by 1 and then set the 0 index to the new value?

So when backfilling, onBarUpdate is called for each bar in the series? Whenever new input data is pushed onto the DataSeries, it's called?

Is the IDataSeries interface posted somewhere? The purpose of an interface is to tell users what calls are available for calling. Not sure why IDataSeries interface is so hard to find.

Reply With Quote
 
  #5 (permalink)
Elite Member
Calcutta, India
 
Futures Experience: Intermediate
Platform: ArthaChitra
 
Posts: 278 since Jun 2009
Thanks: 161 given, 259 received


Crow View Post
But when a value is set to the dataseries -- does it replace the value at index 0 or simply push back all entries by 1 and then set the 0 index to the new value?

it replaces. it pushes back all entries by 1 only when a new bar/candle is formed.


Crow View Post
So when backfilling, onBarUpdate is called for each bar in the series? Whenever new input data is pushed onto the DataSeries, it's called?

it reads all the historical bars. but when live it dosent reads the historical bars unless asked to do.


Crow View Post
Is the IDataSeries interface posted somewhere? The purpose of an interface is to tell users what calls are available for calling. Not sure why IDataSeries interface is so hard to find.

didnt get you, but you can use reflector.

Reply With Quote
 
  #6 (permalink)
Elite Member
Las Vegas, Nevada
 
Futures Experience: None
Platform: MultiCharts
 
Posts: 44 since Apr 2010
Thanks: 12 given, 12 received

Thanks bukkan, appreciate.

Reply With Quote
 
  #7 (permalink)
Elite Member
Houston, Texas
 
Futures Experience: Advanced
Platform: NinjaTrader
 
Posts: 25 since Oct 2010
Thanks: 2 given, 19 received

DataSeries is a slight misnomer. A better name would have been DoubleSeries in keeping with the other XXSeries names such as BoolSeries, IntSeries, FloatSeries and StringSeries. I found this confusing at first.

These XXSeries classes are basically container classes that maintain an index synchronization that is aligned with the indexing scheme that is used to access data. Think of the "this" parameter that is passed into the DataSeries constructor as saying "Keep this double countainer's index syncronized with "this" indicators data index."

Ninatrader and Tradestation and I assume many other chart scripting languages use an indexing scheme where the rightmost bar (the last one created) is always index 0. And the second to the rightmost (one bar to the left) is index 1, etc. Close[0] gives the closing price of the rightmost bar, Close[1] is the closing price for the bar to it's left.

If you are familiar with "normal" container classes, when you add an item to say a List<>, the size of the list increases by one, and the last added item is accessed by "[Count-1]". Behind the scene I'm sure DataSeries is doing this, but to make it easier (a scripting language) some type of re-indexing or an offset calculation is probably being done in an override of the indexer ( [ ] ).

Since the DataSeries container is synchronized with this indexing scheme, DataSeries data is accessed exactly the same way - index 0 is the DataSeries value assiciated with the data at index 0. Since only one value can be stored at that index location, If you keep calling Set, it will just keep overwriting the data at that index.


Last edited by samWest; December 8th, 2010 at 06:39 PM.
Reply With Quote
The following 4 users say Thank You to samWest for this post:
 
  #8 (permalink)
Trading Apprentice
Tampa Florida
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: Forex
 
Posts: 1 since Jun 2017
Thanks: 0 given, 0 received

Need a little help Checking past DataSeries value

NinjaTrader 7 Help

I am attempting to utilize 2 DataSeries to compare my current candles Low to the low of a specific time
of day. If the current candles low does indeed show that it is lower, then i check to see if the candle
close is less than the lower Bollinger band. I am confused with how to look back at a particular time within the second array to get the low of the particular set time i have stored. Can anyone help?

In one array i am setting the low of say Time 3:01 and the array length is one since it only needs to keep one Value. The other DataSeries would keep multiple values and check against the shorter
array. As time advances i will check back to 301 again and again until it is time to reset 301 for the next day.

private DataSeries[]EntryLow; // Short Array
private DataSeries myDataSeries; // Long Array

#region Variables
// Wizard generated variables
private int myInput0 = 1; // Default setting for MyInput0
// User defined variables (add any user defined variables below)
#endregion

/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>

protected override void Initialize()
{
EntryLow = new DataSeries[1];// Array Size
//EntryLow = new DataSeries(this);

myDataSeries = new DataSeries(this, MaximumBarsLookBack.Infinite);

CalculateOnBarClose = true;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>

protected override void OnBarUpdate()
{

myDataSeries.Set(Low[0]);


if(ToTime(Time[0]) == ToTime(3,01,0))
{
EntryLow.Set(Low[0]);
}

if(ToTime(Time[0]) > ToTime(3,01,0)
&& myDataSeries[0] < EntryLow //Not sure how to call EntryLow stored value
&& Low[0] < Bollinger(2, 14).Lower[0])
{
DrawHorizontalLine("My horizontal line" + CurrentBar, 5, Color.Chartreuse);
}
}

Reply With Quote

Reply



futures io > > > > > Some Basic NinjaTrader Coding Questions -- IDataSeries

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tricky NinjaScript coding {questions} . . . jmejedi NinjaTrader Programming 10 August 2nd, 2014 10:09 PM
Questions for user of MBTrading/Ninjatrader jmjstrider Reviews of Brokers and Data Feeds 2 September 25th, 2012 07:41 AM
Webinar: Basic NinjaScript coding, May 25th @ 4:30PM Eastern, 22:30 Berlin/Paris sam028 The Elite Circle 33 August 11th, 2011 11:37 AM
basic color coding according to direction of a moving average stephenszpak NinjaTrader Programming 7 May 29th, 2011 10:49 PM
Basic datafeed questions forexboom Reviews of Brokers and Data Feeds 3 May 24th, 2011 03:56 PM


All times are GMT -4. The time now is 06:55 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-13 in 0.07 seconds with 18 queries on phoenix via your IP 54.90.92.204