• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

Color Changing Chikou Indicator for ThinkorSwim

That's it...that's all you get :p

No other elements of the Ichimoku included...GL

TSLA 2 min chart 12/31/2020

Have a good new year

Should note that I'm using a 18/52 TK period

7wthla3.png


Code:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2020
#

input tenkan_period = 18;
input kijun_period = 52;

def Tenkan = (Highest(high, tenkan_period) + Lowest(low, tenkan_period)) / 2;
def Kijun = (Highest(high, kijun_period) + Lowest(low, kijun_period)) / 2;

plot Chikou = close[-kijun_period];


def DownChik = Chikou < High from 26 bars ago and Chikou < Close;
def UpChik = Chikou > High from 26 bars ago and Chikou > Close;


Chikou.assignValueColor( if UpChik then color.DARK_GREEN else if DownChik then color.DARK_RED else color.BLUE);
 
Last edited:
Updated. Notes in code

kAli4AN.png


DfLK82Y.png


Code:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2020
#
#1/1/2021 added code to reflect if longer Length Chikou is above or below shorter Chikou (Standard setting)
input tenkan_period = 18;
input kijun_period = 52;

input tenkan_periods = 9;
input kijun_periods = 26;

def Tenkan = (Highest(high, tenkan_period) + Lowest(low, tenkan_period)) / 2;
def Kijun = (Highest(high, kijun_period) + Lowest(low, kijun_period)) / 2;

def Tenkans = (Highest(high, tenkan_periods) + Lowest(low, tenkan_periods)) / 2;
def Kijuns = (Highest(high, kijun_periods) + Lowest(low, kijun_periods)) / 2;

#def Chikou = close[-kijun_period];
def Chikous = close[-kijun_periods];

plot Chikou = close[-kijun_period];


def LongPrice = Chikou > Close;
def ShortPrice = Chikou < Close;
def GreatHigh = Chikou > High from 26 bars ago;
def LessHigh = Chikou < High from 26 bars ago;
def GreatLow =  Chikou > Low from 26 bars ago;
def LessLow =  Chikou < Low from 26 bars ago;
def Chik_Gr_Chick = Chikou > Chikous;
def Chik_Lss_Chik = Chikou < Chikous;




Chikou.assignValueColor( if LongPrice and GreatHigh and chik_Gr_Chick then color.DARK_GREEN else if ShortPrice and lessLow and Chik_Lss_Chik then color.DARK_RED else color.BLUE);
 

XeoNoX

Well-known member
VIP
basic study with some kind of strategy, this should go more under strategy, however you didn't really explain the strategy. ;( @BenTen
 
basic study with some kind of strategy, this should go more under strategy, however you didn't really explain the strategy. ;( @BenTen

Ahhh...yeah..I didn't....:)

Use basically the same way you would if using the full Ichimoku, with a few caveats.....ex..Chikou is above price and turns red, can be used as a short signal..

Generally if chikou is below price and blue, think countertrend. same if above price below price and blue move up, possible just a CT
above price and blue, short CT

XcmW4a2.png


Can also look for chikou lower high pivots or vice versa.

ZJcKNvy.png
 

xiaoriver

New member
happened to step upon this page. Looks very nice. Thank you very much for sharing. Will spend some time to study it.

That lower study, FVO_MACD_with_RSI_Stochastic_cloud, looks interesting too. Tried to search and google for it, nothing came up. Anyone able to share this too?
 
happened to step upon this page. Looks very nice. Thank you very much for sharing. Will spend some time to study it.

That lower study, FVO_MACD_with_RSI_Stochastic_cloud, looks interesting too. Tried to search and google for it, nothing came up. Anyone able to share this too?

Hi, haven't been on much lately. Hope you find it useful.
As far as the lower study, I no longer have that one atm....if I come across it, I'll post
 

Jack Sprat

New member
VIP
@xiaoriver this might be it:

#START OF RSI/Stochastic/MACD Confluence combo for ThinkOrSwim
#
#CHANGELOG
# 2020.10.27 V1.0 @cos251 - Added RSI, StochasticSlow and MACD to same indicator; this will plot only MACD but also
# - calculates RSI and Sotchasit; Will shade the lower plot area of the following conditions are met
# Shade GREEN = RSI > 50 and SlowK > 50 and (macd)Value > (macd)Avg
# Shade RED = RSI < 50 and SlowK < 50 and (macd)Value < (macd)Avg
#
#REQUIREMENTS - RSI Set to 7, EXPONENTIAL
# Stoch Slow 5(not14) and 3 WILDERS
# MACD 12,26,9 WEIGHTED
#
#
#CREDITS
# requesed by "@Joseph Patrick 18"
#
#LINK
# https://rockwell-files.s3.amazonaws.com/PXCompanionGuide2ndEd_cover.pdf
# Markus Heikoetter who is the author of the Power X Strategy
# https://usethinkscript.com/threads/mimicking-power-x-strategy-by-markus-heitkoetter.4283/
#
#USAGE
#

declare lower;


################################################################
########## MACD #########
################################################################
input fastLengthMACD = 12;
input slowLengthMACD = 26;
input MACDLength = 9;
input averageTypeMACD = AverageType.WEIGHTED;
input showBreakoutSignals = no;

plot Value = MovingAverage(averageTypeMACD, close, fastLengthMACD) - MovingAverage(averageTypeMACD, close, slowLengthMACD);
plot Avg = MovingAverage(averageTypeMACD, Value, MACDLength);
plot Diff = Value - Avg;
plot ZeroLine = 0;
plot UpSignalMACD = if Diff crosses above ZeroLine then ZeroLine else Double.NaN;
plot DownSignalMACD = if Diff crosses below ZeroLine then ZeroLine else Double.NaN;

UpSignalMACD.SetHiding(!showBreakoutSignals);
DownSignalMACD.SetHiding(!showBreakoutSignals);

Value.SetDefaultColor(Color.GREEN);
Avg.SetDefaultColor(Color.RED);
Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(4);
Diff.DefineColor("Positive and Up", Color.GREEN);
Diff.DefineColor("Positive and Down", Color.DARK_GREEN);
Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.DARK_RED);
Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.color("Positive and Up") else Diff.color("Positive and Down") else if Diff < Diff[1] then Diff.color("Negative and Down") else Diff.color("Negative and Up"));
ZeroLine.SetDefaultColor(GetColor(0));
UpSignalMACD.SetDefaultColor(Color.UPTICK);
UpSignalMACD.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
DownSignalMACD.SetDefaultColor(Color.DOWNTICK);
DownSignalMACD.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);


################################################################
########## RSI #########
################################################################
input lengthRSI = 7;
input over_BoughtRSI = 70;
input over_SoldRSI = 30;
input price = close;
input averageTypeRSI = AverageType.EXPONENTIAL;
#input showBreakoutSignals = no;

def NetChgAvg = MovingAverage(averageTypeRSI, price - price[1], lengthRSI);
def TotChgAvg = MovingAverage(averageTypeRSI, AbsValue(price - price[1]), lengthRSI);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI = 50 * (ChgRatio + 1);


################################################################
########## Stochastic Slow #########
################################################################
input over_boughtSt = 80;
input over_soldSt = 20;
input KPeriod = 5;
input DPeriod = 3;
input priceH = high;
input priceL = low;
input priceC = close;
input averageTypeStoch = AverageType.WILDERS;
input showBreakoutSignalsStoch = {default "No", "On SlowK", "On SlowD", "On SlowK & SlowD"};

def SlowK = reference StochasticFull(over_boughtSt, over_soldSt, KPeriod, DPeriod, priceH, priceL, priceC, 3, averageTypeStoch).FullK;
def SlowD = reference StochasticFull(over_boughtSt, over_soldSt, KPeriod, DPeriod, priceH, priceL, priceC, 3, averageTypeStoch).FullD;

################################################################
########## Check for signals > 50 and macd Value > Avg ########
################################################################
def rsiGreen = if RSI >= 50 then 1 else Double.NaN;
def rsiRed = if RSI < 50 then 1 else Double.NaN;
def stochGreen = if SlowK >= 50 then 1 else Double.NaN;
def stochRed = if SlowK < 50 then 1 else Double.NaN;
def macdGreen = if Value > Avg then 1 else Double.NaN;
def macdRed = if Value < Avg then 1 else Double.NaN;


#################################################################
############ Shade areas based on criteria; adjust as needed ##
#################################################################
AddCloud(if rsiGreen and stochGreen and macdGreen then Double.POSITIVE_INFINITY else Double.NaN, if rsiGreen and stochGreen then Double.NEGATIVE_INFINITY else Double.NaN, Color.LIGHT_Green);
AddCloud(if rsiRed and stochRed and macdRed then Double.POSITIVE_INFINITY else Double.NaN, if rsiRed and stochRed then Double.NEGATIVE_INFINITY else Double.NaN, Color.LIGHT_RED);
 

Similar threads

Top