Back

Few questions

1. What time is used in list of trades? And maybe there is easier way to export trade data along with instrument data? Actually I need this because I need to look more precisely where exactly system opens and closes trades.

2. What dll file should be uploaded [Project_Name]\QuantConnect.Algorithm\bin\Debug\QuantConnect.Algorithm.dll?
Update Backtest








Hey Tadas,
1) Good catch there's a small bug in the javascript display of dates, we'll add that to the list for this Saturday (tomorrow). Each browser displays JS in the local format and its tricky to detect. If you click on "Download Trades" the CSV has the accurate market EST time that the backend has used.

2) Yes that is the DLL -- the DLL upload and GIT system are tightly linked and the GIT system is down for maintenance until Monday. ( https://www.quantconnect.com/forum/discussion/280/git-api-down-temporarily ).

Would you rather upload the DLL via GIT or manually through a form on the website?

We unfortunately can't allow download of instrument data because of NYSE/NASDAQ restrictions. You can use the QC plotting to look closely at the trades-instruments but its capped to 4000 samples because of physical browser limitations.
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'll use browser upload as using git with windows is cumbersome. More questions:

3. Is there Bid/Ask data? Because sometimes backtests can catch false profits because of spread.

4. Do backtest chart shows equity values or balance values or both?

Will be more :-)
0

3. We only have Trade data (again data provider and cost restrictions). If using longer bars (minute etc) it doesn't matter much. If using shorter periods we've given you ways to write your own slippage model and transaction fee to model the spread how you'd like.

4. Equity :) Its the same as Portfolio.TotalPortfolioValue (Cash + Unrealized); Here is the relevant github code.

We'll see about uploading DLL's via browser this weekend.
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.


OK, thanks :)
0

And an idea:

Along with backtesting terminal you can make market/exchange where users (more exactly, traders, strategists and programmers) can buy/sell algorithms/codes or enter into three-way agreements (same as exchange, but bartering in exchange for % profits). Why it can be useful? Because traders, strategists and programmers does not always share same head and [like in Jane Street,...] they work in teams. I often see programmers who do not have ideas and strategists who don't have enough programming skills or both who don't have understanding of reality of the REAL trading.
1

5. Stock market data includes only market hours? No outside market hours data?

6. How to more easily distinguish between longs and shorts? Because close of long is short. This applies to trades CSV and stockplot chart in backtester. I still can debug orders as longs and shorts, but outside of the chart it's hard :)
0

5. We do have pre/post market data but its not included by default, if you'd like it just include the request: AddSecurity(SecurityType, symbol, Resolution, fillDataForward = true, int leverage = 1, extendedMarketHours = false); Here in the documentation: https://www.quantconnect.com/docs/API#3.2.2

6. If your Portfolio["IBM"].Quantity is negative then you are short. Portfolio["IBM"].IsLong, IsShort bool also exist which just check if we're negative or positive holdings. But at the moment there's no visible distinguishing what each order is doing (closing or opening positions).

Market Idea - Thanks its a cool idea. We've been toying with something similar for a while. We definitely agree people work in teams so made the GIT API for that. Perhaps to kick off we could make a new discussion category on the forums - "Market Place" so people could share what they're looking for etc. Its definitely worth an experiment.
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.


Thank you, Jared,, funny I've reread API docs yesterday and seem forgot about extended hours data :D

One technical guidance question. If I need to get data of previous X bars, what's best solution? If using in backtest it can crash system. Currently bars are limited with Bar Constructor class, but still...
0

Its a tricky one, because we have high resolution data saving bars quickly adds up in memory. I think best way would be saving a list of doubles (value types) which won't clog up the garbage collector. You could grow this list of doubles, one per closing value of the bars.

A History() API is on my list to do after live trading, for now you could request a little longer period and save the results.
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.


7. Portfolio[symbol].LastTradeProfit gives 0? Can't udnerstand why. It is used in Debug() after liquidation.

8. How to properly (in one sentence, if possible) get value of SMA/EMA (using SMA class) at previous bar? Price of previous bar?
0

7. Good catch sorry it wasn't getting updated. Fixed & redeployed live.

8. The SMA of the *previous* bar is accessible in smaClass.SMA before you update it with AddSample(). After adding the new sample it will be the new value. Two sentences, almost :)
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.


Great, thank you!
0

9. Had a bit of time to analyze orders on market open and found big problem that tick data is consolidated from various exchanges/dark pools. That includes unrealistic to achieve outliers, and will inflate backtests for strategies that open orders at market open. Solution is primary exchange data feed, but don't think it's cheap.
0

Thanks for feedback, we do have data from primary exchanges -- it includes *everything* but after Pravin's algorithm captured the illiquid spikes we've been slowly filtering out and re-uploading the data library to omit those QuantQuote deems as "suspicious". Its several terabytes so it takes a very long time to process. This won't exclude everything as the market does have these 1-second spikes and dips sometimes.
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.


OK, thank you. One more :) When aprox. do you plan to start offering live trading?
0

Don't quote me on this but we're pushing now to have beta testers by 1st October with Tradier Brokerage :) If you've got a strategy ready you're welcome to be a beta tester.
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.


Seems that Tradier accepts only U.S. permanent residents/citizens and no companies. A bit of a problem :)
0

No worries we will add Interative Brokers soon - we just need to get the rest of the live trading product launched. The brokerage plugins are only 10% of the work; we also have a new UX we'll unveil and dedicated, long-running servers for executing the algorithms streaming live market data back to your iPad friendly UX :)
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.


PS. If you have a specific broker you'd like us to support, and wouldn't mind coding the connection please get in touch (jared@quantconnect.com). I'll send through the interfaces to implement and we could support that brokerage faster.
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.


10. Data filter does not work with second data. I;m getting backtest error "there were no tradeable days in the period selected".

11. What changes were made to transaction model? Hope I'll understand :D
0

12. May be a bit early, but in trading, which data will be used to trigger signal? Broker's or QC's?
0

Hey Tadas!
10 - I'll look into it today, normally that no tradeable days error means there are no days between SetStartDate and SetEndDate (start > end).

11 - Sorry we did update the transaction model, but I hadn't updated Github yet -- I've posted it online now and here is a link to the latest template fill-model. The key difference is now we have "OrderEvent" type which allows you to model partial fills. We've made all the models assume complete order fills but live trading required partial trade fills :)

12 - We will use the brokerage data; live feeds from the exchanges are too expensive at the moment. In the long run I'd like to have our own consistent source and we have written the code for that, but its too expensive to deploy for now.

For your interest Tradier do allow company accounts, their main requirement is that it needs to be registered in the USA. The review each company request individually. You can contact them on service@tradierbrokerage.com
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.


OK, big thanks for your efforts.

On 10, tried again and seems it works fine with same olf data range, don't know what it was. Also, Visual Studio with QC plugin crashes sending backtests and some other issues there too (not updating files or overwriting new ones to old in website, but I'm not sure, just some strange behavior).

On 12 it's good to know.
0

Pleasure Tadas, I do this for fun! :) Apologies for the plugin, it is a super beta. We wrote it as more of a hack demonstration of the API. It can only replace all the files in a project at the moment but you're right we should only replace older files. If you think the plugin has potential I'd really welcome your help - its all open sourced.
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.


Ah, no problems for me at all as I'm doing this also as I love that :)

I'd glad to help, but programming for me is hardest thing in my life. Often seems I can't do simplest things :) But, I'll see. Think others also should notice it ;)
0

13. How do I use tick filtering in data filter? As, for example:

Tick dt = new Tick();
dt.Quantity == 100


don't seem to have any influence.
0

13. Sorry about that it wasn't behaving as expected so I traced it through and there was a bug. I've attached a backtest with example of how the tick filter should work. I'll update the backend-engine later today with the patch and ping this thread. The filter below limits to ticks from NYSE ARCA exchange -- where the SPY is listed.
1

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.


Thought it's simpler to implement. Mhm, cool, big thanks! :)
0

And if used resolution is second (minute), not tick? Construct new "trade bars" from filtered ticks or there is better way?
0

Correct to get filtered second bars you'd need to build them. Each time the OnData(tick) method is called it is 1 second of ticks, so you can build the (Ticks - Dictionary>) into a TradeBar and call the OnData(TradeBar) directly. Tick by their nature cannot fill forward like bars though.
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.


My knowledge and understanding aren't enough here, would be great if you post an example.


public override void OnTick(Dictionary> data)
{
OnTradeBar(data[symbol][ticks[symbol].Count - 1]);
}


gives cannot convert to TradeBar error.
0

No problem -- I adapted Gustavo's consolidator in the Code Snippet library on the left. It now consolidates a string-list of ticks into a string-tradebars list.

See Consolidator.cs for the joiner code, and the Main.cs for how its used.
1

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.


Filter is up and running - sorry about the delay. The code above now only returns "P" tick's from the ARCA exchange! Cool!
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.


Great, let's see what can be done with it :)

P.S. There is some problem with backtesting as after message "sent to cloud" they just sit in the queue.
0

Sorry about that I see them. We pushed a new build on the weekend with a few too many changes, I'm debugging now..
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.


Fixed, the bug was when a filter was so strict no ticks/bars passed for a day it caused the data readers to crash. Its fixed in engine now to just skip the day. For your code you probably want to make sure the filter doesn't have a bug.
1

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.


OK, scripts are not giving any errors, the only change made is override added to OnEndOfDay() since it worked, so I wrote some log at each step, on every tick, on every bar, trade, etc. Now errors are:

1) 2014-10-14T09:48:28-04:00 We could not find the requested data. This may be an invalid data request, failed download of custom data, or a public holiday. Skipping date (10/6/2014).
same for 7-10 and 13 days, used start date is 9/1 though

2) Log file URL gives AccessDenied (XML)
0

Yeah I saw those errors -- its just the data hasn't been processed up to today yet, there's a little backlog in the tick updaters for the last week. It'll catch up later today,

The XML error is probably just copying and pasting the log URL incorrectly. I'll try and make this a link on the weekend :)
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.


All console URL's are now clickable links -
1

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.


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