Premier Stochastic Oscillator

Do i have to add something indiviudllay to each one of these ?
# variables:
# oFastK(0),
# oFastD(0),
# oSlowK(0),
# oSlowD(0),
# Length(0),
# NormStoch(0),
# SmoothStoch(0),
# Premier(0);
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

# 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
 
# 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
this area is different
( ( close(period = Agg1) - Lowest( low(period = Agg1)
 
this would be the next variable D, def oFastKD= 100 *( ( close(period = Agg1) - Lowest( low(period = Agg1), StochLength ) ) / ( Highest( high(period = Agg1), StochLength ) - Lowest( low(period = Agg1), StochLength ) ) );
 
Think of the calculations.
def oFastK1= 100 *( ( close(period = Agg1) - Lowest( low(period = Agg1), StochLength ) ) / ( Highest( high(period = Agg1), StochLength ) - Lowest( low(period = Agg1), StochLength ) ) );

Ok had to change name to oFastK1 as oFastK already existed.
Now the new oFastk1 value was calculated using agg.
So what value needs to b used here;
def oFastD = Average( oFastK, 1 );
 
def oFastD = Average( oFastK, 1 ); = 100 *( ( close(period = Agg1) - Lowest( low(period = Agg1), StochLength ) ) / ( Highest( high(period = Agg1), StochLength ) - Lowest( low(period = Agg1), StochLength ) ) );
 
Follow what I am showing.
def oFastK1= 100 *( ( close(period = Agg1) - Lowest( low(period = Agg1), StochLength ) ) / ( Highest( high(period = Agg1), StochLength ) - Lowest( low(period = Agg1), StochLength ) ) );

Ok had to change name to oFastK1 as oFastK already existed.
Now the new oFastk1 value was calculated using agg.
So what value needs to b used here;
def oFastD = Average( oFastK, 1 );


so how about;
def oFastD1= Average( oFastK1, 1 );
 
So what value needs to b used here;
def oFastD = Average( oFastK, 1 );

I don't know how to calculate or add value to this, not sure what the next step would be oSlowK(0), ?
 
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?
 
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?

def oSlowK = oFastD( Average( oFastK1, 1 );
 
You are writing a new study. We just want to modify the original code. Do not change the calculations. It should look just like the original except for agg mods.

def oSlowK = oFastD; becomes def oSlowK1 = oFastD1;
 
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 );
def oSlowK1 = oFastD1;
 
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 );
 
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 );
def oSlowK1 = oFastD1;
so far

# 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 ) ) );
def oFastD1 = Average( oFastK1, 1 );
def oSlowK1 = oFastD1;
 
# 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 ) ) );
def oFastD1 = Average( oFastK1, 1 );
def oSlowK1 = oFastD1;

Bold are values calculated with agg, now use those new values in following calculations
 
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 );
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
489 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top