this area is different# Agg Period 1
input agg1 = AggregationPeriod.DAY;
def oFastK1= 100 *( ( close(period = Agg1) - Lowest( low(period = Agg1), StochLength ) ) / ( Highest( high(period = Agg1), StochLength ) - Lowest( low(period = Agg1), StochLength ) ) );
Your new agg code above.
The next line will be;
def oFastD = Average( oFastK, 1 );
Now how does this need to be changed for new agg to work . What value changed from the original code ?
Look close the answer is right in this post
Just gave it to you. def oFastD1 = Average( oFastK1, 1 );
Now you have this;
input agg1 = aggregationPeriod.DAY;
def oFastK1= 100 *( ( close(period = Agg1) - Lowest( low(period = Agg1), StochLength ) ) / ( Highest( high(period = Agg1), StochLength ) - Lowest( low(period = Agg1), StochLength ) ) );
def oFastD1 = Average( oFastK1, 1 );
Next line;
def oSlowK = oFastD; How will you chang it?
so farinput agg1 = aggregationPeriod.DAY;
def oFastK1= 100 *( ( close(period = Agg1) - Lowest( low(period = Agg1), StochLength ) ) / ( Highest( high(period = Agg1), StochLength ) - Lowest( low(period = Agg1), StochLength ) ) );
def oFastD1 = Average( oFastK1, 1 );
def oSlowK1 = oFastD1;
def oSlowD1 = Average( oSlowK, 3 );Next 2 lines to change; Follow what just was changed and you can get it
def oSlowD = Average( oSlowK, 3 );
def NormStoch = 0.1 * ( oSlowK - 50 );
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.