Indicator - Thinkscript question... - ThinkOrSwim | futures io social day trading
futures io futures trading


Indicator - Thinkscript question...
Updated: Views / Replies:777 / 2
Created: by netarchitech 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 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
 

Indicator - Thinkscript question...

  #1 (permalink)
Trading Apprentice
NY, NY
 
Futures Experience: Intermediate
Platform: TOS
Favorite Futures: Stocks, ETFs
 
Posts: 33 since Dec 2011
Thanks: 20 given, 6 received

Indicator - Thinkscript question...

I'm having trouble trying to programmatically change a default color setting to the desired custom setting for the
ElderImpulse indicator as highlighted below. I even tried changing the color in the "Edit Properties" GUI interface
with no luck...

Any help/assistance would be greatly appreciated. Thanks in advance...

# Indicator name: ElderImpulse

input length = 13;
input paintBars = yes;

def EMA = ExpAverage(close, length);
def MACD = ExpAverage(close, 12) - ExpAverage(close, 26);
def MACDHist = MACD - ExpAverage(MACD, 9);
def GreenPrice = EMA > EMA[1] and MACDHist > MACDHist[1];
def RedPrice = EMA < EMA[1] and MACDHist < MACDHist[1];

plot Bullish = GreenPrice;
plot Neutral = !GreenPrice and !RedPrice;
plot Bearish = RedPrice;

Bullish.SetDefaultColor(Color.UPTICK);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bullish.SetLineWeight(3);
Bullish.Hide();
Neutral.SetDefaultColor(Color.BLUE);
#Neutral.SetDefaultColor(CreateColor(204, 204, 0));

Neutral.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Neutral.SetLineWeight(3);
Neutral.Hide();
Bearish.SetDefaultColor(Color.DOWNTICK);
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bearish.SetLineWeight(3);
Bearish.Hide();

DefineGlobalColor("Bullish", Color.UPTICK);
DefineGlobalColor("Neutral", Color.BLUE);
#DefineGlobalColor("Neutral", CreateColor(204, 204, 0));

DefineGlobalColor("Bearish", Color.DOWNTICK);

AssignPriceColor(if !paintBars then Color.CURRENT
else
if GreenPrice then GlobalColor("Bullish")
else
if RedPrice then GlobalColor("Bearish")
else GlobalColor("Neutral"));

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

You want to change from Blue to 204,204,0 ?

Reply With Quote
 
  #3 (permalink)
Trading Apprentice
NY, NY
 
Futures Experience: Intermediate
Platform: TOS
Favorite Futures: Stocks, ETFs
 
Posts: 33 since Dec 2011
Thanks: 20 given, 6 received


Thanks for your inquiry, rmejia. The reason why I wanted to change the candles from blue to (204, 204, 0) a/k/a Yellow is because the blue candles were hard to see against the TOS dark blue background...

In any event, I worked it out with a little help from a ThinkScripter. Below are the pertinent old and new code snippets for any/all interested parties to review...

Old code:
 
Code
Bullish.SetDefaultColor(Color.UPTICK);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bullish.SetLineWeight(3);
Bullish.Hide();
Neutral.SetDefaultColor(Color.BLUE);
#Neutral.SetDefaultColor(CreateColor(204, 204, 0));
Neutral.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Neutral.SetLineWeight(3);
Neutral.Hide();
Bearish.SetDefaultColor(Color.DOWNTICK);
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bearish.SetLineWeight(3);
Bearish.Hide();

DefineGlobalColor("Bullish", Color.UPTICK);
DefineGlobalColor("Neutral", Color.BLUE);
#DefineGlobalColor("Neutral", CreateColor(204, 204, 0));
DefineGlobalColor("Bearish", Color.DOWNTICK);

AssignPriceColor(if !paintBars then Color.CURRENT
else
if GreenPrice then GlobalColor("Bullish")
else
if RedPrice then GlobalColor("Bearish")
else GlobalColor("Neutral"));

New Code:
 
Code
Bullish.SetDefaultColor(Color.UPTICK);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bullish.SetLineWeight(3);
Bullish.Hide();
Neutral.SetDefaultColor(CreateColor(204, 204, 0));
Neutral.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Neutral.SetLineWeight(3);
Neutral.Hide();
Bearish.SetDefaultColor(Color.DOWNTICK);
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bearish.SetLineWeight(3);
Bearish.Hide();

# Deleted the unnecessary DefineGlobalColor cruft

AssignPriceColor(if !paintBars then Color.CURRENT 
else 
if GreenPrice then Color.UPTICK 
else 
if RedPrice then Color.DOWNTICK 
else CreateColor(204, 204, 0));

Hope this helps someone in someway...

Wishing you and the futures.io (formerly BMT)F community a very Healthy, Happy and Prosperous New Year


Last edited by netarchitech; December 27th, 2014 at 12:26 PM.
Reply With Quote
The following user says Thank You to netarchitech for this post:

Reply



futures io > > > > Indicator - Thinkscript question...

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
ThinkScript (TOS) Programming Question Curbfeeler ThinkOrSwim Programming 10 March 8th, 2016 04:19 PM
Thinkscript to MT4 question spectra9 ThinkOrSwim Programming 3 January 19th, 2015 08:05 AM
ThinkScript Entry Bar question spreadhead ThinkOrSwim Programming 0 July 19th, 2014 07:13 PM
Thinkscript Volatility Indicator tosmonkey ThinkOrSwim Programming 4 November 29th, 2010 05:29 PM


All times are GMT -4. The time now is 09:51 AM.

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.08 seconds with 19 queries on phoenix via your IP 54.221.76.68