Candle sticks


Category:
0
0

Is it possible to ONLY SHOW candles that moved 4% or more up or down? Thank you

Marked as spam
Posted by (Questions: 34, Answers: 56)
Asked on February 18, 2017 7:29 am
116 views
0

Hmmm. Trying to make sure I picture this correctly. So you want to make every single candle on the chart to disappear, leaving only the candles that moved 4%? If so, you would then have a large amount of blank space on the chart, gaps between the 4% movers would still contain the price candles that didn’t move 4%. They would simply be colored the same as the chart background. Is this what you are asking?

( at February 18, 2017 9:23 am)
0

Yes sir

( at February 18, 2017 7:46 pm)
0
Private answer

If we base the 4% change on close of the current bar compared to close of the previous bar. We have something like this:

def prctChange = AbsValue(close - close[1]) / close[1];
def fourPercentChange = prctChange >= 0.04;
AssignPriceColor(if fourPercentChange then Color.CURRENT else Color.BLACK);

Assumes the chart background color is black.

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on February 18, 2017 8:58 pm
0

Pete Hahn, I have this code… When the candle is 5% or more it turns black. How can I make is so that if the candle is 20% or more it turns light blue? So, here’s an overview of the code. If the candle is over 5% it turns black. How can I make it so when the candle is over 20% it turns light blue? If the candle is less than 5% it stays regular. What do I need to add to my current code?

def prctChange = AbsValue(close – close[1]) / close[1];
def fivePercentChange = prctChange >= 0.05;
AssignPriceColor(if fivePercentChange then Color.BLACK else Color.CURRENT);

( at February 20, 2017 5:32 pm)
0

I must be getting tired. I had to read that about six times before I understood. (maybe I don’t) So here goes. You want all candles less than 5% change to be normal color. You want candles greater than or equal to 5% and less than to 20% to be black. And you want candles greater than or equal to 20% to be blue, yes?
If that is case:
def prctChange = AbsValue(close – close[1]) / close[1];
def blackCandles = prctChange >= 0.05 and prctChange < 0.2; def blueCandles = prctChange >= 0.2;
AssignPriceColor(if blueCandles then Color.BLUE else if blackCandles then Color.BLACK else Color.CURRENT);

( at February 20, 2017 6:00 pm)
0
Private answer

Yes, you understand what I am looking for. However, there is an error in the code.

 

 

Attachments:
Marked as spam
Posted by (Questions: 34, Answers: 56)
Answered on February 20, 2017 7:27 pm
0

I fixed, it nevermind! ?

( at February 20, 2017 7:28 pm)
0

Yep, got it. Corrected the error in my reply.

( at February 20, 2017 9:45 pm)