Help changing bar color in script - ThinkOrSwim | futures io social day trading
futures io futures trading

Help changing bar color in script
Updated: Views / Replies:938 / 3
Created: by tozwp Attachments:0

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 100,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

Thread Tools Search this Thread

Help changing bar color in script

  #1 (permalink)
Trading Apprentice
Milwaukee WI/US
Trading Experience: Intermediate
Platform: Multicharts, Tradestation
Favorite Futures: TF
Posts: 7 since Feb 2012
Thanks: 2 given, 1 received

Help changing bar color in script

Trying to change the color of candlestick in TOS based on condition of 3 indicators. I've done it in Easylanguage/Tradestation but having brain freeze trying to script it in TOS. Essentially I'm trying to flip the color from green to red on a change in all three indicators. In Easylanguage it looks like this:

Condition1 = (Indicator1 > value1) and (Indicator2 > value2) and (Indicator3 > value3);
Condition2 = (Indicator1 < value1) and (Indicator2 < value2) and (Indicator3 < value3);
If Condition1 then plotcolor = green;
If Condition2 then plotcolor = red;

In Easylanguage this will start plotting green when condition1 is true and continue to plot green until condition2 is true. Then it will plot red bars until condition1 is true again. I have the script written for the indicators and they work fine. I'm experiencing brain freeze regarding the logic for changing the color of the bars in TOS. Probably pretty easy if someone could point me in the right direction. Probably involves AssignPriceColor but so far I can't seem to create the logical equivalent of the Condition1 and Condition2 from Easylanguage.


Reply With Quote
  #2 (permalink)
Trading Apprentice
Trading Experience: Intermediate
Platform: Thinkorswim
Favorite Futures: Options
Posts: 5 since Jan 2016
Thanks: 0 given, 1 received

def Condition1 = (Indicator1 > value1) and (Indicator2 > value2) and (Indicator3 > value3);
def Condition2 = (Indicator1 < value1) and (Indicator2 < value2) and (Indicator3 < value3);

(if Condition1 then
else if Condition2 then
else Color.CURRENT);

you can use "CreateColor(0,222,0)" instead of "" to create more specific color in RGB

Last edited by jjjann; January 22nd, 2016 at 05:01 AM.
Reply With Quote
  #3 (permalink)
Trading Apprentice
Milwaukee WI/US
Trading Experience: Intermediate
Platform: Multicharts, Tradestation
Favorite Futures: TF
Posts: 7 since Feb 2012
Thanks: 2 given, 1 received


Thank you! My problem was that I was trying to use an IF statement in the def statement like this:

def Condition1 = IF (Indicator1 > value1) and (Indicator2 > value2) and (Indicator3 > value3);

That doesn't work! Trying to think in Easylanguage but trying to write in TOS script causes my brain to short circuit.

Reply With Quote
  #4 (permalink)
Trading Apprentice
Trading Experience: Beginner
Platform: Think Or Swim
Favorite Futures: Equities
Posts: 7 since Feb 2019
Thanks: 0 given, 0 received

Im looking for something similar, I want my candles to turn green when the Slow Stochastic K period crosses over the D period & Red when the K period crosses below the D period.

Reply With Quote


futures io > > > > Help changing bar color in script

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now

60 Minutes to Better Decisions & Better Trades w/Agustin Lebron

Elite only

Live Day Trading the E-MICROS w/Ilan @ Cannon (special time: 12PM ET)

May 30

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing background color in TOS tcooper35 ThinkOrSwim 1 October 16th, 2015 09:02 PM
Color changing candles rsi dwemini NinjaTrader 10 February 21st, 2014 05:38 PM
EMA changing Color Trend Carl7816 EasyLanguage Programming 3 May 9th, 2013 07:16 PM
Stochastics Color Changing wbtrader EasyLanguage Programming 4 August 29th, 2011 12:38 PM
Color changing Regression Line with Paint Bar Gibby NinjaTrader Programming 49 April 23rd, 2010 02:54 PM

easylanguage, indicator, indicators, short, stochastics, think or swim, thinkorswim, tos, tos script, tradestation

All times are GMT -4. The time now is 03:48 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business,
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 2019-05-24 in 0.16 seconds with 14 queries on phoenix