@BobSvan2 I would like to make a scatter chart putting in X the Share Ratio of the systems and on Y the Number of Days since live.
I found this code for scatter chart. How can I change X and Y below to have the intended result?
X = gr.Key, // Fees
Y = gr.Count() // Systems count
CODE:
var xydata = from syst in C2SYSTEMS
where syst.MonthlyFee > 0 && syst.MonthlyFee <= 2000
group syst by syst.MonthlyFee into gr
select new XYData() {
X = gr.Key, // Fees
Y = gr.Count() // Systems count
};
SCATTERCHART = ScatterChart.Create(
“A number of trading systems by fees”,
“C2Data”,
xydata,
“Fees”,
“Systems count”);
HR();
TEXT = “Used [X;Y] data:”;
TABLE = xydata;
Hello!
Try this code:
// How to obtain statistics + system data:
var sharpe_and_days_data =
(from syst in C2SYSTEMS
join statistics in C2STATS
on syst.SystemId equals statistics.SystemId
where statistics.StatName == "jSharpe"
// try to filter out extremes:
// where statistics.StatValueVal >= -2.0M && statistics.StatValueVal <= 2.0M
select new {
Id = syst.SystemId,
Name = syst.SystemName,
Days = Math.Round((DateTime.Now - syst.Started).TotalDays,0),
Sharpe = Math.Round(statistics.StatValueVal,2)
}).ToArray();
// Prepare data for ScatterChart:
var scatter_data = from item in sharpe_and_days_data
select new XYData() {
X = item.Sharpe,
Y = (decimal)item.Days };
// Show a graph:
CHART = ScatterChart.Create(
"Sharpe vs Number of Days since live.",
"C2Data",
scatter_data,
"Sharpe",
"Days");
HR();
// Show data we have:
TEXT = "Used data";
TABLE = sharpe_and_days_data;
This is a result:
Apparently, it needs further cleaning.
This is a picture with this filter active (commented out in the above code):
where statistics.StatValueVal >= -2.0M && statistics.StatValueVal <= 2.0M
It seems we need another cleaning yet…