NexusFi: Find Your Edge


Home Menu

 





need help modifying bollinger and keltnerchannel


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one iamaterp with 1 posts (0 thanks)
    2. looks_two Afriend247 with 1 posts (1 thanks)
    3. looks_3 sibullsibear with 1 posts (0 thanks)
    4. looks_4 gmoyano with 1 posts (0 thanks)
    1. trending_up 3,080 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread

need help modifying bollinger and keltnerchannel

  #1 (permalink)
sibullsibear
somewhere
 
Posts: 2 since Apr 2016
Thanks Given: 0
Thanks Received: 0

hi..i newbie for using thinkscript..im not a programmer who know coding etc...for last 3 years im trading only using thinkorswim, multi time frame , simple indicator EMA 8 - EMA 89....and TTM Squeeze....it works for me and im comfortable using this indicator...recently i am using bollingerbands and keltnerchannel...i`ve tried to combined bollingerband and keltnerchannel with EMA 8 - 89 indicator so i dont need to make new window for bollingerband and keltner channel...which candle change the color when bollingerband upper and lower band inside the keltnerchannel...the problem is...i only can make this color into one color blue for example...so i dont know the candle going up or down when bollingerband upper and lower band inside keltner channel...is it possible to make candle change the color based on price going up or down ??

this is the simple script


Quoting 

plot MA8 = movAvgExponential(length=8);
MA8.SetDefaultColor(color.YELLOW);

plot MA21 = movAvgExponential(length=21);
MA21.SetDefaultColor(color.white);

plot MA34 = movAvgExponential(length=34);
MA34.SetDefaultColor(color.magenta);

plot MA55 = movAvgExponential(length=55);
MA55.SetDefaultColor(color.cyan);

plot MA89 = movAvgExponential(length=89);
MA89.SetDefaultColor(color.blue);

Addcloud(MA8, MA21, color.lime, color.magenta);


#Bollinger Squeeze
plot BBupper = BollingerBands().”Upperband” ;
plot KCupper = KeltnerChannels().”Upper_band” ;
plot BBlower = BollingerBands().”lowerband” ;
plot KClower = KeltnerChannels().”lower_band” ;

bbupper.Hide();
KCupper.Hide();
BBlower.Hide();
KClower.Hide();

bbupper.DefineColor("Sqz", Color.BLUE);
BBlower.DefineColor("sqz", Color.BLUE);

AssignPriceColor(if BBupper < KCupper then bbupper.Color("sqz") else Color.CURRENT);

AssignPriceColor(if BBlower > KClower then BBlower.Color("sqz") else Color.CURRENT);




appreciate anyone who can help with this script

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Better Renko Gaps
The Elite Circle
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
 
  #2 (permalink)
iamaterp
new york
 
Posts: 1 since Feb 2019
Thanks Given: 0
Thanks Received: 0

Hello, I came across your script on this forum and was curious how you trade it in conjunction with the TTM Squeeze? Are you lining up a moving average crossover with the TTM as a separate indicator on the bottom and waiting for a cross when the squeeze(red to green dots) happens?

Reply With Quote
  #3 (permalink)
Afriend247
Los Angeles, California
 
Posts: 9 since Sep 2022
Thanks Given: 3
Thanks Received: 2


I wrote a short code to change the color of the candle that may help you in figuring out how to fix your problem. Not sure if this is what you are asking, but it seems that way on your last statement.

#color bars based on open
input paintbars = yes;
def up = close > open;
def dn = close < open;

DefineGlobalColor("Bullish", Color.GREEN);
DefineGlobalColor("Bearish", Color.RED);
AssignPriceColor(if up and paintbars then globalColor("Bullish") else if dn and paintbars then globalColor("Bearish") else color.current);



sibullsibear View Post
hi..i newbie for using thinkscript..im not a programmer who know coding etc...for last 3 years im trading only using thinkorswim, multi time frame , simple indicator EMA 8 - EMA 89....and TTM Squeeze....it works for me and im comfortable using this indicator...recently i am using bollingerbands and keltnerchannel...i`ve tried to combined bollingerband and keltnerchannel with EMA 8 - 89 indicator so i dont need to make new window for bollingerband and keltner channel...which candle change the color when bollingerband upper and lower band inside the keltnerchannel...the problem is...i only can make this color into one color blue for example...so i dont know the candle going up or down when bollingerband upper and lower band inside keltner channel...is it possible to make candle change the color based on price going up or down ??

this is the simple script




appreciate anyone who can help with this script


Reply With Quote
Thanked by:




Last Updated on February 16, 2023


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts