Re: [amibroker] Bollinger Bands

 

Change

Buy = BuyCondition AND Cross(bbBot, C);

to

Buy = BuyCondition AND Cross(C,bbBot);

same for the short side


On 7/18/2016 7:55 AM, Edilson Santos edilson.floriano@yahoo.com.br [amibroker] wrote:
 
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 system
Periods=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);
//////////////////////////////////////////////

__._,_.___

Posted by: Ara Kaloustian <ara1.kaloustian@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (50)

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/


.

__,_._,___

Related Posts


EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng
:lv