indicators on multiple data with different bar types  [SOLVED]

Questions about MultiCharts and user contributed studies.
tozwp
Posts: 145
Joined: 15 Apr 2011
Has thanked: 16 times
Been thanked: 8 times

indicators on multiple data with different bar types

Postby tozwp » 01 Feb 2014

Having some trouble understanding a chart. In data 1, I have IWM, 20 point chart. Data 2 is IWM, 1 day, regular bar chart. When I plot a moving average of data2 (XAverage(c data2,20)), I get a line that has data points throughout the day instead of only at the close. Data2 is daily data so I would expect a point at each close with no data intraday. How would I get my indicator to only plot data calculated at the close of each daily bar and what is the intraday data that it is plotting?

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: indicators on multiple data with different bar types  [SOLVED]

Postby TJ » 01 Feb 2014

Having some trouble understanding a chart. In data 1, I have IWM, 20 point chart. Data 2 is IWM, 1 day, regular bar chart. When I plot a moving average of data2 (XAverage(c data2,20)), I get a line that has data points throughout the day instead of only at the close. Data2 is daily data so I would expect a point at each close with no data intraday. How would I get my indicator to only plot data calculated at the close of each daily bar and what is the intraday data that it is plotting?
See post #5
viewtopic.php?f=16&t=6929

tozwp
Posts: 145
Joined: 15 Apr 2011
Has thanked: 16 times
Been thanked: 8 times

Re: indicators on multiple data with different bar types

Postby tozwp » 02 Feb 2014

Thanks TJ, that did it. Still a little confused about the variable. I've never seen one declared like that, M2(0, data2). That looks like an array without square brackets? I found that if I use a custom one line and plot this: Average(c,20)data2, this works as well. Must be a syntax thing that I didn't understand. Not sure why specifying which data stream to use inside the parantheses doesn't work but I'll file that one away.

tozwp
Posts: 145
Joined: 15 Apr 2011
Has thanked: 16 times
Been thanked: 8 times

Re: indicators on multiple data with different bar types

Postby tozwp » 02 Feb 2014

Thanks again TJ. Found the answer to my last question. I had never seen the complete syntax for the reserved word Variable. Now I get it.

Syntax-Complete
Variable: <IntraBarPersist> <DataType> VarName(InitialValue<,datan>) <, <IntraBarPersist> <DataType> VarName(InitialValue<,datan>)> ;

•Variable is the variable declaration statement that may alternately be typed as Var, Vars or Variables.

•IntraBarPersist indicates that a variables value can be updated on every tick. By default, variable values are only updated at the close of each bar.

•DataType is the optionally supplied data type (float, double, int, bool, string, or class) of the variable, typically used to conserve memory.

•VarName is the user specified variable name that can be up to 20 characters long and must begin with an alphabetic character (names are not case sensitive)

•InitialValue is the initial value of the variable.

•DataN is an optional parameter that identifies the data stream the variable is tied to and may be data1 through data50.


Return to “MultiCharts”