KingsOp
New member
This is a project I've been working on for a few. It is based off of the Ichimoku cloud. I normally only use the cloud itself formed by Span A and Span B. However seeing the cloud all the time on the scree was a bit distracting. I decided to write a utility label that would allow me to be able to know where price action was in relation to the cloud with visual cues as to when PA was getting within a certain distance from the cloud top or bottom, or when in the cloud whether PA was closer to to the top or bottom based off the center of the cloud. This is the result. Currently this displays the price target of cloud top or cloud bottom whether a bullish or bearish cloud formation, as well when in cloud the center point of that cloud. It will also change color depending on relation or price action to the cloud.
Options built in are:
Tenkan period
Kijun Period
Percent distance from cloud top or bottom
color selection for notification
Will be looking to add some conditional plot functionality in future versions
________________________________________________________________________________________________________________________________________________________________________________
# Cloud Proximity Utility Label
# Assembled by TimR of Kings Options LLC in association with TDG
#All rights reserved by TimR
#You do not have permission to share this indicator. Please contact TReid#0007 on Discord for permission.
# Version 1.0
# # <NOTES>
# Based on the Ichimoku System
# This software is licensed for individual use only.
# NOT FOR REDISTRIBUTION PRIVATE/CONFIDENTIAL
# Copyright (c) 2021 Kings Options LLC
input tenkan_period = 9;
input kijun_period = 26;
input Percent = 1.000;
#hint percent: input percent away fromn cloud to be notified visually
def Tenkan = (Highest(high, tenkan_period) + Lowest(low, tenkan_period)) / 2;
def Kijun = (Highest(high, kijun_period) + Lowest(low, kijun_period)) / 2;
def "Span A" = (Tenkan[kijun_period] + Kijun[kijun_period]) / 2;
def "Span B" = (Highest(high[kijun_period], 2 * kijun_period) + Lowest(low[kijun_period], 2 * kijun_period)) / 2;
def Chikou = close[-kijun_period];
def bullishcloud = "Span A" > "Span B";
def bearishcloud = "Span B" >= "Span A";
def percentovercloudA = "Span A" + ("Span A" * (Percent / 100));
def percentovercloudB = "Span B" + ("Span B" * (Percent / 100));
def percentundercloudA = "Span A" - ("Span A" * (Percent / 100));
def percentundercloudB = "Span B" - ("Span B" * (Percent / 100));
def Cloudtop = if bullishcloud then "Span A" else if bearishcloud then "Span B" else Double.NaN;
def cloudtoppercent = if bullishcloud then percentovercloudA else if bearishcloud then percentovercloudB else Double.NaN;
def Cloudbottom = if bullishcloud then "Span B" else if bearishcloud then "Span A" else Double.NaN;
def cloudbottompercent = if bullishcloud then percentundercloudB else if bearishcloud then percentundercloudA else Double.NaN;
def condone = (close > cloudtoppercent);
def condtwo = (close >= Cloudtop) and (close <= cloudtoppercent);
def condthree = (close < cloudbottompercent);
def condfour = (close <= Cloudbottom) and (close >= cloudbottompercent);
def Condfive = if bullishcloud then (("Span A" - "Span B") / 2) + "Span B" else if bearishcloud then (("Span B" - "Span A") / 2) + "Span A" else Double.NaN;
AddLabel (yes, if condone then ("Above Cloud: " + Round(Cloudtop, 2))
else if condtwo then ("Cloud Top Close: " + Round(Cloudtop, 2))
else if condthree then ("Below Cloud: " + Round(Cloudbottom, 2))
else if condfour then ("Cloud Btm Close: " + Round(Cloudbottom, 2))
else "In Cloud: " + Condfive,
if condone then GlobalColor("Far Above")
else if condtwo then GlobalColor("Set Percent Above")
else if condthree then GlobalColor("Far Below")
else if condfour then GlobalColor("Set Percent Below")
else GlobalColor("In The Cloud"));
DefineGlobalColor("Far Above", Color.DARK_GREEN);
DefineGlobalColor("Set Percent Above", Color.GREEN);
DefineGlobalColor("Far Below", Color.DARK_RED);
DefineGlobalColor("Set Percent Below", Color.RED);
DefineGlobalColor("In The Cloud", Color.DARK_GRAY);
#hint: This is designed to give you relative positioning to the Ichimoku Cloud for the given chart timeframe. It displays the center of the cloud when price action is inside the cloud so you may know whether you are above or below. It also displays being close to the cloud at a default of 1% away from cloud top or bottom regardless of a bearish or bullish cloud structure. You may change that setting to whatever you deem appropriate. Otherwise beyond that percentage you will be shown the readout for the cloud top if price action is above it or cloud bottom if price action is below.
Options built in are:
Tenkan period
Kijun Period
Percent distance from cloud top or bottom
color selection for notification
Will be looking to add some conditional plot functionality in future versions
________________________________________________________________________________________________________________________________________________________________________________
# Cloud Proximity Utility Label
# Assembled by TimR of Kings Options LLC in association with TDG
#All rights reserved by TimR
#You do not have permission to share this indicator. Please contact TReid#0007 on Discord for permission.
# Version 1.0
# # <NOTES>
# Based on the Ichimoku System
# This software is licensed for individual use only.
# NOT FOR REDISTRIBUTION PRIVATE/CONFIDENTIAL
# Copyright (c) 2021 Kings Options LLC
input tenkan_period = 9;
input kijun_period = 26;
input Percent = 1.000;
#hint percent: input percent away fromn cloud to be notified visually
def Tenkan = (Highest(high, tenkan_period) + Lowest(low, tenkan_period)) / 2;
def Kijun = (Highest(high, kijun_period) + Lowest(low, kijun_period)) / 2;
def "Span A" = (Tenkan[kijun_period] + Kijun[kijun_period]) / 2;
def "Span B" = (Highest(high[kijun_period], 2 * kijun_period) + Lowest(low[kijun_period], 2 * kijun_period)) / 2;
def Chikou = close[-kijun_period];
def bullishcloud = "Span A" > "Span B";
def bearishcloud = "Span B" >= "Span A";
def percentovercloudA = "Span A" + ("Span A" * (Percent / 100));
def percentovercloudB = "Span B" + ("Span B" * (Percent / 100));
def percentundercloudA = "Span A" - ("Span A" * (Percent / 100));
def percentundercloudB = "Span B" - ("Span B" * (Percent / 100));
def Cloudtop = if bullishcloud then "Span A" else if bearishcloud then "Span B" else Double.NaN;
def cloudtoppercent = if bullishcloud then percentovercloudA else if bearishcloud then percentovercloudB else Double.NaN;
def Cloudbottom = if bullishcloud then "Span B" else if bearishcloud then "Span A" else Double.NaN;
def cloudbottompercent = if bullishcloud then percentundercloudB else if bearishcloud then percentundercloudA else Double.NaN;
def condone = (close > cloudtoppercent);
def condtwo = (close >= Cloudtop) and (close <= cloudtoppercent);
def condthree = (close < cloudbottompercent);
def condfour = (close <= Cloudbottom) and (close >= cloudbottompercent);
def Condfive = if bullishcloud then (("Span A" - "Span B") / 2) + "Span B" else if bearishcloud then (("Span B" - "Span A") / 2) + "Span A" else Double.NaN;
AddLabel (yes, if condone then ("Above Cloud: " + Round(Cloudtop, 2))
else if condtwo then ("Cloud Top Close: " + Round(Cloudtop, 2))
else if condthree then ("Below Cloud: " + Round(Cloudbottom, 2))
else if condfour then ("Cloud Btm Close: " + Round(Cloudbottom, 2))
else "In Cloud: " + Condfive,
if condone then GlobalColor("Far Above")
else if condtwo then GlobalColor("Set Percent Above")
else if condthree then GlobalColor("Far Below")
else if condfour then GlobalColor("Set Percent Below")
else GlobalColor("In The Cloud"));
DefineGlobalColor("Far Above", Color.DARK_GREEN);
DefineGlobalColor("Set Percent Above", Color.GREEN);
DefineGlobalColor("Far Below", Color.DARK_RED);
DefineGlobalColor("Set Percent Below", Color.RED);
DefineGlobalColor("In The Cloud", Color.DARK_GRAY);
#hint: This is designed to give you relative positioning to the Ichimoku Cloud for the given chart timeframe. It displays the center of the cloud when price action is inside the cloud so you may know whether you are above or below. It also displays being close to the cloud at a default of 1% away from cloud top or bottom regardless of a bearish or bullish cloud structure. You may change that setting to whatever you deem appropriate. Otherwise beyond that percentage you will be shown the readout for the cloud top if price action is above it or cloud bottom if price action is below.
Last edited: