To create a condition to enter a trade X days after a signal has occurred, you will need to use
dummy positions.
A
dummy position is an invisible position whose attributes (prices, option greeks, etc..) can be referenced by your strategy to help define your trading signals, but whose transactions will NOT appear in your portfolio statistics / transaction logs. They are created using the
trackButDoNotTrade method.
Dummy positions can be used to track the properties of specific events / conditions / prices / etc, without affecting your portfolio statistics / transactions.
For example, you can use dummy positions to track the prices of 20-delta calls across time or the prices of at-the-money straddles, etc.. Or you can use dummy positions to make trades X days after a market condition is satisfied.
In your situation, you can create a dummy position when MACD / Stochastic hit your thresholds.
And then used the daysElpased method to enter your actual trade X days after the dummy position was created.
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 or other services by OptionStack. In addition, the content of the website offers no opinion with respect to the suitability of any security or any specific investment. There are no guarantees as to 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. Past performance is no indication or guarantee of future results. All investments involve risk – including loss of principal. You should consult with an investment professional before making any investment decisions.