How to get high volume trades visual alert plotted on a range chart?
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).
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.
The following user says Thank You to futuretrader for this post:
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.
The following 3 users say Thank You to tomgilb for this post:
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.
Last edited by tomgilb; February 5th, 2013 at 02:56 PM.
The following user says Thank You to tomgilb for this post: