Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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.
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
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:
where x is the minimum bars you will require for calculation in the above case X will be 4.