Did you try:
Buy = BuyCondition AND Cross(c,bbBot);
Short = ShrtCondition AND Cross(bbtop , c );
----- Original Message -----To: AmibrokerSent: Monday, July 18, 2016 10:55 AMSubject: [amibroker] Bollinger Bands
Hi all,In the code below the idea would go into operation when the closing price, after crossing the top or bottom line BB, close between the bands.But it does not work. Could anyone help?////////////////////////////////////simple dummy systemPeriods=Param("Periods", 20,20,40,2);Width = Param("Width", 2,2,4,1);bbTop = BBandTop(C, Periods, Width);bbBot = BBandBot(C, Periods, Width);bbMid = MA(C,Periods);BuyCondition = Ref(C, -1) < Ref(bbBot, -1);Buy = BuyCondition AND Cross(bbBot, C);Sell = Cross(C, bbMid);ShrtCondition = Ref(C, -1) > Ref(bbTop, -1);Short = ShrtCondition AND Cross(C, bbTop);Cover = Cross(bbMid, C);//////////////////////////////////////////////
![]()
This email has been checked for viruses by Avast antivirus software.
www.avast.com
__._,_.___
Posted by: "ajf1111" <ajf1111@epix.net>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (49) |
Save time and get your email on the go with the Yahoo Mail app
Get the beautifully designed, lighting fast, and easy-to-use Yahoo Mail today. Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
.
__,_._,___
EmoticonEmoticon