Hello,
I've coded a monthly short strangle on the S&P500, however I'm having a hard time understanding how are options assignments computed.
By looking at the "trades" tab, it appears that all options that are "against me" (strike value < underlying value on calls, the opposite on puts) are assigned at expiration.
I would like options to be assigned at the worst possible case scenario. For example, if I sell a monthly call with strike 100, and during the month the underlying goes from 100 to 110 and goes back to 105 when the option expire, I'd like the backtester to assume that the option gets assigned when the underlying is at 110, not 105.
Is this possible?
Thanks a lot!
Jing Wu
Hi Joseph, if you don't liquidate the contract, the algorithm will hold the contract until it expires. If you want to liquidate the position before it expires, you should save the contract symbol and compare the contract strike price with the current underlying price and send the liquidation order. For example
if self.Portfolio[self.atm_call[0].Symbol].Invested: if self.Securities[self.atm_call[0].Symbol].AskPrice > self.atm_call[0].Strike: self.Liquidate(self.atm_call[0].Symbol)
Using Ask or Bid price depends on your algorithm.
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.
Joseph Cohen Bacchilega
Hello Jing,
Thank you very much for your time, code example and expertise: this is very much appreciated.
You explained to me how to liquidate an option contract before expiration and how to verify its strike price relative to the underlying price.
What I'd ideally want to achieve now is to liquidate the option contract at the worst possible moment: out of all the prices the underlying will touch, I'd like to identify the one which is further away from the option strike and liquidate it that day. Can you kindly confirm to me there is no way to do this automatically? I think I can code it myself if there's not: maybe it'll be useful to other people as well (LEAN engine's assumptions that american options are always liquidated at expiry might show some strategies to be performing better than what they'd do in the real market, where options might be assigned, for the better or for the worse, before they expire).
The only problem in coding something like this is that the OnData() function only looks at a single tick values: we can't possibly check the future or the past in there (nor we want to - we'd be searching every tick for something we only need once: the liquidation date according to the "worst possible" idea).
If I might ask: what do you think would be the best way to code something like this? I'm not asking for specific code examples, just a general "best practice" idea. I was thinking about a function that gets called every time we sell an option: the function would need the option strike and the underlying prices for the period before expiration, and would return either nothing or a flag that indicates when the market will assign the option. The result of this function should be stored in a global variable and OnData will always check this variable and call .Liquidate based on what's stored in it (we could use a date, or the underlying price).
Thanks again for your input!
Joseph.
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.
Jing Wu
If your liquidation condition is complicated you can create a function with arguments with the underlying price. if not, "if else" statement would be easier to implement. "identify the one which is further away from the option strike and liquidate it that day" This "further away" is hard to define as you only have the history price without the future price. If you need the history price of underlying, you can use the rolling window to save the history bar.
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.
Deniz Erkan
Has this issue been addressed? Jing Wu's post is not really answering Joseph's question above. I am facing the same issue here : How does the backtesting engine decide WHEN to assign the options to the short seller? i.e. I sold put options on GOOG for $100 strike due date Jan 31. Before the expiration, on Jan20, GOOG trades at $99. Does the engine auto-assign the option on Jan 20 in this case? How does the algorithm work here?
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.
Marcello Ranone
Hi there, I am interested knowing how to do this too. I hope someone more expert could help and reply. Maybe it may be sufficient to retrieve future prices from the underlying in OnData (although I don't know how)?
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.
Jared Broad
They are simulated with the BasicOptionAssignmentSimulation class which is added to the backtesting brokerage here.
This is not configurable at this time but it was designed in a way it could be configurable. It's not simple stuff though, so I'm not sure it makes sense to 99% of the community to make it configurable on the algorithm layer.
What are you trying to achieve?
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.
Marcello Ranone
Hi Jared, thank you for your reply. As Joseph mentioned the objective is to simulate how we get assigned on an option in the worst case scenario. Let's assume we are in a SELL PUT strategy, we may want to be assigned when the underlying goes at its minimum, ie. at our most potential loss, and not at expiration. I know that none of the two policies would be 100% realistic, but I believe both of them are useful for backtesting purposes. In other words, we would like the "backend" to be the oracle, knowing what's the best time for it to sell stocks to us (in case of a SELL PUT strategy).
Anyway I will have a look at the class to figure out how it works. Thanks!
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.
MichaelM
I'm not an expert in Options, but as far as I understand the likelihood of being assigned early on a short option is directy related to the extrinsic value of that option.
ATM or slighlty ITM options have mostly extrinsic value, so the option owner will make more money selling his option rather then exercise it, i.e. assignment is unlikely.
There are 3 cases where assignment is highly likely:
I think coding these conditions into the backtest would produce more realistic results.
Looking at the LEAN backend implemenmtation of BasicOptionAssignmentSimulation:
/Brokerages/Backtesting/BasicOptionAssignmentSimulation.cs
It seems to use a heuristic of assigining short options if they are deeper then 5% ITM and close to expiration, which I think is over simplification and would produce overly optimistic backtest results.
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.
Scott Woods
This is kind of embarressing, but I can't seem to figure out how to initalize a candle stick indictator.. any help?
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.
Stefano Raggi
@Scott,
candlestick pattern indicators are quite simple to use:
1. define a variable for the indicator in your algorithm class:
private Harami _pattern = new Harami();
2. create an instance of the indicator in your Initialize method using one of the CandleStickPattern helper methods:
_pattern = CandlestickPatterns.Harami(_symbol);
3. in your OnData, test the value of the indicator value:
- if the value is 0, no pattern found at the current bar
- if the value is +1, bullish pattern found at the current bar
- if the value is -1, bearish pattern found at the current bar
Note that some patterns are only bullish, some are only bearish and some are both.
I attached a simple example algorithm for you
Hope this helps
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.
Scott Woods
Thank you so much, I was making a bit of a foolish error. Your example helped me a lo, it was just what i was looking for.
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.
Boris Sachakov
@Stefano, Hi!
I followed your example above and wrote an almost identical algorithm for SPY with Closing Marubozu Candlestick pattern. I used the provided data (local Lean data). It worked and performed about 20 trades for the period of 2014 (I set this period of time).
However, when I adjusted the algorithm to receive custom data directly from Yahoo.com with Quandl Wrapper (as recommended in How Do I Import Yahoo Data? in QuantConnect University) I encountered the following problem:
The data is not getting through in OnData method past: if (_pattern == 1) or if (_pattern == -1). It is getting through OnData, but is somehow blocked by == . If I replace it by anything else, the algorithm finds 1st Closing Marubozu pattern on 01/17/2014. So the patterns are definitely there, plus we know that they are there from my earlier algorithm that I ran on Lean data.
Please, recommend the solution. Thanks in advance.
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.
Stefano Raggi
@Boris, to use Quandl data, the easiest way is to prefix the symbol (YAHOO/INDEX_SPY) and use a custom class derived from the base Quandl class.
The problem with your algorithm was that deriving from BaseData all OHLC values were the same, so no patterns could be found.
Here is the revised algorithm:
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.
Boris Sachakov
@Stefano
Thanks for the above help. However, I still want to find a way to be able to use the custom data. I was going to start to try by importing first Yahoo data with Quandl data, and then evetually to import my data with link to Dropbox (as in CustomDataNIFTYAlgorithm.cs).
Also, please, explain how is that all OHLC values were the same in my original algorithm and how to fix it. Thanks in advance.
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.
Stefano Raggi
@Boris,
when I mentioned that OHLC values were the same, I didn't mean the instances of your BaseData-derived class, but the inputs to the candlestick patterns, which are generated internally by a consolidator (in your case a BaseDataConsolidator, which only has a BaseData type as input, instead of a TradeBar). What happens is that the pattern class receives an input TradeBar with all OHLC values equal.
The solution is to derive your class from TradeBar, so a TradeBarConsolidator will be used and the candlestick pattern will get the correct input (TradeBar), as in the attached 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.
Boris Sachakov
@Stefano,
Thanks again for your help. Your above algorithm worked really well and provided me with a few lessons to learn now. I just wanted to mention that in order to run it on Visual Studio, I needed to add
using QuantConnect.Data.Market;
for TradeBar to work.
Let me study your code and see if I have any further questions. Thank you.
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.
Boris Sachakov
@Stefano,
I have now studied your algorithm. Thank you again for providing it. I just have a couple of questions. What is the necessity for EndTime and Period methods inside of
public class CloseMar : TradeBar
when we already have TradeBar.Open and TraderBar.Close values from the 'try' block of 'BaseData Reader'. Plus algorithm seems to able to run without these 2 methods.
Looking forward to your response. Thanks in advance.
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.
Stefano Raggi
Time and EndTime are properties defined in the BaseData class and represent the start and end time of the bar, Period is defined in the TradeBar class and represents the time span between the start and the end of the bar (the default is one minute).
If we don't override them, the custom CloseMar bars will be timestamped incorrectly as one minute bars instead of daily bars.
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.
Boris Sachakov
Thanks for your help. I might have some more questions later.
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.
Boris Sachakov
@Stefano,
I used your latest algorithm from above and substituted the www.Quandl.com... in GetSource with link to www.Dropbox.com... with my daily ES data for 2015 (as in CustomDataNiftyAlgorithm.cs). There is no AdjustedClose in this data, so I had to make appropriate (I hope) changes. I ran this algorithm, again looking for Closing Marubozu patterns. But I got nothing. I did not work. Maybe you can review and critique my work please. As always, thanks in advance.
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.
Alexandre Catarino
First, please checkout the data format. You are trying to parse datetime with the "yyyy-MM-dd" while the your first column has a "yyyyMMdd" string:
cmBar.Time = DateTime .ParseExact(data[0], "yyyyMMdd", CultureInfo.InvariantCulture);
Do you really need to override EndTime and Period? After I removed that from the code, the data flew are expected, the indicator was calculated and there were 18 trades.
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.
Boris Sachakov
I have discovered the problem myself, after multiple tries.
In DateTime.ParseExact's format portion I originally put in "yyyy-MM-dd". As soon as I changed it to "yyyyMMdd", it worked. See the algorithm and backtest. Even though the financial results were poor, but that wasn't the goal at this time. I just need first to get the parts moving correctly.
Thanks again.
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.
Boris Sachakov
@Alexandre,
I posted my last comment before I knew you posted yours. Maybe we even posted them almost at the same time. I changed the date range a little bit too. Anyway, thank you for confirming that date format was incorrect.
Concerning overriding EndTime and Period, I followed the recommendation by Stefano Raggi (see his earlier comments on this thread). I also earlier discovered, that by removing them from the code, the number of trades does not change and financial results do not change, just like you said. However, if we remove override EndTime and Period from the code, each line in the log (and each corresponding trade) are registered 24 hrs earlier. Please see 'Logs' and 'Trades' after running a backtest on QuantConnect. So the dilemma for me now: which one represents the actual time of events?
Looking forward to your response.
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.
Alexandre Catarino
When we define the Period and EndTime, the results, in terms of date/time, are more accurate.
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.
Boris Sachakov
What you are saying is that we should be overriding EndTime and Period?
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.
Boris Sachakov
I want to present one more algorithm I just created and ran. It calls intraday 5-min ES data, also looking for Closing Marubozu. On 2016/01/04 it makes 2 trades. However, the time logged and the trade is at 9:56 instead of 9:55, and 10:16 instead of 10:15. The time is Chicago time. The data is every 5 minutes, for example 9:55, 10:00, 10:05; not 9:56, 10:01 or 10:06. I did not include override EndTime and Period in this last algorithm.
What seems to be the reason for this 1-min discrepancy? Thank you in advance.
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.
Jared Broad
Period for a bar tells LEAN when to send the bar to the algorithm. If the bar starts in Jan 1 2001 and has a 1 year period; it won't be released until Jan 1 2002. If you don't specify the period it will be released immediately in 2001. This would mean you could "look ahead" into the future and isn't desirable.
EndTime is calculated with Time+Period; custom data defaults to a 1 minute period.
All data has a period; even instantaneous point data has a period of 0s.
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.
Boris Sachakov
Thanks Jared!
Let me see how I should use your suggestion and I will get back to you.
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!