Setting Background Colors
Author: Tobey
Creation Date: 2/23/2012 10:12 AM
profile picture

Tobey

#1
Hi Cone & Eugene,

I'd like to highlight the bars that give the signals in James Altucher's 3x2 system. I saw Dion do something like this at the New York Money Show. But he's fast like a magician!

Here is the best I've done. It changes the background colors for all the 3 bars down and 2 bars up, not just the ones that are being traded. Can it be coded to only change the background color where the strategy makes a trade?

Thanks for the help!
Tobey

CODE:
Please log in to see this code.
profile picture

Eugene

#2
CODE:
Please log in to see this code.
profile picture

Cone

#3
First tip: Install the Community Chart Styles Add in extension. Then you can pick the Thick Bar Chart Style and in its Chart Style Settings (right click the chart) select close-to-close coloring to more easily visualize when there are consecutive down and up bars.

Here´s the 3x2 system with your idea of background coloring -
CODE:
Please log in to see this code.


profile picture

Cone

#4
Eugene, I think the idea is to color the background for all of the bars in the pattern, not just when the pattern is detected.
profile picture

Tobey

#5
Hi Cone & Eugene,

What I was hoping to be able to do is highlight just the bars that created the trades. If that is possible what you would see is just 3 down bars with a red background followed by the bar with the buy triangle. Then when the trade closed you would see a green background on the two up bars that caused the sell order triangle. If you only see the background change around the trades it would be a quick way to find the the trades and see what else was happening during the life of the trade.

The current code is highlighting more that just the bars involved in the trades.

Is it possible to only color the background around the buy and sell signals? Or is there a better way to visually highlight what the system is doing?

Thanks Again for all the help.
Tobey
profile picture

Eugene

#6
Got it, thanks for clarifying. Just the bars where the actual trades were taken --
CODE:
Please log in to see this code.
profile picture

Cone

#7
Whoops, my mistake.. I looked at what Tobey was trying to do with the code instead of what was actually requested!
profile picture

Tobey

#8
Hey Cone & Eugene,

Works like a charm! And it only took two tries, if you don't count my 22 tries before the post.

Thanks so much!
Tobey
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).