indicators on multiple data with different bar types [SOLVED]
indicators on multiple data with different bar types
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?
- TJ
- Posts: 7743
- 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]
See post #5Having 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?
viewtopic.php?f=16&t=6929
Re: indicators on multiple data with different bar types
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.
Re: indicators on multiple data with different bar types
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.
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.