Indicator - Thinkscript question... - futures io
futures io futures trading



Indicator - Thinkscript question...


Discussion in ThinkOrSwim

Updated by netarchitech
    1. trending_up 1,597 views
    2. thumb_up 1 thanks given
    3. group 1 followers
    1. forum 2 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Thread Tools Search this Thread
 

Indicator - Thinkscript question...

  #1 (permalink)
NY, NY
 
 
Posts: 67 since Dec 2011
Thanks: 27 given, 19 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

Can you help answer these questions
from other members on futures io?
Convert NinjaTrader NT7 indicator to Tradestation EasyLanguage and RADARSCREEN
Platforms and Indicators
Issue meeting order entry conditions
Elite Automated NinjaTrader Trading
Last 5 minutes Label
ThinkOrSwim
Moving average with Lag reduction
NinjaTrader
Linux?
ThinkOrSwim
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Spoo-nalysis ES e-mini futures S&P 500
60 thanks
FIO Journal Challenge - June 2020 edition w/SharkIndicators
59 thanks
June Charity Fundraiser - Feeding hungry families
51 thanks
Fixed vs trailing stops
28 thanks
AMP Futures / AMP Global Review
27 thanks
 
  #2 (permalink)
Puerto Rico
 
Experience: Intermediate
Platform: thinkorswim
Broker: TD Ameritrade
Trading: ES
 
rmejia's Avatar
 
Posts: 377 since Oct 2010
Thanks: 3,600 given, 431 received

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

Reply With Quote
 
  #3 (permalink)
NY, NY
 
 
Posts: 67 since Dec 2011
Thanks: 27 given, 19 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 11:26 AM.
Reply With Quote
The following user says Thank You to netarchitech for this post:



futures io Trading Community Platforms and Indicators ThinkOrSwim > Indicator - Thinkscript question...




Upcoming Webinars and Events
 

Free BloodHound Licenses for everyone!

June
 

Every journal equals ten meals for the hungry

June
     



Copyright © 2020 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