Changing bar colors on TOS charts, when conditions met. - ThinkOrSwim | futures io social day trading
futures io futures trading


Changing bar colors on TOS charts, when conditions met.
Updated: Views / Replies:5,654 / 6
Created: by mcamilapaez Attachments:2

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 
Thread Tools Search this Thread
 

Changing bar colors on TOS charts, when conditions met.

  #1 (permalink)
Trading Apprentice
San Jose, Costa Rica
 
Futures Experience: Intermediate
Platform: TOS, Sierra Charts
Favorite Futures: ES, currencies
 
Posts: 5 since May 2014
Thanks: 3 given, 0 received

Changing bar colors on TOS charts, when conditions met.

Does someone know how to change the color on TOS chart bars once two different conditions have been met?

Reply With Quote
 
  #2 (permalink)
1.Fibs 2.??? 3.Profit
Puerto Rico
 
Futures Experience: Intermediate
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: ES
 
rmejia's Avatar
 
Posts: 384 since Oct 2010
Thanks: 3,597 given, 421 received

The candle color?

AssignPriceColor
https://tlc.thinkorswim.com/center/charting/thinkscript/reference/Functions/Look---Feel/AssignPriceColor

Reply With Quote
 
  #3 (permalink)
Trading Apprentice
San Jose, Costa Rica
 
Futures Experience: Intermediate
Platform: TOS, Sierra Charts
Favorite Futures: ES, currencies
 
Posts: 5 since May 2014
Thanks: 3 given, 0 received

Tried already


Thanks!! I have already tried those instructios unsuccessfully.

Reply With Quote
 
  #4 (permalink)
1.Fibs 2.??? 3.Profit
Puerto Rico
 
Futures Experience: Intermediate
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: ES
 
rmejia's Avatar
 
Posts: 384 since Oct 2010
Thanks: 3,597 given, 421 received

Post the code you are trying to edit to see what's up.

Reply With Quote
 
  #5 (permalink)
Trading Apprentice
San Jose, Costa Rica
 
Futures Experience: Intermediate
Platform: TOS, Sierra Charts
Favorite Futures: ES, currencies
 
Posts: 5 since May 2014
Thanks: 3 given, 0 received

Coloring price bars when divergence

What I want to do is find the price bar in which there is divergence between price and momentum(28) (over the last 60 perios). Once a divergence is present I want either the price bar to be colored (red for bear divergence/blue for bull) or highlight it somehow...
And it is not working correctly..

declare upper;
INPUT Price = CLOSE;
AssignBackgroundColor(Color.BLACK);
def mom28 = price-price[28];
def swinghigh=highest(60);
def swinglow=lowest(60);
def swingmomhigh=highest(mom28,60);
def swingmomlow=lowest(mom28,60);
def MOMBEAR=mom28<swingmomhigh;
def MOMBULL=mom28>swingmomlow;

Assignpricecolor(if swinghigh then (if MOMBEAR then color.red else color.white) else color.white);

Assignpricecolor(if swinglow then ( if MOMBULL then color.cyan else color.white) else color.white);


Thanks for your help!

Reply With Quote
 
  #6 (permalink)
1.Fibs 2.??? 3.Profit
Puerto Rico
 
Futures Experience: Intermediate
Platform: thinkorswim
Broker/Data: TD Ameritrade
Favorite Futures: ES
 
rmejia's Avatar
 
Posts: 384 since Oct 2010
Thanks: 3,597 given, 421 received

Answer
This post has been selected as an answer to the original posters question Answer

This is a code I have previously worked on; not sure if it is similar to what you are looking for regarding Momentum.

It is the default Momentum indicator with divergence. I set it to 28 length and bars back 60 for the image. The code is a mess, I have several experiments going on in it, have not cleaned it. Can be a starting point if similar to what you need.

 
Code
declare lower;

input length = 12;
input price = close;

Assert(length > 0, "'length' must be positive: " + length);

plot Momentum = price - price[length];
plot ZeroLine = 0;

#Momentum.SetDefaultColor(Color.Black);
Momentum.AssignValueColor(if Momentum > ZeroLine then Color.Green else Color.Red);
Momentum.setLineWeight(3);
#ZeroLine.SetDefaultColor(Color.Dark_Gray);
ZeroLine.AssignValueColor(if Momentum > ZeroLine then Color.Green else Color.Red);
ZeroLine.setLineWeight(2);


#AddCloud(Momentum, ZeroLine > 0, CreateColor(0, 80, 0), CreateColor(80, 0, 0));
AddCloud(Momentum, ZeroLine > 0, CreateColor(153,255,153), CreateColor(255,153,153));

input BarsBack = 60;
input MomAvgLength = 20;
input PaintBars = No;
plot MomAvg = ExpAverage(Momentum, MomAvgLength);
MomAvg.SetDefaultColor(CreateColor(51,51,51));
MomAvg.SetLineWeight(2);
MomAvg.SetStyle(Curve.Short_Dash);


plot DivergeTop = if Momentum>0 and Momentum<Momentum[1] and Momentum[1]>Momentum[2] and Momentum<highest(Momentum,BarsBack) and highest(Close,5)  > highest(Close[6],BarsBack) then highest(Momentum,barsBack) else double.nan;

plot DivergeBottom = if Momentum<0 and Momentum>Momentum[1] and Momentum[1]<Momentum[2] and Momentum>lowest(Momentum,BarsBack)and lowest(Close,5) < lowest(Close[6],BarsBack) then lowest(Momentum,BarsBack) else double.nan;

DivergeTop.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
DivergeTop.SetLineWeight(5);
DivergeTop.SetDefaultColor(GetColor(5));

DivergeBottom.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
DivergeBottom.SetLineWeight(5);
DivergeBottom.SetDefaultColor(GetColor(6));

AssignPriceColor (if !PaintBars then Color.CURRENT else if Momentum > 0 and Momentum < Momentum[1] and Momentum[1] > Momentum[2] and Momentum < Highest(Momentum, BarsBack) and Highest(close, 5)  > Highest(close[6], BarsBack) then color.Red else if Momentum < 0 and Momentum > Momentum[1] and Momentum[1] < Momentum[2] and Momentum > Lowest(Momentum, BarsBack) and Lowest(close, 5) < Lowest(close[6], BarsBack) then color.Cyan else Color.Current);

#AssignPriceColor (if !PaintBars then Color.CURRENT else if Momentum > 0 and Momentum < Momentum[1] and Momentum[1] > Momentum[2] and Momentum < Highest(Momentum, BarsBack) and Highest(close, 5)  > Highest(close[6], BarsBack) then color.Red else if Momentum < 0 and Momentum > Momentum[1] and Momentum[1] < Momentum[2] and Momentum > Lowest(Momentum, BarsBack) and Lowest(close, 5) < Lowest(close[6], BarsBack) then color.Green else if Momentum >= 0 then if Momentum > Momentum[1] then Color.Current else Color.Current else if Momentum < Momentum[1] then Color.Current else Color.Current);
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
 
  #7 (permalink)
Trading Apprentice
San Jose, Costa Rica
 
Futures Experience: Intermediate
Platform: TOS, Sierra Charts
Favorite Futures: ES, currencies
 
Posts: 5 since May 2014
Thanks: 3 given, 0 received

Thank you so much!
I will try it and Tell you then....

Reply With Quote

Reply



futures io > > > > Changing bar colors on TOS charts, when conditions met.

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Very Simple Help Editing RewardRisk V2 Indicator (Changing Colors and Line Size) lllusion The Elite Circle 6 March 30th, 2017 12:53 PM
Moving Average With Colors TOS Code Marty3 ThinkOrSwim 3 May 5th, 2015 12:21 PM
UPdate strategy and bar colors nanook77 NinjaTrader Programming 9 November 7th, 2011 11:47 AM
Color changing Regression Line with Paint Bar Gibby NinjaTrader Programming 49 April 23rd, 2010 03:54 PM
Do you keep changing the background colors of your charts? sharp2be NinjaTrader 7 April 16th, 2010 03:55 PM


All times are GMT -4. The time now is 06:06 PM.

Copyright © 2017 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
Page generated 2017-12-15 in 0.09 seconds with 34 queries on phoenix via your IP 54.145.16.43