Detect if an indicator value is rising / falling

25 views
Skip to first unread message

ekz

unread,
Aug 9, 2022, 10:21:30 AM8/9/22
to OptionStack
Hi all, 

I'd like to backtest a signal that includes a rising EMA. How can I easily check if my EMA value (or any other indicator value) is rising or falling? 

Thanks in advance.

OptionStack

unread,
Aug 9, 2022, 10:36:35 AM8/9/22
to OptionStack
To determine whether an indicator is rising or falling, you can take the Slope of the indicator using the LinearRegSlope method.  

If the indicator is rising, the slope will be greater than zero.  If the indicator is falling, the slope will be less than zero.

EMA_Slope.png

Here is an example:  Slope of Indicator Example

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.

ekz

unread,
Aug 31, 2022, 11:08:57 PM8/31/22
to OptionStack
Great. Thanks a lot for this.
Reply all
Reply to author
Forward
0 new messages