Back

Live Mode Questions

Hi All,
I have a question about live mode.

Let's say my algo uses SMA("SPY", 100, Daily) and is going live today?
Do I have to wait 100 days until the algo accumulates SMA or it will be immediately available (IsReady==true) from today ?

Thanks
Nik
Update Backtest






The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.



It will be ready from today.

It uses previous data to calculate the indicators.

Kind regards
Jacques Joubert
0

It will actually take 100 days :) We're aware this isn't great, so are making a "warm up" system which will run it with backtest data first. This is next on the todo list - Mike is typing away loudly here in the office so it won't be long.
2

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


I'm having trouble wrapping my pea size brain around how all of this algorithmic stuff works in real life. Somebody help me out here!

1. When you kick an algo off live (real money or paper), does it run automatically everyday or do I have to jump start it when the big bell rings in New York every morning and tell it to go to sleep when the New Yorkers go home?

2. Assuming the answer to (1.) is "automatic", which I suspect, when it goes to sleep each afternoon does it "forget" everything it did that day and start fresh every morning? Which leads me into question -

3. Concerning the "warm up" routine which is now out, (and is great by the way; thank you Michael, and Jared and anyone else that made it happen)! I can see it's benefit for a backtest which is a one-time, stand alone run. The warm up gets the backtest ready to start at the opening bell. But in live mode, after the indicators are "ready", they update with each new bar all day. When a new day starts does it not remember the updates it did yesterday? If so, then I can see the need for warming up every day, but isn't that kind of like reinventing the wheel every day? If you "gotta", then you "just gotta", but ...

I'm sure I'll have a few more questions about going live, but I'm not there yet and I don't want to overtax my pea size brain too much :) I'll ponder the answers to these questions awhile and see where that leads me. Thanks in advance for everybody's help!
0

Hey @Oran! This stuff is hard you're not pea sized so don't worry! 1) Yes its 100% automatic.

2,3) Backtesting and live trading work seamlessly. Just like in a backtest when the market closes it spins overnight till the next morning. All state is remembered, so if you've warmed up your indicators they will still be warmed up the next morning.

Nothing special happens at the end of each day. Its just like a backtest, one moment the data point is 3.59pm, the next moment [from your algorithms' point of view] the data point is 9.30am. It actually doesn't "sleep" it just waits for a valid data point in market hours.
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Thanks Jared, this stuff is hard, but I'm too stubborn to give in. I'll get there - if I live long enough :)

I love the warming up for backtest, and I could see a benefit if your algo used a 100 day (or maybe even longer) indicator, but is it worth it for a short term (20 or 30 minute) indicator? Give it 30 minutes the first day and never worry about it again. I'm still trying to get all of this looping stuff straight in my mind. If you put the warm up routine in the algo and it uses it when you first fire it off, does it not "warm up" again during the next loop? If you are using minute resolution, would that not weigh down the algo? I want to keep it as simple as possible so that it runs as fast as possible. It is easy to bloat a program!
0

Please post example code of how you plan to warm up your algorithm, we'd be happy to suggest efficient ways to do it. If you do the warm up in the initialize and it will only happen once when the algorithm loads (once per backtest/live deployment).
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


I don't have a code example yet. Let me work on that and I'll get back to you :)

So you put it here and it runs once, but if you put it there it runs every loop? Like I said, this looping stuff is killing me!
0


public class BasicTemplateAlgorithm : QCAlgorithm
{
public override void Initialize()
{
//Run Once
}

public void OnData(TradeBars data)
{
//Run every data point -- "on each data point - on data"
}
}


You could setup a scheduled event if you like? This will run some code whenever you'd like it to run. To do this see the scheduled events examples here: https://github.com/QuantConnect/Lean/blob/master/Algorithm.CSharp/ScheduledEventsAlgorithm.cs#L35
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Thanks Jared, that helped (I think - but I need to play around with it to be sure it is saying what I think it is saying).

Also thanks for the link on scheduled events. Michael suggested that in another post, but I never figured out how to make it work. More studying.............
0

A couple more questions I need help with please. When you kick an algorithm off live, paper or real money, it floats around in the cloud on QC's servers, right? Even if I turn my computer off and take my bride to Paris for our 50th anniversary (just kidding - more likely she will have killed me by then:) the algo still runs as if my computer was still on, with me staring at it. Is that right?

Can you run more than one algorithm at a time, using the same broker, but with different account numbers. For example a long and short algo on a margin account, and 2 long only algos trading my IRA account and my wife's IRA account. I ask this because another company I was looking at before I came to QC had a problem with multiple accounts. It had to do with me running everything from the same IP address or something like that; way beyond my level of geekness! But if everything is floating around in a cloud somewhere this side of Heaven, does it really matter? Is there a limit, real or practical, to how many different accounts you can run one of these things on?

Assuming you can run multiple accounts, is it all included in the regular subscription, or does it cost $XX for each algo taking up space in QC's servers?

Basic questions for you long timers, but unanswered for us new guys. Thanks for your insight.
0

> Your algorithm continues to run when you sign out of QuantConnect. Its running on a separate dedicated server and what you are seeing is just the result view.

> You can run more than 1 algorithm at a time if using more than 1 account number since we're running on separate servers, with separate IP addresses.

> A subscription comes with 1 free live trading server. Each additional live trading server after that is $10/mo. This gives you 1 CPU, 20GB Disk and 512MB RAM to play with.
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hi,
@Jared, regarding your last answer - 1 server means I can only paper trade 1 alg at any given time? or can I run several live paper trades on the same dedicated server?

and another question, if I download the code and compile it on my computer, can I do live paper trade from my computer? I am just starting out, and would like to avoid costs during my learning period. I know I could backtest for free, but is there a way to live trade for free as well?

*so far your system looks amazing!
Thank you!
0

You can run as many servers as you like in parallel,

Yes can definitely live trade from your computer! LEAN works identically locally and on the cloud. The only part you'll need to write locally is a live data connection and to use one of our supported brokerages.
0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


I'm talking way over my head now as I am only beginning to wrap my head around how all of this live stuff works, so if I am way off base here, someone feel free to slap me down and tell me to hush! Just explain how far out in left field I am, please.

@Shlomi, If I am understanding your post, you want to load LEAN onto your local computer and paper trade multiple algos simultaneously from your computer. Am I right? That might work if your paper (or real money) accounts are with different brokers but, and again, somebody correct me if I am wrong, I have been told that can't be done because your computer only has one IP address. Now, I don't pretend to understand that completely, and maybe he didn't say exactly what I heard :( So, if you are successful at doing what I think you are trying to do, please post back because I would like to know as well. I suppose you could pull multiple internet services into your house, connect separate computers to each service and load your different algos on the different computers. That might work, but it will cost you a lot more than $10 per month for each algo.

To me, that is one of the advantages of running algos in QC's cloud, you can run multiple algos on multiple accounts simultaneously. Granted, it costs $10 for each algo after the first, but it can be done. The other advantage is that if you lose power or internet service at home, your algos keep running.

Somebody tell me I am right, or explain why I am wrong, please.
0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed