Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I have been trying to figure out a way to have a range (“Range in Ticks - Standard") chart bar plotted with different color every time there is one trade above a certain number of contracts.
I tried to get this done using the “Time & Sales Study” to identify the big volume trades and a “Color Bar Based on Alert Condition Study” with a simple alert (=ID13.SG1>1000) indexed to the “T&S Study”, but I couldn't make it work.
Among the attempts to figure it out I found that it works fine if I use a “Number Of Trades Per Bar” chart set to 1 (one bar for each trade) instead the “Range in Ticks” chart but of course that's not what I need.
I think that the problem is that I wasn't able to find a way to correctly use the “T&S Study” data (which is based on time) and the “Color Bar Based on Alert Condition Study” to plot the alert signal in the Range chart (which is based on range).
How can I do this?
Any help or guidance would be much appreciated.
Thanks.
Can you help answer these questions from other members on NexusFi?
Not entirely sure what you want to do, but if you simply want to change the bar color if a single trade within that bar is greater than n contracts, you can simply monitor the size of trades in OnBarUpDate and then use BarColor = Color.Whatever to change the color. It doesn't matter what type of bar it is.
1) Add another chart to your chartbook.
-Set the Bar Period to Number Of Trades Per Bar and value to 1.
-Set the Days to Display/Load to 3, or a small number.
-Add the Volume study
2) Add the Study/Price Overlay study to the range chart
-Set the Study to Overlay to the Number Of Trades chart and the Volume study.
-Check Hide Study
3) Add the Spreadsheet Study study to the range chart
-Set the Chart Region to 1
-Give it a name in the Spreadsheet Name field
-Set the Number of Rows to 10
-Set the Draw Style of SG1 to Color Bar
-Set the color
-On the spreadsheet, put this in cell K3: =IF(ROW()=3,AA3>10,0)
This assumes the Overlay study is in column AA; edit as needed.
Edit the value >10 to your volume threshold of each trade.
This will flash the current bar the chosen color every time a trade exceeds the specified volume.
I followed your instructions step by step and apart from a minor fault in the formula (I had to use ; instead of ,) it worked perfectly. You really are an expert in SC.
Unfortunately, that is not what I need, as the candle flashes but doesn’t keep the alert color. And this method revealed to be very CPU intensive, which I really need to avoid.
As I mentioned in my previous post for futuretrader, what I really need is just to change the bar color if a single trade within that bar is greater than n contracts.
Do you have any other suggestion to do it, not forgetting the fact that I need to keep it as simple and low CPU intensive as possible?
There is a way to do this with the Spreadsheet Study study, but it has 2 limitations that render it unusable:
1) It requires the use of the max number of spreadsheet rows (100000) and this will cause high CPU usage.
2) Even with 100000 rows (100000 bars of the 1 tick chart), the historical color bars on the range chart only go back about 50 bars or so, depending on the size of the range bar.
As far as I know, there is no way to do what you want, except possibly a custom ACSIL study.
Now that I posted, I see that @ejtrader came to the rescue.