Price days Back

27 views
Skip to first unread message

Elvio Romeo

unread,
Oct 27, 2022, 12:13:24 AM10/27/22
to OptionStack
Hello, OptionStack is amazing!

I would like to trade when Close Price bar.... is >  Close Price of 6 months ago bar

How can I do that?

thanks in advance

Elvio

OptionStack

unread,
Oct 27, 2022, 12:37:35 AM10/27/22
to OptionStack
Thank you for your feedback!  We are excited that you find OptionStack amazing! 

To answer your question, you can use the Lookback method to refer to prices X number of bars ago.  Since there are about ~20 bars in a month, you can lookback (20 * 6 = 120) bars to compare prices from 6 months ago.   You may also want to use the Variable block to specify the number of bars to lookback.

lookBackNumBars.png 

Here is a working example:  Price Days Back 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.

Reply all
Reply to author
Forward
0 new messages