Here's a code for a multi time frame stochastic. This will allow you to plot a stochastic for any time frame that is greater than the one that your chart is currently on. For example, it can be helpful to know what the hourly stochastic looks like if you're trading on a 5 min chart. I'm playing around with using this a filter for mean reverting systems..such as ignore a "Buy Signal" if the stochastic on a higher time frame is over 60. Here's an example of using the 15min stochastic with a 1 minute chart:
Here's the code. To use this code, copy and paste it into TOS and then delete the // marks at the top and bottom. These marks are necessary for posting the code on blogger and the indicator will not work in TOS if you don't delete them.
Hope everyone had a great Thanksgiving!
TLT
//
declare lower;
input aggregationPeriod = AggregationPeriod.DAY;
input KPeriod = 10;
input DPeriod = 10;
input slowing_period = 3;
plot FullK = Average((close(period = aggregationPeriod) - Lowest(low(period = aggregationperiod), KPeriod)) / (Highest(high(period = aggregationperiod), KPeriod) - Lowest(low(period = aggregationperiod), KPeriod)) * 100, slowing_period);
plot FullD = Average(Average((close(period = aggregationPeriod) - Lowest(low(period = aggregationperiod), KPeriod)) / (Highest(high(period = aggregationperiod), KPeriod) - Lowest(low(period = aggregationperiod), KPeriod)) * 100, slowing_period), DPeriod);
//
Here's the code. To use this code, copy and paste it into TOS and then delete the // marks at the top and bottom. These marks are necessary for posting the code on blogger and the indicator will not work in TOS if you don't delete them.
Hope everyone had a great Thanksgiving!
TLT
//
declare lower;
input aggregationPeriod = AggregationPeriod.DAY;
input KPeriod = 10;
input DPeriod = 10;
input slowing_period = 3;
plot FullK = Average((close(period = aggregationPeriod) - Lowest(low(period = aggregationperiod), KPeriod)) / (Highest(high(period = aggregationperiod), KPeriod) - Lowest(low(period = aggregationperiod), KPeriod)) * 100, slowing_period);
plot FullD = Average(Average((close(period = aggregationPeriod) - Lowest(low(period = aggregationperiod), KPeriod)) / (Highest(high(period = aggregationperiod), KPeriod) - Lowest(low(period = aggregationperiod), KPeriod)) * 100, slowing_period), DPeriod);
//
1 comment:
Thanks for the code! When watching a 5m chart with your study on 15m it gives a whole new view...thanks, Doug
Post a Comment