Add(Instrument.FullName,PeriodType.... ReversalBarsType - NinjaTrader Programming | futures io social day trading
futures io futures trading


Add(Instrument.FullName,PeriodType.... ReversalBarsType
Updated: Views / Replies:1,841 / 19
Created: by pcomm69 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
 

Add(Instrument.FullName,PeriodType.... ReversalBarsType

  #11 (permalink)
Elite Member
paris france
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Continuum
Favorite Futures: gold & crude light
 
pcomm69's Avatar
 
Posts: 50 since Oct 2011
Thanks: 13 given, 4 received

oups sorry for the mistake
THE LOG SAY : ERROR ON CALLING OnBarUpDate on bar 0. Bar Index Needs to be grather or egal to 0

Reply With Quote
 
  #12 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received


pcomm69 View Post
oups sorry for the mistake
THE LOG SAY : ERROR ON CALLING OnBarUpDate on bar 0. Bar Index Needs to be grather or egal to 0

OK, please try the minimum version with just adding the bar and Print method (no DrawText...) just as in my post - trying to identify where the error is.

Reply With Quote
The following user says Thank You to gregid for this post:
 
  #13 (permalink)
Elite Member
paris france
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Continuum
Favorite Futures: gold & crude light
 
pcomm69's Avatar
 
Posts: 50 since Oct 2011
Thanks: 13 given, 4 received


I am reback excuse me
nothing in log
but "inside secondary bars" in the output windows
first step is good

protected override void Initialize()
{

Add(PeriodType.Custom4, 10);// [1]
CalculateOnBarClose = false;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (BarsInProgress == 1)
{
Print("inside secondary bars");
}
}

Reply With Quote
 
  #14 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received


pcomm69 View Post
I am reback excuse me
nothing in log
but "inside secondary bars" in the output windows
first step is good

Now we know that the secondary bars have been successfully added and the error was in your DrawText.

If you are inside BarsInProgress == 1 you can use Open[X] and this will use the right Bars, so your DrawText can be:
 
Code
DrawTextFixed("tag1", Open[1].ToString(), TextPosition.TopRight);

Reply With Quote
The following user says Thank You to gregid for this post:
 
  #15 (permalink)
Elite Member
paris france
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Continuum
Favorite Futures: gold & crude light
 
pcomm69's Avatar
 
Posts: 50 since Oct 2011
Thanks: 13 given, 4 received

if i try this
protected override void Initialize()
{
Add(PeriodType.Custom4, 20);// [1]
CalculateOnBarClose = false;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if ((BarsInProgress == 1) && (CurrentBar > 1))
{
Print((Opens[1][3]));
}
}

the answer in output windows is :
Error on calling 'OnBarUpdate' method for indicator 'BackGroundRBT' on bar 2: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.


for me the probleme is on the history of bar for Series 1 in Custom 4

Reply With Quote
 
  #16 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received


pcomm69 View Post
the answer in output windows is :
Error on calling 'OnBarUpdate' method for indicator 'BackGroundRBT' on bar 2: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.


for me the probleme is on the history of bar for Series 1 in Custom 4

The problem is you don't have enough bars available - you are requesting data from 4 bars ago (3) while on bar 0, 1, 2. This won't work so you need to make sure that:
 
Code
if (CurrentBars[1] < X) return;
where x is the minimum bars you will require for calculation in the above case X will be 4.

Reply With Quote
The following user says Thank You to gregid for this post:
 
  #17 (permalink)
Elite Member
paris france
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Continuum
Favorite Futures: gold & crude light
 
pcomm69's Avatar
 
Posts: 50 since Oct 2011
Thanks: 13 given, 4 received

I am so so sorry

I dont know if CurrentBars[1] >30
witch work

I have used
if ((BarsInProgress == 1) && (CurrentBar > 30)) {do something}
withch dont work

what is the difference ?

Thanks

Reply With Quote
 
  #18 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received


pcomm69 View Post
I am so so sorry

I dont know if CurrentBars[1] >30
witch work

I have used
if ((BarsInProgress == 1) && (CurrentBar > 30)) {do something}
withch dont work

what is the difference ?

Thanks

Hard to say, theoretically both should work, but just in case when using multiple bars series always use CurrentBars[x]

Reply With Quote
The following user says Thank You to gregid for this post:
 
  #19 (permalink)
Elite Member
paris france
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Continuum
Favorite Futures: gold & crude light
 
pcomm69's Avatar
 
Posts: 50 since Oct 2011
Thanks: 13 given, 4 received

I note it
Thank you so much for your help

Reply With Quote
 
  #20 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received



pcomm69 View Post
I note it
Thank you so much for your help

You're welcome

Reply With Quote

Reply



futures io > > > > > Add(Instrument.FullName,PeriodType.... ReversalBarsType

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
Why you should add to winners and never add to losers SMCJB Traders Hideout 34 October 26th, 2017 10:15 AM
NinjaTrader 7 List of used BarsType base(PeriodType.?) zacharydw00 NinjaTrader Programming 13 December 16th, 2015 01:59 PM
Which Instrument? xylem Emini Index Futures Trading 7 November 20th, 2014 11:48 AM
Cant add contacts or friends when trying to add them PLEASE HELP budfox Feedback and Announcements 0 October 21st, 2014 03:41 PM
Instrument multiplier/divider by other instrument, name of that? raffu NinjaTrader Programming 4 August 24th, 2011 03:37 AM


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