Click here to Login





                                                   Lookback period on Bollinger Band cross

  0

0
Glen
2016-07-18 09:33:20


Hi guys,

I am implementing the following rule in one of my systems:

cross(close, BbandsLower(14,Op9,_MaSma))

What I want to try and do is identify if this rule occurred within a lookback period of 5 days.

Does anyone know what I have to do to set a lookback period on this rule?

Thanks very much.



Glen
2016-07-18 17:27:31

  0

Sorry should read:

cross(close, BbandsLower(14,2,_MaSma))

Op9 was an optimization parameter.



QuantShare
2016-07-19 04:08:51

  0

You should type:

a = cross(close, BbandsLower(14,2,_MaSma));
a = hhv(a, 5) > 0;

You can plot these on a chart to visualize that.



Glen
2016-07-19 06:42:30

  0

That is great thank you so much.

So this means that if the close crosses above the Bbands lower within the previous 5 day period, a returns a value of 1.

Then all I do is call on "a > 0" for the buy rules.

What is the hhv calling on there?



QuantShare
2016-07-21 15:34:00

  0

Yes, "a > 0" or just "a".
buy = a;

hhv is highest value over a specific period. Plot it on a chart to see.

a = cross(close, BbandsLower(14,2,_MaSma));
a = hhv(a, 5) > 0;
plot(a, "");



No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Percent Bollinger Bands
Percent Bollinger Bands smothed with exponential Moving Average
Double Bollinger Bands Trading System
EMAs Cross Strategy
Ratio of Stocks above and below Bollinger Bands

How-to Lessons
How to perform a basic quantitative analysis using the S&P 500
How to plot a stock using different periods in the same chart
How to dynamically update the settings of an indicator
How to create a screen
How to detect stocks trading near all time highs

Related Forum Threads
bollinger band & rsi formula
Increasing lookback period
9 period sma added willr indicator
Cross Hairs Color
Black background charts ..how to change cross hairs colors?

Blog Posts
Quantitative Analysis: Price Channels
Trend following systems
Backtesting chart patterns using the auto support and resistance ...
Different Types of Trading Indicators: Trend, Momentum, Volatilit...
Fundamental analysis: How to track economic indicators in the For...









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.