Dazed & Confused about bar numbrering. - NinjaTrader Programming | futures io social day trading
futures io futures trading


Dazed & Confused about bar numbrering.
Updated: Views / Replies:183 / 7
Created: by Brendan 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
 

Dazed & Confused about bar numbrering.

  #1 (permalink)
Trading Apprentice
Chicago, Illinois/USA
 
Futures Experience: Intermediate
Platform: T4, MetaTrader
Favorite Futures: Currency Futures
 
Posts: 5 since Mar 2013
Thanks: 0 given, 1 received

Dazed & Confused about bar numbrering.

Hi,

I am trying to understand the way ninjatrader uses their bar numbering systems. Methods i.e. High[0] start from the right and move to the left increasing the array count as the bars move to left. However, the current 0 bar is all the way to the left and the current bar numbers increase as the bars move to the right. Please correct me if I have misstated anything so far.

How does that work?

I trade from right to left but the strategies seem to want you to trade from left to right. Let me see if I can explain that better. Trading decisions are made on the hard right side of the chart where new bars are forming or a new bar has just closed. Depending on what your strategy consists of, you may want to "look-back" at some previous time, price, or event to help make a decision on what is happening or has happened as the new bar has formed. I would program from the event that has occurred and look back to a previous price, time, or event and use the array numbering system to identify the event and have plenty of bars on the chart to find that event.

However, (and I may be misunderstanding how the strategies work) it appears to me that the strategies start out at the 0 current bar and there is no way to look past that 0 bar and that is why they require the test for current bars, i.e. there are enough previous current bars closed that your look-back logic doesn't cause an error and stop the script.

1. Is this correct and if not, how do these two numbering systems work and work together?

2. Is there a way to know the total number of bars on the chart so that you don't need to use an arbitrary number of bars in order to condition your look-back logic to not have an index out of range error and to not waste having an exaggerated number of bars just to insure you are safe from the index out of range error.

Looking forward to your help in understanding these concepts.

Thanks,

Brendan

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
charlotte nc
 
Futures Experience: Master
Platform: ninjatrader
Broker/Data: NinjaTrader
Favorite Futures: Emini (ES, YM, NQ, ect.)
 
Posts: 258 since Jan 2015
Thanks: 49 given, 522 received


Forget about the charting / visual component because this will confuse you.

For programming the way the indexing works is like this.

0 = Current Bar
1 = 1 Bar Ago
2 = 2 Bars Ago
etc.

If you try to access High[15] (15 bars ago) for example, and you run this script without first checking if there are at least 15 bars, then you will hit a very vague / unhelpful error message. So you can put some logic in your code to check the count of bars and make sure it is > x before you call x.

Make sense?

Ian

In the analytical world there is no such thing as art, there is only the science you know and the science you don't know. Characterizing the science you don't know as "art" is a fools game.
Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Chicago, Illinois/USA
 
Futures Experience: Intermediate
Platform: T4, MetaTrader
Favorite Futures: Currency Futures
 
Posts: 5 since Mar 2013
Thanks: 0 given, 1 received

Hi Ian,

Thanks for your reply. Sounds good.

Let me ask you this. Is there a way to know how many bars are on the chart and not trade until the chart is fully populated by the bars?

Thanks

Brendan

Reply With Quote
 
  #5 (permalink)
Elite Member
charlotte nc
 
Futures Experience: Master
Platform: ninjatrader
Broker/Data: NinjaTrader
Favorite Futures: Emini (ES, YM, NQ, ect.)
 
Posts: 258 since Jan 2015
Thanks: 49 given, 522 received

Brendan,

Yes.

if( Bars.Count > 25)
{
// Do Something
}

Ian




Brendan View Post
Hi Ian,

Thanks for your reply. Sounds good.

Let me ask you this. Is there a way to know how many bars are on the chart and not trade until the chart is fully populated by the bars?

Thanks

Brendan


In the analytical world there is no such thing as art, there is only the science you know and the science you don't know. Characterizing the science you don't know as "art" is a fools game.
Reply With Quote
 
  #6 (permalink)
Trading Apprentice
Chicago, Illinois/USA
 
Futures Experience: Intermediate
Platform: T4, MetaTrader
Favorite Futures: Currency Futures
 
Posts: 5 since Mar 2013
Thanks: 0 given, 1 received

Ian,

Very much appreciated that you have taken the time to both answer my questions as well as reply. This helps.

Thanks again.

Brendan

Reply With Quote
 
  #7 (permalink)
Elite Member
Roma Italy
 
Futures Experience: Intermediate
Platform: ninjatrader
Broker/Data: Webank
Favorite Futures: Emini, currency, Crude CL
 
Posts: 4 since Jan 2018
Thanks: 4 given, 1 received


Brendan View Post
Hi Ian,

Thanks for your reply. Sounds good.

Let me ask you this. Is there a way to know how many bars are on the chart and not trade until the chart is fully populated by the bars?

Thanks

Brendan

Hi Brendan, there is the reserved word CurrentBar that returns you the number of the current bar from left to right.
Bye

Inviato dal mio SM-A310F utilizzando Tapatalk

Reply With Quote
 
  #8 (permalink)
Trading Apprentice
Chicago, Illinois/USA
 
Futures Experience: Intermediate
Platform: T4, MetaTrader
Favorite Futures: Currency Futures
 
Posts: 5 since Mar 2013
Thanks: 0 given, 1 received

Hi Afoschini,

Thanks for letting me know sir. Exactly the word I was looking for.

Enjoy your morning.

Brendan

Reply With Quote

Reply



futures io > > > > > Dazed & Confused about bar numbrering.

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Updating schedule soon for June

June
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
confused ab. collocation service and data feeds && trade execution relationships ... supersunny Elite Automated Trading 21 August 25th, 2016 02:13 AM
bid&Ask on Chart for current bar only aczk EasyLanguage Programming 3 February 24th, 2014 07:49 AM
How to step forward bar by bar (F12) with full bar not half bar? mercyman MetaTrader 1 October 23rd, 2012 04:49 PM
Confused on the definition of drawdown? Rad4633 Emini Index Futures Trading 4 May 21st, 2012 07:15 AM
Whats the difference between Bar Magnifier & look inside bar testing? crbucks MultiCharts 1 May 4th, 2011 12:22 AM


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

Copyright © 2018 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 2018-06-22 in 0.07 seconds with 18 queries on phoenix via your IP 54.81.197.24