KingsOp
New member
In TOS you can reference data from another ticker by something as simple as:
plot xyz = close("SPY");
This will plot the data from the close of the last bar from SPY regardless of whatever chart you are on. But what if you're on a 1 hour chart and want to reference yesterdays close on SPY?
I haven't been able to find a way to do that yet. If on an hour chart it references the hour chart on SPY. I was hoping someone knew of a way to put an aggregation period on the above code that would allow me to look at a different timeframe from the referenced data on the current timeframe chart I have up.
I've tried adding aggregation period definitions but haven't been able to make them work. For example:
def timeProfile = aggregationPeriod.DAY
plot xyz = close("SPY")(period = time);
doesn't work
def timeProfile = aggregationPeriod.DAY
plot xyz = close(period = time)("SPY");
doesn't work
def time = AggregationPeriod.DAY;
plot xyz = close(period = time, "SPY");
looks like valid code and will work but then states at the bottom: Parameter already defined: period
any thoughts?
plot xyz = close("SPY");
This will plot the data from the close of the last bar from SPY regardless of whatever chart you are on. But what if you're on a 1 hour chart and want to reference yesterdays close on SPY?
I haven't been able to find a way to do that yet. If on an hour chart it references the hour chart on SPY. I was hoping someone knew of a way to put an aggregation period on the above code that would allow me to look at a different timeframe from the referenced data on the current timeframe chart I have up.
I've tried adding aggregation period definitions but haven't been able to make them work. For example:
def timeProfile = aggregationPeriod.DAY
plot xyz = close("SPY")(period = time);
doesn't work
def timeProfile = aggregationPeriod.DAY
plot xyz = close(period = time)("SPY");
doesn't work
def time = AggregationPeriod.DAY;
plot xyz = close(period = time, "SPY");
looks like valid code and will work but then states at the bottom: Parameter already defined: period
any thoughts?