NexusFi: Find Your Edge


Home Menu

 





Custom color price bars based on lower indicators


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one WorstTraderEver with 5 posts (0 thanks)
    2. looks_two rmejia with 2 posts (2 thanks)
    3. looks_3 ttibsen with 2 posts (0 thanks)
    4. looks_4 cory with 1 posts (1 thanks)
    1. trending_up 9,267 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 10 posts
    2. attach_file 2 attachments




 
Search this Thread

Custom color price bars based on lower indicators

  #1 (permalink)
WorstTraderEver
Worcester Ma
 
Posts: 5 since Jan 2015
Thanks Given: 4
Thanks Received: 0

Does anyone know how customize the color of a price bar based on lower indicators (e.g. If the MACD is above the zero line and the signal then paint the price bar green).

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - May 2024
Feedback and Announcements
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
41 thanks
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #2 (permalink)
 
rmejia's Avatar
 rmejia 
Puerto Rico
 
Experience: Intermediate
Platform: thinkorswim
Broker: TD Ameritrade
Trading: Options
Posts: 379 since Oct 2010
Thanks Given: 3,614
Thanks Received: 441

It is done using "AssignPriceColor". Here is an example:

I turn it on or off using this input:
input PaintBars = No;

Then for the MACD this example changes color based on the histogram:
assignPriceColor (if !PaintBars then Color.CURRENT else if Diff >= 0 then if Diff > Diff[1] then Diff.color("Positive and Up") else Diff.color("Positive and Down") else if Diff < Diff[1] then Diff.color("Negative and Down") else Diff.color("Negative and Up"));

Attached Thumbnails
Click image for larger version

Name:	MACD.png
Views:	566
Size:	126.0 KB
ID:	171445  
Reply With Quote
Thanked by:
  #3 (permalink)
ttibsen
Whitehorse Yukon Canada
 
Posts: 7 since Jan 2015
Thanks Given: 0
Thanks Received: 0


I must confess that I am astounded by the technical aspect of questions such as these.

<< If the MACD is above the zero line and the signal then paint the price bar green >>

The question - which I freely admit that I do not understand in the least - delves into
a degree of intricacy which I have to question. Does knowing all this minutiae really
give you any edge at all over establishing your position based on a perceived trend,
placing a protective stop and then hoping things go as you though they would? I am
new to the T or S platform and so far I love it just for the robust order set they give
you. It's hard to find any online broker that gives you the same order set. But I have
to look at the technical analyses with a jaundiced eye and I have to wonder whether
all these studies and indicators are worth the time.

Reply With Quote
  #4 (permalink)
WorstTraderEver
Worcester Ma
 
Posts: 5 since Jan 2015
Thanks Given: 4
Thanks Received: 0


ttibsen View Post
I must confess that I am astounded by the technical aspect of questions such as these.

<< If the MACD is above the zero line and the signal then paint the price bar green >>

The question - which I freely admit that I do not understand in the least - delves into
a degree of intricacy which I have to question. Does knowing all this minutiae really
give you any edge at all over establishing your position based on a perceived trend,
placing a protective stop and then hoping things go as you though they would? I am
new to the T or S platform and so far I love it just for the robust order set they give
you. It's hard to find any online broker that gives you the same order set. But I have
to look at the technical analyses with a jaundiced eye and I have to wonder whether
all these studies and indicators are worth the time.

It's just an easier way to visualize when the MACD is above the zero line and the signal line on the upper chart. That's it. It's not used solely for an entry or exit strategy. For me this minutiae is very important because it allows me to make decisions faster which is critical for my trading style. I hope this helps you to understand the technical aspect of questions such as these.

Reply With Quote
  #5 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


ttibsen View Post
... I have to question. Does knowing all this minutiae really
give you any edge at all ...

no but if you stare at a chart all day may as well make it look nice.

Reply With Quote
Thanked by:
  #6 (permalink)
WorstTraderEver
Worcester Ma
 
Posts: 5 since Jan 2015
Thanks Given: 4
Thanks Received: 0

It's subtle jabs like this that discourage newer people from posting to forums like this. Thanks a lot for the warm welcome guys! I'm sure Big Mike would be proud!

Reply With Quote
  #7 (permalink)
WorstTraderEver
Worcester Ma
 
Posts: 5 since Jan 2015
Thanks Given: 4
Thanks Received: 0


stockdisk View Post
hi i have this indicator (using on Ninja 7 beta 22)which paints bar with relationship of MACD with Avg and zero line .If macd is above BOTH zero line & avg ,it paints the chart bars as green bars ,if MACD is below BOTH zero line & avg ,it paints the chart bars as Red bars ,otherwise white bars.

if some body modify the code so that when histogram is below zero line it plot red above zero its plot green.

will apprrciate
thanks

This is what I am really looking for, but for ThinkOrSwim instead of Ninja Trader. If i phrased something wrong when I started the thread this should hopefully clear it up.

Thanks to anyone willing to help me out

Reply With Quote
  #8 (permalink)
ttibsen
Whitehorse Yukon Canada
 
Posts: 7 since Jan 2015
Thanks Given: 0
Thanks Received: 0

Thanks for clarifying that but I have to tell you that I am dubious as to the value of all this stuff. It would seem to me that you need a Ph.D. in math to utilize it successfully and even then I'm not sure that it makes a significant difference.

Reply With Quote
  #9 (permalink)
 
rmejia's Avatar
 rmejia 
Puerto Rico
 
Experience: Intermediate
Platform: thinkorswim
Broker: TD Ameritrade
Trading: Options
Posts: 379 since Oct 2010
Thanks Given: 3,614
Thanks Received: 441


WorstTraderEver View Post
This is what I am really looking for, but for ThinkOrSwim instead of Ninja Trader. If i phrased something wrong when I started the thread this should hopefully clear it up.

Thanks to anyone willing to help me out

If I understood right the first part of the quote :



This is the addition to the end of the stock MACD study:

input PaintBars = Yes;

assignPriceColor (if !PaintBars then Color.CURRENT else if Value >= 0 and Value > Avg[1] then color.Green else if Value <=0 and Value < Avg[1] then color.Red else color.White);


Value is the MACD line, so if the value is above zero, and the value is above the avg then green; and the inverse for red, else white.

Here is all of the code:

 
Code
declare lower;

input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;

plot Value = MovingAverage(averageType, close, fastLength) - MovingAverage(averageType, close, slowLength);
plot Avg = MovingAverage(averageType, Value, MACDLength);

plot Diff = Value - Avg;
plot ZeroLine = 0;

Value.SetDefaultColor(GetColor(1));
Avg.SetDefaultColor(GetColor(8));
Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);
Diff.DefineColor("Positive and Up", Color.GREEN);
Diff.DefineColor("Positive and Down", Color.DARK_GREEN);
Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.DARK_RED);
Diff.AssignValueColor(if Diff >= 0 then if Diff > Diff[1] then Diff.Color("Positive and Up") else Diff.Color("Positive and Down") else if Diff < Diff[1] then Diff.Color("Negative and Down") else Diff.Color("Negative and Up"));
ZeroLine.SetDefaultColor(GetColor(0));


input PaintBars = Yes;

assignPriceColor (if !PaintBars then Color.CURRENT else if Value >= 0 and Value > Avg[1] then color.Green else if Value <=0 and Value < Avg[1] then color.Red else color.White);

Reply With Quote
Thanked by:
  #10 (permalink)
WorstTraderEver
Worcester Ma
 
Posts: 5 since Jan 2015
Thanks Given: 4
Thanks Received: 0



ttibsen View Post
Thanks for clarifying that but I have to tell you that I am dubious as to the value of all this stuff. It would seem to me that you need a Ph.D. in math to utilize it successfully and even then I'm not sure that it makes a significant difference.

It may not help others, but it certainly will help me. Best of luck!

Reply With Quote




Last Updated on February 9, 2019


© 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