Hi all,
I've been having difficulties getting some Python code running - i.e.: just getting simple History data.
On the other hand, I managed to get the "same" Python code but in C# running without issues.
Does C# have better support than Python at QuantConnect?
What about local development? I'm used to local editors for syntax, compilation checks, etc and I feel that the web IDE is not ideal, at least for me, if you want to get continuity while developing.
Looking forward to hearing about your experiences.
Cheers,
Arthur
ps: See the code snippets below:
class HistorySpike(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2018, 7, 2)
self.SetEndDate(2018, 7, 2)
self.SetCash(25000)
self.AddEquity("SPY", Resolution.Minute)
slices = self.History(TimeSpan.FromDays(5))
if not slices.empty:
bars = slices.loc["SPY"]
close = bars["close"]
self.Log("...")
namespace QuantConnect
{
public class HistorySpike : QCAlgorithm
{
public override void Initialize()
{
SetStartDate(2018, 7, 2);
SetEndDate(2018, 7, 2);
SetCash(25000);
AddEquity("SPY", Resolution.Minute);
IEnumerable<Slice> slices = History(TimeSpan.FromDays(5));
IEnumerable<TradeBar> bars = slices.Get("SPY");
IEnumerable<decimal> decimals = slices.Get("SPY", Field.Close);
double[] doubleArray = decimals.ToDoubleArray();
Log("...");
}
}
}