The opinions expressed in these forums do not represent those of C2, and any discussion of profit/loss
is not indicative of future performance or success.
There is a substantial risk of loss in trading. You should therefore carefully consider
whether such trading is suitable for you in light of your financial condition. You should read,
understand, and consider the Risk Disclosure Statement that is provided by your broker
before you consider trading. Most people who trade lose money.
On Daily data ChartType.Column and ChartType.Bar doesn’t work the same way (on other resolutions they do.)
Sample code:
long systemId = 46106678;
var systemName = (from sys in C2SYSTEMS where sys.SystemId == systemId select sys.SystemName).First();
ITimeSeriesChart timeSeriesChart = new TimeSeriesChart(); timeSeriesChart.Name = systemName;
It happened me too. Several times.
The column chart (ChartTypes.Column) tries to help us and it leads to confusion.
From certain point, depending on selected time range, it starts to think it is better to group data together and show sums instead of details.
Let’s change your code slightly and use two separated graphs:
long systemId = 46106678;
var systemName = (from sys in C2SYSTEMS where sys.SystemId == systemId select sys.SystemName).First();
// Prepare data
ITimeSheet timeSheet = TimeSheetFactory(systemId, TimeInterval.Day, EquityType.Raw | EquityType.MarginUsed );
timeSheet.EquitiesSheet();
var mrgn = timeSheet.GetColumn(systemId, EquityType.MarginUsed);
// Charts
ITimeSeriesChart timeSeriesChart1 = new TimeSeriesChart();
ITimeSeriesChart timeSeriesChart2 = new TimeSeriesChart();
timeSeriesChart1.Name = systemName;
timeSeriesChart2.Name = systemName;
timeSeriesChart1.Add(mrgn, "CMargin", Color.Blue, ChartTypes.Column);
timeSeriesChart2.Add(mrgn, "Margin", Color.Red, ChartTypes.Bar);
CHART = timeSeriesChart1;
HR();
CHART = timeSeriesChart2;
We get following (different) charts showing all data.
Let’s play with Zoom.
Select 1 month:
Voilà - the same pictures!
It works until YTD:
Then, starting from 1 year, the column chart starts to group data to weeks and shows sums per weeks:
Yes, I know. But stocks have margin too? Even if the multiplier is 1, the open positions’ value is the margin, no? Or the assumption / recommendation is that in order to get this type of margin we use the change of equity value between 2 days?