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)
Showing "tried to reference back more bars" in backtest
I have developed a custom ATR as below. I have no problem using it on my charts.
However I when try to reference it in the below strategy and backtest it, it always throw "tried to reference more bars than allowed by the current max bars back setting".
I have set the MaxBarBack of the strategy to 5 and using Period as 5, but still no luck.
the problem is from the line: atr = (PowerLanguage.Indicator.Jeffrey_ATR)AddIndicator("Jeffrey_ATR"); if I comment this out the strategy is able to work.
Anyone have a clue about what's going on?
Can you help answer these questions from other members on NexusFi?
It is telling you you need more than 5 for the max bars back value. So, try 10, and see if it works. Or, keep increasing it until it doesn't throw the error.
Jura
Posts: 775 since Apr 2010
Thanks Given: 2,352
Thanks Received: 690
A better approach might be to not specify the number of MaxBarsBack explicitly (either manually or programmatically). That way MultiCharts will use auto-detect for the number of MaxBarsBack, ensuring this value is always big enough for the script's calculations.