Volume Profile

Hi,


I am trying to plot Volume profile. Something similar to the image in below link =>

https://miro.medium.com/max/3600/0*4MfFQOAjzY5TOP2x


I thought of two options available in SyncChart to achive this in Winform using c#.

  1. Using Trendline Feature
  2. sing Bar Chart

However, I am yet to successfully plot it.

I used a SortedList<decimal, long> to store the Volumes at each price point.

But could not plot those successfully by converting each item in the SortedList into a line and then adding those lines in a Line Series.

Can you please help me to achieve the desired result as shown in the link (either by Line Series / Bar Series / Any other feature) =>


Thanks,

Amit


7 Replies

YP Yuvaraj Palanisamy Syncfusion Team July 25, 2021 02:33 AM UTC

Hi Amitabha, 
 
Greetings from Syncfusion.

We have analyzed your query and provided screenshot, we have achieved your requirement “Candle chart with volume profile” by workaround with the help of ChartDockingControl to add bar chart and position it for 24h worth of Volume based on the price levels.
 
 
Also, we have attached the sample for your reference. Please find the sample from the below link. 
 
  
Output: 
 
 
For more details, please refer the below link. 
 
Regards, 
Yuvaraj. 


AM Amitabha replied to Yuvaraj Palanisamy July 25, 2021 06:45 PM UTC

Hi Yuvaraj,


Thank you for the code. I followed as you suggested and created a sample small project with a set of real data. Attached the project solution for your reference. If you execute the project, you can see below issues with it -


  1. The profile  bars are not plotted as per the volume amount (All are of same length).
  2. The profile location is not proper. Altough the X-Axis start and End shows the month start and end (as expected) the Y-Axis price bar is not where the price is actually located on the plot.
  3. The MaxVol Price stripline is not visible at all.

Not sure what's wrong with it. Request you to please check and help me fixing the issue.


NOTE: To execute click on the show button first and then Scroll Right button to scroll on newer data and scroll left to scroll old days data.




Thanks,

Amitabha


Attachment: VolProfile_SFusion_fe5aa421.zip


YP Yuvaraj Palanisamy Syncfusion Team July 26, 2021 01:03 PM UTC

Hi Amitabha, 
 
We have analyzed your query and sample, in this application using Category axis type instead of DateTime type. Due to this caused by Categoryaxis is an indexed based type and Double and DateTime are value based type axis. We have resolved the issue “Stripline not showing and Volume profile occupies with the one month range” and we have attached the sample for your reference. Please find the sample from the below link. 
 
 
Note: We will fix the profile bars are not plotted as per the volume amount (all are same length) issue and we will update you complete details on or before 27th July 2021.

Could please provide the more details about this “The Volume profile location issue” like where would you like to position in the chart area which is helpful to serve you better solution at the earliest.
 
 
Regards, 
Yuvaraj. 



AM Amitabha replied to Yuvaraj Palanisamy July 26, 2021 03:12 PM UTC

Hi Yuvaraj ,


Thank you for the response. Regarding the " The Volume profile location issue " , please find the details as below -


If you observe the sample data that gets loaded in function Load_Data() ,you will see that after the Candles Are loaded with real life data for Open / High / Low / Close  / Volume, the Volume profiles are loaded for 4 months (Here Also the data is accurate and based on real life data).


**NOTE: Please set the Display_Count = 100  in the code before running the application to get the full view of 3 months for better understanding and getting an image same as attached.

  1. Month 1 - which starts On 1st April 2021 and End On 30th April 2021. The Volume against each price level is the volume computed based on the data loaded in the candles within the period  1st April 2021 and 30th April 2021. The Minimum Price level within this timeframe is 6415 which has a Accumulated Volume Of
  2. 193054 [As you can see in the Load_Data()  function] And Maximum Price Level is 6784.85 which has a accumulated volume of 250081 within the same one month time frame. Same for other price levels as well.

    Now while plotting the Volume profile The Horizontal Bar At 6415  should be placed at Main Chart's Y Axis value of 6415  And similarly the Upper boundary of the volume profile should be placed at 6784.85 of Main Chart's Y Axis value. Also the Extent to which each of the Volume Bars will go on the right should be in proportion of the volume at that price level [ which is expected since the profile is added to an inner chart which I believe will scale separately in accordance with the Volume at each price level ]. However that is not happening as you could see and mentioned also . Maybe some small miss at my end in assigning some parameters of the inner chart Or some issue that may require a fix at your end. Attached an image showing the location of the volume profile.


    2. Month 2 -

    StartDate = new DateTime(2021, 5, 01)

    EndDate = new DateTime(2021, 05, 31);

    Minimum Price level And Corresponding volume at that Prive level =6400 / 208730

    Maximum Price level And Corresponding volume at that Prive level =7086.3 / 179569


    The Volume profile for this time Zone should start at Minimum Price level 6400 And End At 7086.3 Of the Main Chart Control's Y Value [As that plots the price in Y Axis]


Same for Other months as well. Please let me know if you need more clarification. Attached an image below showing the expected location of the profile placement . The expected location is shown in a rectangular Box of Purple color and added remarks over the chart.







Thanks,

Amitabha



YP Yuvaraj Palanisamy Syncfusion Team July 27, 2021 11:47 AM UTC

Hi Amitabha, 
 
Thank you providing the information. 
 
We have achieved your requirement “Volume profile location at the specified range of candle chart & Profile bar rendered based on the different Volume data” by using the displayed candle high and low values in the specified range. Please find the modified sample from the below link 
 
 
Output: 
 
 
Please let us know if you have any concern. 
 
Regards, 
Yuvaraj. 



AM Amitabha July 28, 2021 05:51 AM UTC

Thanks Yuvaraj .

It helped.


Amit




YP Yuvaraj Palanisamy Syncfusion Team July 29, 2021 04:32 AM UTC

Hi Amitabha,

Thank you for your update.
 
 
Please let us know if you have any concern.

 
Regards, 
Yuvaraj.

Loader.
Up arrow icon