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

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1289
Joined: 23 Nov 2010
Has thanked: 725 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: 7321
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 992 times
Been thanked: 2086 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: 1289
Joined: 23 Nov 2010
Has thanked: 725 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
(44.61 KiB) Downloaded 658 times
Max Bars References.png
(26.31 KiB) Downloaded 658 times

User avatar
TJ
Posts: 7321
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 992 times
Been thanked: 2086 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: 1289
Joined: 23 Nov 2010
Has thanked: 725 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: 2134
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1532 times
Been thanked: 1523 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: 1289
Joined: 23 Nov 2010
Has thanked: 725 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”