Indicator property: Is it possible to set # bars a study will reference  [SOLVED]

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1283
Joined: 23 Nov 2010
Has thanked: 724 times
Been thanked: 222 times

Indicator property: Is it possible to set # bars a study will reference

Postby arjfca » 14 May 2017

Hello

Indicator property: Could we set from the code the value for :Max number of bars study will reference

Martin

User avatar
TJ
Posts: 7210
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2052 times

Re: Indicator property: Is it possible to set # bars a study will reference

Postby TJ » 14 May 2017

Hello

Indicator property: Could we set from the code the value for :Max number of bars study will reference

Martin

This might sound insensitive, but why would you want to do that?

arjfca
Posts: 1283
Joined: 23 Nov 2010
Has thanked: 724 times
Been thanked: 222 times

Re: Indicator property: Is it possible to set # bars a study will reference

Postby arjfca » 14 May 2017

Hello TJ
The problem is that one my indicator is creating too many little trendlines when I use it with a very time scales. It then cause my new indicator that draw trendlines to bust an area created to keep trendlines information.

The problematic indicator is only use to draw trendlines for the upper and lower price of the Asian sessions. I don't need to go many days back for it to be relevant.


I could always rewrite the indicator, but,,,,,,

Martin
Attachments
Asian sessions.png
Asian sessions.png (44.61 KiB) Viewed 639 times
Max Bars References.png
Max Bars References.png (26.31 KiB) Viewed 639 times

User avatar
TJ
Posts: 7210
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2052 times

Re: Indicator property: Is it possible to set # bars a study will reference  [SOLVED]

Postby TJ » 14 May 2017

You have a misunderstanding of MaxBarsBack.

I thought we have gone through this before.

MBB is a nisnomer.

MBB is a chart level setting -- it determines how many bars the indicator needs to do a proper calculation.

MBB is NOT about how far the indicator goes back from the current bar.

eg.
For a 10 period moving average, the MBB is 10.
Because it takes 10 bars to do a proper 10 MA calculation.

arjfca
Posts: 1283
Joined: 23 Nov 2010
Has thanked: 724 times
Been thanked: 222 times

Re: Indicator property: Is it possible to set # bars a study will reference

Postby arjfca » 14 May 2017

true true true

I'm re-coding the indicator to resolve a potential problem

Martin

User avatar
JoshM
Posts: 2099
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1526 times
Been thanked: 1502 times
Contact:

Re: Indicator property: Is it possible to set # bars a study will reference

Postby JoshM » 15 May 2017

Indicator property: Could we set from the code the value for :Max number of bars study will reference
Though you've seem to have fixed it in a different way looking at your last post :), you can set the number of bars an indicator will reference with the SetMaxBarsBack() keyword.

arjfca
Posts: 1283
Joined: 23 Nov 2010
Has thanked: 724 times
Been thanked: 222 times

Re: Indicator property: Is it possible to set # bars a study will reference

Postby arjfca » 15 May 2017

Thanks for the reminder

I did redraw the indicator so the problem is resolved

Martin


Return to “MultiCharts”