New positions can be opened closed between T+26 and T+100, but nothing related to expiring option. It doesn't get rolled or anything. I have continuous option prices(until expiration of course).
Figuring/carrying expiration date is not my main concern. I am wondering how to sell at the correct value when it expires, last price of the option doesn't necessarily indicate correct settlement value.
At each next do I check if it is past expiration for all open positions and then close accordingly ? How will the trade go thru if there is no data (because it's past expiration) ?
Reconsidering this Indicator, it should probably be called something else like Study, Analysis, Post-Analysis, Forensics ...
The reason is that the actual produced value is being stored at in the past -3 (or -self.p.period // 2) instead of at 0.
For an analysis with frozen data the code indicates where the swing points are, but as a practical indicator, it should point out at position 0 that something happened which has to be acted upon ... now.
That's probably no code from notify_trade (or else a lot is missing), because you are checking an order from what seems code from a sample notify_order
Two different orders are being processed which may or may not be related at all. Since the price and size components are unknown, it is difficult to evaluate what it's actually being delivered and what the expectation would be.
The issue is seen when I backfill static data and for some reason, when using the .resampledata() method, the system is dropping every other bar. This is identical to another issue we were seeing when I was trying to .resampledata() from the InfluxDB feed. In that case, .adddata() produced all bars. .resampledata() dropped every other bar.
This issue was due to not having specified the sessionend for the data, which collided with the algorithm in charge of knowing when the day has come to an end. This was also the reason to add the default sessionend to, at least, all CSV data feeds, which has uncovered that some users were even not actually specifying the incoming timeframe, which was confusing the resampling code.
One of the main purposes of setting up the community was to have things kept here as a reference for other users to see, rather than (for example) having things scattered across closed tickets in GitHub or as comments in a separate platform for the blog.
As such the best way to seek answers probably is:
Put the code here (use the COMPOSE button to see how to best paste, but the syntax is standard markdown)
Paste the chart which shows the many buys and sells, given it has been produced
The default chart has a plot of the evolution of cash and the total portfolio value
There is no need real need to paste the data unless it may be running for example backwards (like it happened to one user) or you want to show an specific amount of data describing a use case (for example breaking resampling)
Bonus question: How do you an equity curve on a separate chart ?
Two (2) indicators are declared in the __init__ method of the Strategy and two (2) indicators show up in the char
BollingerBands which defaults to plotting along the data (because the values from this indicator are meant to be in line with the value)
RSI which defaults to be plotted on a subplot because it has fixed values ranging from 0 to 100