Stochastic with 3 time frames input ability - futures io
futures io futures trading



Stochastic with 3 time frames input ability


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one devildriver6 with 1 posts (1 thanks)
    2. looks_two Eaglenest with 1 posts (0 thanks)
    3. looks_3 Stocktrader with 1 posts (0 thanks)
    4. looks_4 DrPatrick with 1 posts (0 thanks)
    1. trending_up 2,142 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 3 posts
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Stochastic with 3 time frames input ability

(login for full post details)
  #1 (permalink)
Boca Raton
 
 
Posts: 1 since Jul 2017
Thanks: 0 given, 0 received

Need to have 3 input for Stochastic in the same indicator window. Pic show is Mt4
I keep the %K and hide %D and use 3 time frames

Attached Thumbnails
Click image for larger version

Name:	Stocahstic 3 timeframes MT4 example.png
Views:	148
Size:	8.5 KB
ID:	237457  
Reply With Quote

Can you help answer these questions
from other members on futures io?
EL/PL for FOPs?
EasyLanguage Programming
COTbase for quant trading?
Elite Algorithmic NinjaTrader Trading
What blockvolume is visible? - order processing
NinjaTrader
Short Interest Ratio indicator?
ThinkOrSwim
ZigZag with Depth and Backstep
EasyLanguage Programming
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Battlestations: Show us your trading desks!
124 thanks
Big Mike in Ecuador
61 thanks
Want your NinjaTrader indicator created, free?
28 thanks
If you needed one-on-one help with any trading issue, ho …
26 thanks
Selling Options on Futures?
21 thanks
 
(login for full post details)
  #2 (permalink)
Dublin Ireland
 
Experience: Intermediate
Platform: Ninja, TOS
Broker: RCG Direct/Continuum
Trading: ZB
 
Posts: 18 since Mar 2012
Thanks: 4 given, 7 received

Do you want 3 different period lengths for %K or do you want 3 different Aggregation periods ie Weeks, Days and Minutes?

If you just want 3 different periods see the code below: Diff Aggregations would be more complicated.

declare lower;

input over_bought = 80;
input over_sold = 20;

input KPeriod1= 10;
input KPeriod2= 7;
input KPeriod3= 3;

input priceH = high;
input priceL = low;
input priceC = close;
input slowing_period = 3;
input averageType = AverageType.SIMPLE;

def lowest_k1 = Lowest(priceL, KPeriod1);
def lowest_k2 = Lowest(priceL, KPeriod2);
def lowest_k3 = Lowest(priceL, KPeriod3);

def c1 = priceC - lowest_k1;
def c2 = priceC - lowest_k2;
def c3 = priceC - lowest_k3;

def c21 = Highest(priceH, KPeriod1) - lowest_k1;
def c22 = Highest(priceH, KPeriod2) - lowest_k2;
def c23 = Highest(priceH, KPeriod3) - lowest_k3;

def FastK1 = if c21 != 0 then c1 / c21 * 100 else 0;
def FastK2 = if c22 != 0 then c2 / c22 * 100 else 0;
def FastK3 = if c23 != 0 then c3 / c23 * 100 else 0;

plot FullK1 = MovingAverage(averageType, FastK1, slowing_period);
plot FullK2 = MovingAverage(averageType, FastK2, slowing_period);
plot FullK3 = MovingAverage(averageType, FastK3, slowing_period);

plot OverBought = over_bought;
plot OverSold = over_sold;

FullK1.SetDefaultColor(GetColor(5));
FullK2.SetDefaultColor(GetColor(0));
FullK3.SetDefaultColor(GetColor(3));
OverBought.SetDefaultColor(GetColor(1));
OverSold.SetDefaultColor(GetColor(1));

Reply With Quote
 
(login for full post details)
  #3 (permalink)
Dallas, Texas
 
 
Posts: 43 since Jun 2015
Thanks: 2 given, 30 received



Stocktrader View Post
Do you want 3 different period lengths for %K or do you want 3 different Aggregation periods ie Weeks, Days and Minutes?


Here's the multiple timeframe stoch code....




declare lower;

input over_bought = 80;
input over_sold = 20;
input KPeriod = 8;
input DPeriod = 3;
input slowing_period = 3;
input averageType = AverageType.SIMPLE;
input Period1 = aggregationPeriod.FIVE_MIN;
input Period2 = aggregationPeriod.THIRTY_MIN;
input Period3 = aggregationPeriod.HOUR;
input HideK = no;
input HideD = yes;


# TF1
def T1L = low(period = Period1);
def T1H = high(period = Period1);
def T1C = close(period = Period1);

def TF1_lowest_k = Lowest(T1L, KPeriod);
def TF1_c1 = T1C - TF1_lowest_k;
def TF1_c2 = Highest(T1H, KPeriod) - TF1_lowest_k;
def TF1_FastK = if TF1_c2 != 0 then TF1_c1 / TF1_c2 * 100 else 0;

plot TF1_FullK =
if HideK then double.nan
else MovingAverage(averageType, TF1_FastK, slowing_period);
plot TF1_FullD = if HideD then double.nan
else MovingAverage(averageType, TF1_FullK, DPeriod);

# TF2
def T2L = low(period = Period2);
def T2H = high(period = Period2);
def T2C = close(period = Period2);

def TF2_lowest_k = Lowest(T2L, KPeriod);
def TF2_c1 = T2C - TF2_lowest_k;
def TF2_c2 = Highest(T2H, KPeriod) - TF2_lowest_k;
def TF2_FastK = if TF2_c2 != 0 then TF2_c1 / TF2_c2 * 100 else 0;

plot TF2_FullK =
if HideK then double.nan
else MovingAverage(averageType, TF2_FastK, slowing_period);
plot TF2_FullD = if HideD then double.nan
else MovingAverage(averageType, TF2_FullK, DPeriod);


# TF3
def T3L = low(period = Period3);
def T3H = high(period = Period3);
def T3C = close(period = Period3);

def TF3_lowest_k = Lowest(T3L, KPeriod);
def TF3_c1 = T3C - TF3_lowest_k;
def TF3_c2 = Highest(T3H, KPeriod) - TF3_lowest_k;
def TF3_FastK = if TF3_c2 != 0 then TF3_c1 / TF3_c2 * 100 else 0;

plot TF3_FullK =
if HideK then double.nan
else MovingAverage(averageType, TF3_FastK, slowing_period);
plot TF3_FullD = if HideD then double.nan
else MovingAverage(averageType, TF3_FullK, DPeriod);


# OB / OS
plot OverBought = over_bought;
plot OverSold = over_sold;
OverBought.setdefaultColor(color.WHITE);
OverBought.hidetitle();
OverBought.hidebubble();
OverSold.setdefaultColor(color.WHITE);
OverSold.hidetitle();
OverSold.hidebubble();

plot Midline = (OverBought + OverSold) / 2;
Midline.setdefaultColor(color.WHITE);
Midline.setstyle(curve.MEDIUM_DASH);
Midline.hidetitle();
Midline.hidebubble();

Reply With Quote
The following user says Thank You to devildriver6 for this post:
 
(login for full post details)
  #4 (permalink)
Murfreesboro, TN, USA
 
Experience: Intermediate
Platform: ThinkorSwim
Broker: Thinkorswim
Trading: emini ES
 
Posts: 8 since Feb 2017
Thanks: 2 given, 22 received

Thank you for writing and sharing this code. This fits my needs perfectly.
I was looking for a triple time frame stochastic. I use 12%k, without %d, typically on 5-2-1 minute and Daily-30-5 minute charts.

Follow me on Twitter Reply With Quote


futures io Trading Community Platforms and Indicators ThinkOrSwim > Stochastic with 3 time frames input ability


Last Updated on August 15, 2017


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts