Australian (ASX) Stock Market Forum

Amibroker FAQ

Thanks CanOz - I recently watched this and it was extremely useful in creating a basic system, just wasn't sure how that code would be used in the actual Bollinger indicator. When I ran a back test and went through to a chart of a stock that matched the screening, it would still have the default bollinger band settings so I couldn't see exactly where it touched the upper band if it was 3 std dev etc.

Ok, but can you change the plot of the bands to be the same as the signal? Or this is the part you're not actually sure of how to code?
 
Thanks Gringotts, where exactly do I place the above? Do I just put it in anywhere among the current code, so,


a = BBandTop(C,100,3);
b = BBandBot(C,100,3);
Plot(a,"top",colorBlack);
Plot(b,"bott",colorBlack);

?

Just use the above on its own for now. Keep it simple. Drag and drop it on a price chart to see the bands with 3 std devs.

Now add your buy/sell conditions.

eg. Buy = cross(C,a)...etc.
 
Ok, but can you change the plot of the bands to be the same as the signal? Or this is the part you're not actually sure of how to code?

That's what I am not sure about, the bollinger band system works great (as I used the one in the video you referenced). But I don't know how to change the default settings on the Amibroker Bollinger Band indicator to match the system (100 day MA, top band 3 std dev, bottom band 1 std dev). I am unsure what to change on the code.

Thanks again for any assistance.
 
Just use the above on its own for now. Keep it simple. Drag and drop it on a price chart to see the bands with 3 std devs.

Now add your buy/sell conditions.

eg. Buy = cross(C,a)...etc.

Thanks Gringotts, I will give it a try by modifying the original Bollinger Band indicator code to the above, although I am trying to make the bottom band 1 std deviation so would it be the below instead of another C,100,3 for B?

a = BBandTop(C,100,3);
b = BBandBot(C,100,1);
Plot(a,"top",colorBlack);
Plot(b,"bott",colorBlack);
 
Thanks Gringotts, I will give it a try by modifying the original Bollinger Band indicator code to the above, although I am trying to make the bottom band 1 std deviation so would it be the below instead of another C,100,3 for B?

a = BBandTop(C,100,3);
b = BBandBot(C,100,1);
Plot(a,"top",colorBlack);
Plot(b,"bott",colorBlack);

yep

for further,

AB > Help > search bar > type "Bbandtop"
 
You can use this if you like, just paste in in formula editor and save it somewhere then drag it over a chart. or add it to your code.

The you can adjust all the parameters in the parameter box. I added some comments for you that might help

_SECTION_BEGIN("Custom BollingerBand");
//BollingerBands
//--------------------------------------------------------------
BollTopPer = Param("Bollinger Band Top Period",100,1,500,1); // Allows you to change top band period
BollTopWid = Param("Bollinger Band Top Width",3,0.1,10,0.1); // Allows you to change top band width
BollTop = BBandTop(C, BollTopPer, BollTopWid); // Top Bollinger Band

BollBotPer = Param("Bollinger Band Bottom Period",100,1,500,1); // Allows you to change bottom band period
BollBotWid = Param("Bollinger Band Bottom Width",1,0.1,10,0.1); // Allows you to change bottom band width
BollBot = BBandBot(C, BollBotPer, BollBotWid);// Bottom Band
//---------------------------------------------------------------
Colour1 = ParamColor("Bollinger Bands Colour", colorGrey40); // Allows you to change colour

Plot(bolltop,"Bollinger Top",Colour1,styleLine); // Plots bands on the chart
Plot(bollBot,"Bollinger Bottom",Colour1,styleLine);
//----------------------------------------------------------------
_SECTION_END();
 
Thanks everyone - most appreciated!

Is it possible to add the 100 day MA line into the below or do I need to run two indicators at once and change the MA duration from 15 to 100 days?

a = BBandTop(C,100,3);
b = BBandBot(C,100,1);
Plot(a,"top",colorBlack);
Plot(b,"bott",colorBlack);
 
Thanks everyone - most appreciated!

Is it possible to add the 100 day MA line into the below or do I need to run two indicators at once and change the MA duration from 15 to 100 days?

a = BBandTop(C,100,3);
b = BBandBot(C,100,1);
Plot(a,"top",colorBlack);
Plot(b,"bott",colorBlack);

The midline?

Just add in:

Plot(MA(C,100),"",colorblack);
 
Hi,
I want help in this code. I got it from one member. he sent this question i also tried it .
Code:
for(i=1; i<=5; i++) {
TimeframeSet(i * in1Minute);
up15= C > O; 
TimeframeRestore();
}


for(i=10; i<=15; i++) {    
TimeframeSet(i * (2*in5Minute)); 
up1015= C > O;
TimeframeRestore();
}


expandmode = expandPoint;
up15= TimeFrameExpand(up15, in1minute, expandmode);
up1015 = TimeFrameExpand(up1015, (10*in1Minute), expandmode);

Plot( C, "Price", colorYellow, styleCandle ); 
PlotShapes( IIF( up15 AND up1015, shapeUpArrow , shapeNone ), colorAqua );


QUESTION:
if there is bar PATTERN BETWEEN 1min. to 5min.
if there is bar PATTERN BETWEEN 10min. to 15min.
if BOTH CONDITION IS RIGHT..
putting arrow on 1 min. timeframe.



PROBLEM:
which expandmode function should be used ?

1. Is this code right?
2. In this problem , arrow isn't stable, IT'S MOVING with price.

Kindly give your opinion..

regards

Hi, In gif pic( below link) ,you can see Arrow is not aligned with price (candlestick)? as i mentioned in 2, Kindly help.
http://imgur.com/gJ1tP69


regards

I know that,it's not among usual problems. Any input?

regards
fxtraders
 
Round lot is 1
Margin is 2500 minimum
Tick size.5
Point value 25 eur
 
Does anyone know why Amibroker only has added 299 symbols?:confused: I have created a new database and placed 400 tickers. Amiquote downloaded 400 tickers succesfully.
 
Far out, waste heaps of time trying to figure what went wrong as per my post above. And now i know why, there's stock that are in both ASX200 and Small all ordinary index. Gee did not thought the stocks would over lap between large and small cap?!?!?.:banghead::banghead::banghead:
 
I'd be very grateful if someone could help me with a little bit of code please? I want to open a file (txt or csv) containing symbols and buy dates, and buy each symbol on the associated date in the backtester. Sell, stop, position size etc I can manage with afl.

I found some afl code by Howard Bandy but it seems incomplete, how are the dates managed for each symbol? 'Foreign' doesn't seem to have enough parameters?

https://www.mail-archive.com/amibroker@yahoogroups.com/msg13248.html

1. Outside of AmiBroker, create a data file with the signals, and save it
as a .csv file -- say SIGNAL.CSV.
The dates should be in one of the formats that AmiBroker can import easily.
"yyyy-mm-dd" works.
The signal can be -1, 0 ,+1. Or you might want the signal to be 9, 10, 11
-- so all the values are positive.
2. Inside of AmiBroker, from the File menu, select Import ASCII.
Navigate to SIGNALS.CSV and import it.
It will show up in the list of symbols.
3. To use the signals in a backtest,
In an AmiBroker program:
sigs = Foreign("SIGNALS",C);
RestorePriceArrays();
Buy = sigs>=10.9;
Sell = sigs<=10.1;
Short = sigs<=9.1;
Cover = sigs>=9.9;
Plot(C,"C",colorblack,stylecandle);
Plot(sigs,"sigs",colorred,styleline|styleownscale);


Also found some OOP code on the AmiBroker knowledge base (http://www.amibroker.com/kb/2014/09/) but its way over my head. .afl I can muddle through, OOP - forgetaboutit.

Thanks in advance.
Joe.
 
Hi all.

I have a really basic question which I'm sure you all know of top of your heads.

What is the function that I use to scan for an event withing past 20 periods.

Example: moving average crossover within past 20 days. (I do not want to use the scan function date range for this)

Thanks:xyxthumbs
 
Hi all.

I have a really basic question which I'm sure you all know of top of your heads.

What is the function that I use to scan for an event withing past 20 periods.

Example: moving average crossover within past 20 days. (I do not want to use the scan function date range for this)

Thanks:xyxthumbs

a = ma(c,10);
b = ma(c,20);
d = cross(a,b) and V*C>500000;
dd = sum(d,20)>0;
Filter = dd;
addcolumn(C*V,"indic. t/o");
 
Top