condition "x days ago"

20 views
Skip to first unread message

Miguel Garcia

unread,
Oct 13, 2022, 4:43:12 PM10/13/22
to OptionStack
Hello, just signed up to trial OptionStack.  

How can I establish a condition for "x days ago"  ?, trying to establish the below conditions: 

"MACD histogram is positive" x days ago
"Stochastics below 30" x days ago

None of the available days/calendar functions seem to allow for this...

tks
Miguel G.

OptionStack

unread,
Oct 13, 2022, 5:26:45 PM10/13/22
to OptionStack
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.

dummyPosition.png

And then used the daysElpased method to enter your actual trade X days after the dummy position was created.

realTrade.png  

Here is a working example:  Trade X Days After MACD / Stochastic signals

waitXDays2.png

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.
Reply all
Reply to author
Forward
0 new messages